If the player is in the room?

I need something to happen only if a player is in the bank, but typing “If the player is in the bank:” Produces an error. Inform 7, latest build.

If your rule starts like this:

If the player is in the bank:

that’ll give you an error because Inform doesn’t know when to check it. You may want something like this:

Every turn when the player is in the bank:

so Inform knows to check it every turn.

Another thing you might want to do is say this:

Every turn when the location is the bank:

That is true whenever the bank is the room that the player is in – if the player is standing on a counter in the bank, “the player is in the bank” turns out false, but “the location is the bank” turns out true.

For an even more general solution to that part, you might want to get into the habit of using “is enclosed by” instead of “is in.” The difference is that “is enclosed by” also includes indirect containment, like being in a chair in the bank, or being in a chair on top of a table in the bank, whereas “is in” only counts as true when there is nothing between the two things. Likewise, if you want to see whether the player is carrying some coins, even when the coins are in a wallet, you can say “if the player encloses the coins.”

Thanks :slight_smile: