VictorGijsbers wrote:
Instead of taking suspicious hat:
try wearing suspicious hat.
This is dangerous code because the wearing action includes an implicit take so you end up in an infinite loop.
Narspicious wrote:
Instead of taking suspicious hat:
Say "You fling it on your head";
Now the player is wearing suspicious hat.
I wouldn't suggest converting taking a hat to wearing a hat because there is already an action for wearing, which responds to the command "wear hat". However, you may want to hint that you can wear a hat when just taking it. Try this.
Code:
"Test"
Report taking a hat:
say "You take [the noun]. You can also 'wear [the noun]' as well.";
rule succeeds.
After wearing a hat: say "You fling [the noun] on your head.".
Check wearing a hat when the player is wearing a hat (called the chosen hat): say "You have to take off [the chosen hat] first." instead.
The Testing Room is A Room. A hat is a kind of thing. A hat is always wearable. The red hat is a hat in the testing room. The blue hat is a hat in the testing room.
Test me with "take red / take blue / drop red / drop blue / wear red / wear blue".
Hope this helps.
PS. I believe this post should be under "Inform 6 and 7 Development" rather than "Getting Started and General Game Design". If this is so, then can one of the wizards of this forum bestow the relevant magic on this post? Thanks.