How do I make a player able to hide behind an object in a room, such as, a plant?
I imagine this is an Inform 7 question?
Yes, Sorry for not specifying!
I’m no good at I7, but I went looking for some game source with hiding in it. The one has some (do a search on “hide” or “hiding in”):
Untested pseudocode lacking tabstops:
Hiding behind something is an action applying to one thing.
Understand “hide behind [something]” as hiding behind.
A thing can be a hidingplace.
Yourself can be hidden.
Check hiding behind:
-if the noun is not a hidingplace:
–say “That is not a good hiding place.” instead.
Carry out hiding behind:
-now yourself is hidden.
Report hiding behind something:
-say “You step out of sight behind [the noun].”
Carry out doing something besides looking or examining:
-if yourself is hidden:
–now yourself is not hidden;
–say “(first emerging from your hiding place)”.
Check the angry dragon devouring the player:
-if yourself is hidden:
–say “The dragon looks around, snarling, unable to see you due to severe myopia.” instead.
The potted plant is a hidingplace.