Can you order one action before another?

The player has to wear five items: shirt, pants, socks, shoes, jacket.

What I want to do is let the player put them on in any order, i.e., he can wear the socks over the shoes and the shirt over the jacket, but how would you go about coding that?

He also needs to be able to look in a mirror and see that he is mis-dressed. Again, how would you do that?

You should start by reading page 9.3 in the Recipe Book. Try out all of the examples there in a new, empty game and study them.

Your specific example seems to me like it might be a bit easier than the 9.3 examples. Letting the player put the clothes on in any order is easy peasy–by default, if you define them as wearable, there isn’t anything preventing the player from putting them on in any order! The 9.3 examples are largely about preventing people from wearing their underpants over their pants and the like.

What’s more difficult is keeping track of the order they put them on here. You could do something like this with a list of the clothing that they’re wearing; whenever the player puts something on you add that item to the list, and whenever they take it off you remove it. (You might also want to do an every turn rule to make sure that they’re wearing everything on the list, just in case there’s another way for a piece of clothing to get removed.) Then when you want to do the check for being misdressed you can just look to see whether the list is in the right order.

This would require a bit of time with chapter 21 of Writing with Inform, on lists. I don’t have time to try to mock something up now but it might be interesting for you, or inspiring for someone else.

There are also surely a lot of other ways to do this.

Man…I suggest avoid layered clothing elements unless you are absolutely writing something that requires it as an integral element: say about a fashion show with quick-changes, or AIF where it can be a feature.

Philosophically, I used to be all about modeling everything. What I’ve discovered is that the more discrete and intricate steps something takes, the less interested and more grumpy players become. Players appreciate when sometime takes fewer specific commands.

Unless you’re going for humorous specificity, the above transcript would drive anyone up the wall.

That’s not to say you can’t high-level your way through the same idea.

I by no means mean to harsh your creativity in any way - write the game you want and dazzle us with how you do it - but don’t forget to take a step back sometimes and consider how much work something takes to program in opposition to what you’re trying to do with your story. Sometimes it’s worth it to to take some authorial license say “Okay, you board a cruise ship. Five days later, here you are in Mexico, only four pounds heavier.” rather than detail five days of shuffleboard and buffets that will slow down your narrative and become a potential obstacle between players and your game.

Thanks for all the replies. I’m going to take HanonO’s suggestion.