I want to introduce ambience to my rooms. For this I want to have a rule that basically looks like this:
Every turn when the player is in a room:
if a random chance of 1 in 4 succeeds:
choose a random row in the Table of #room# ambience;
say "[italic type][ambience entry][roman type][paragraph break]"
#room# should be the name of the room. How is this done?
Thanks for your help.
[code]Every room in [ambiance region] has a table name called the ambiance. The ambiance of the Beach is the Table of Outdoor Ambiance.
…choose a random row in the ambiance of the location;[/code]
that is, regionalising the ambiance, avoiding adding empty tables to non-ambianced rooms (empty properties and/or tables are potential source of obscure and/or hard to hunt bugs)
I don’t think so. But you could make a kind of room and make sure those are the only ones with tables:
[code]An ambience-room is a kind of room. Every ambience-room has a table name called the ambiance. The ambiance of the Beach is the Table of Outdoor Ambiance.
…choose a random row in the ambiance of the location;[/code]
You can also give lots of rooms the same ambience, like this:
[code]An ambience-room is a kind of room. Every ambience-room has a table name called the ambiance. The ambience of an ambience-room is usually the table of Nothing Interesting Happening. The ambiance of the Beach is the Table of Outdoor Ambiance.
Table 1 – Table of Nothing Interesting Happening
ambience
“”[/code]