Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Room (string?) Templating #46

Open
jbheard opened this issue Oct 23, 2020 · 0 comments
Open

Room (string?) Templating #46

jbheard opened this issue Oct 23, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@jbheard
Copy link
Contributor

jbheard commented Oct 23, 2020

Allow templating for room descriptions. This could extend to other gameobjects as well.

For example:

- name: template_example
  description: |
    You enter the {{room_type}} room, there are cobwebs in the sides of the ceiling, and
    it seems as though nobody has entered for years.
  template:
    - room_type: 'template'
  actions:
    ...

The workflow would go as follows:

  1. Player enters the room; variables from template are loaded as gameobjects (only if they do not exist)
  2. Variables are loaded into the template, text displays "You enter the template room, ..."
  3. Player enters another room which sets room_type: 'something else', and then visits template_example room again.
  4. The text will now display as "You enter the something else room, ...", since the value of room_type has been modified.

This sets up rooms which can be modified at runtime, and the dev can create 1 room with a template rather than creating a whole different branch of rooms for the user. The same could be done with enemy descriptions and item descriptions.

@jbheard jbheard added the enhancement New feature or request label Oct 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant