Question about going into an area without clothes

Hello. I have tried to search the forums but was unable to find an answer.

I am writing a game in Inform 7 that has a region called Street which obviously is outside. I want to make it so that the player cannot go into this region without wearing clothes and instead print a message saying something like “it’s too cold to go outside without any clothes.”

I am very new to Inform 7 and have no idea how to make this happen. =/

Hi,

This should help.

[code]if player is wearing nothing begin;

end if;[/code]

The easy solution is:

Instead of going to Street when the player is not wearing anything: say "It's too cold to go outside without any clothes."

If you want the player to wear more than one item, just add them to the rule:

Instead of going to Street when the player is not wearing the jacket or the player is not wearing the shoes or the player is not wearing the pants: say "It's too cold to go outside without enough clothes."

Thanks alot, this worked perfectly!!

For future expandibility, this may be a situation in which it’s worth writing more general purpose code:

[code]To decide if the player is decently clothed:
unless the player is wearing the jacket or the player is wearing the sweater or the player is wearing the t-shirt, no;
unless the player is wearing the jorts or the player is wearing the kilt, no;
yes.

To decide if the player is indecently clothed:
if the player is decently clothed, no;
yes.

Instead of going to Street when the player is indecently clothed:
say “It’s too cold to go outside without enough clothes.”[/code]

Then you can write other rules involving the concept of “decently clothed” and you only have one place in the rules where that concept is specified, in case you need to change it.

Thanks, that’s very helpful!