We've added a feature for builders to the game called conditionals, which changes the text presented to the viewer based on coded criteria. This applies to any text, so it includes say/emote, room descriptions, item descriptions, npc descriptions, and more.
When a builder uses a conditional in some text they provide results for if the condition is true and if it is false. Optionally when they only provide the result for true, no text will be displayed when the condition is false.
Conditionals are broken into two categories. Those that rely on properties found on the PC viewer and those that are environmental around the PC.
Player Character Conditionals
These are dependent on the PC viewer's properties and skills. An example would be the lore conditional tags, which rely on the lore skill of the viewer.
- Those without any lore skill
Sdesc: an old, runed dagger
Desc: An old dagger with worn runes on the blade.
- lore_apprentice any viewer who has the lore skill, but less than Journeyman
Sdesc: an ancient, runed dagger
Desc: An ancient dagger with worn runes on the blade. The script is too archaic for you to tell more than that it is from the age of Sorcerer Kings
- lore_journeyman viewers with the lore skill from Journeyman, but less than Master
Sdesc: an ancient, runed Allanaki dagger
Desc: An ancient dagger with worn runes on the blade. The runes are commonly found on items from Allanak.
- lore_master viewers above the max for Journeyman
Sdesc: an ancient, runed Allanaki Templarate dagger
Desc: An ancient dagger with worn runes on the blade. You recognize the runes as those used by the Allanki Templarate.
Future additions to might include affects on the viewer like detect magic, detect ethereal, or using spices; checks for character culture to determine what a room's name is displayed as, or what an animal is called. The character's stats could be used to inform the viewer how sturdy a door looks relative to their strength and bash skill.
Environmental Conditionals
An example would be the sun status conditional tags, which rely on where the sun is (if at all) in the sky being used in a room description.
- Sun is visible
A vast salt flat stretches endlessly before you, cracked into a mosaic of pale hexagons. The white ground blazes under the midday sun, throwing back a glare that stings the eyes.
- Sun is not visible
A vast salt flat stretches endlessly before you, cracked into a mosaic of pale hexagons. Under the night sky, the flat glows faintly silver, cold and still.
Future additions might include values such as weather condition, temperature, moon/sun phases, how crowded a room is, and if exits are opened or close.
Nesting
Nesting is putting a conditional in place of the true or false text.
- Viewer does not have detect magic
The mudbrick walls of this storeroom are bare, plaster long since flaked away.
- Viewer has detect magic, the following are appended as the next sentence
- Viewer has lore_apprentice
Glowing runes crawl across the far wall, their forms clearly ancient.
- Viewer has lore_journeyman
Glowing runes crawl across the far wall, angular and precise, Allanaki work.
- Viewer has lore_master
Glowing runes crawl across the far wall, characters the Allanaki Templarate were known to use.
Future Conditionals
Other categories we would like to add in the future would use properties on the characters and items being viewed, rather than the viewer. Properties on rooms would be covered in environmental conditionals.
Examples for items might be if a crossbow is loaded or not, text in the short description, long description, and description would change. For a lantern if it is currently lit or not and possibly what color it's light is.
Examples for characters could be how collectively stained their clothing is, their rested status, or if they are awake.
Notes
- This feature isn't meant to take the place of lore text that is shown to players via the assess command. Nor will it be a replacement for using read skills on books and scrolls.
- Because Evennia allows for color coding and some other text formatting, conditionals could use those to make players more aware of when they're seeing something important.