I need some help with inform 7. I’m trying to make it so a player cannot leave a room unless they are wearing clothes
How does this look? Off the cuff, no I7 access at the moment. Obviously, it will apply to all rooms, but I hope the general syntax works.
check going when number of things worn by the player < 1:
say “You need to put some clothes on.” instead;
Depending on how strictly you want to interpret “wearing clothes,” Andrew’s way will work if the only wearable items in the game are complete outfits. If there is a wearable wristwatch, the player could otherwise be buck nekkid and stride into public wearing that one thing.
You might wish to define an outfit kind that qualifies as clothing.
An outfit is a kind of thing. An outfit is wearable.
some work clothes are an outfit. a formal ball gown is an outfit.
a wristwatch is a wearable thing.
Check wearing an outfit:
-if the player wears an outfit:
–say “You are already wearing [a random outfit worn by the player]!” instead.
Check going west:
-if the player does not wear an outfit:
–say “You’d rather not go striding into Lady Wemberly’s dinner party unclad. Put something decent on first.” instead.
Similarly if you want multiple clothing pieces, you can define rules to restrict the player from moving where you don’t want them to.
Clothing is a kind of thing. Clothing is wearable.
A pantslike is a kind of clothing. A shirtlike is a kind of clothing.
A dresslike is a kind of clothing.
some jeans are a pantslike in a room. a teeshirt is a shirtlike in a room. a little black dress is a dresslike in a room.
Yourself can be indecent.
To decide if yourself is indecent:
-if yourself wears a dresslike:
-if yourself wears a pantslike and yourself wears a shirtlike:
Before going when yourself is indecent:
-say “You ought to put on some clothes first.” instead.
[this is pseudocode and might need tweaking to compile, but that’s how I usually do stuff like that. I put hyphens (-) representing tab levels.]