Change parameter at runtime

is there a way to change a room parameter dynamically? specifically, the room header.

i know that this isn’t possible:

(now) (room header #my_room) A different name

all i can think to do is have a duplicate room ‘off-stage’ and, when the time comes, reroute all the (from $ go $ to $) rules. but this is kind of complicated and i’m a lazy man and was hoping there was an easier way.

The standard way is to put conditions on the rule.

(room header #my_room)
    (#my_room is visited)
    Boring old room

(room header #my_room)
    Exciting new room

Or with a bit of syntactic sugar:

(room header (#my_room is visited))
    Boring old room

(room header #my_room)
    Exciting new room

Or with an if-statement:

#my_room
(room header *)
    (if) (* is visited) (then)
        Boring old room
    (else)
        Exciting new room
    (endif)

Of course, the condition can be whatever you want, like a new dynamic flag.

2 Likes

thx.that’s easy!

i always forget that with dialog i can pretty much put a condition on anything.

Yeah! It’s the language’s biggest strength, imo, and something that’s a notable weakness of Inform.

1 Like