Standard messages from a table in each room

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. :slight_smile:

You’ll need to associate your rooms with tables somehow.

[code]Every 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]

This also lets you use the same table for multiple rooms if you like.

Perhaps better:

[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)

Best regards from Italy,
dott. Piergiorgio.

this is all very helpful. however, can I also write “can have a table” so I’m not forced to have empty tables?

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]

(I may not have formatted the table correctly.)