Changing IDs

After I have defined the IDs for an item (“Understand “item” and “thing” as the item.”), how do I change these during the game? I want to add and remove IDs. Thanks!

I don’t think you can dynamically change understand statements during gameplay in a direct way (e.g. “Now understand ‘thing’ as the item”), but it’s pretty easy to get the same result using conditional understand statements:

Understand "thing" as the item while item-thing-identity-scene is happening; 
Understand "thing" as the item while the player carries the item;
[Etc.]
2 Likes

Oh wow, that actually seems to work! Thanks!!

(A bit sad that an essential variable as the ids of an item can’t be changed.)

Mike’s suggestion is changing them. They change based on game conditions. Inform is very condition-oriented.

1 Like

Alternatively, you can tell Inform to understand a property (or several) as describing something.
Then you can change that property.

A thing has a text called name1. [You can define several such properties.]
Understand the name1 property as describing a thing. 

The shapeshifter is a privately-named thing in the lab.
The printed name is "[name1]".
The name1 is "cake".

After examining the shapeshifter:
	now the name1 of the shapeshifter is "lie".
lab

You can see a cake here.

> x cake

You see nothing special about the cake.

> look

lab

You can see a lie here.

> x lie

You see nothing special about the lie.

> x cake

You can't see any such thing
2 Likes