Take All - Wear All?

Heya All,

The Take All command is very useful, as my play-around testing room starts with four articles of clothing the player needs to put on.

I’ve noticed that if I have a single article of clothing in my inventory and input “wear all”, I will put it on. However, if I’ve got a bunch of stuff in my inventory or nothing wearable and several clothing items in the room, i.e shirt shorts socks hat, I get “You can’t use multiple objects with that verb.”

I’m curious to know why this is, and what the way around it is? I assume it could be difficult for Inform 7 to decide which pieces of clothing to wear if there are two shirts, but this doesn’t sound insurmountable.

I think what happens is that first, the parser tries to see what ‘all’ means, in the process of trying to understand the player’s command. Then it tries the action. The ‘wearing’ action can work with only one thing at a time, simply because not everything can be worn. If ‘all’ turns out to be only one thing, and it’s wearable, the action will succeed. But if ‘all’ is more than one thing, then you get that message. There are some actions that do allow multiple objects, namely ‘taking’, ‘putting (it on)’, ‘inserting (it into)’ and ‘dropping’–this is for purely practical reasons (for one, for a different action, each object might have a different result, and if there are many objects, the screen might fill with text. Also, what if putting on a hat teleports you to a remote location?? You might get 'You can’t see (the wand) here…You can’t see (the cape) here…). See the Inform Recipe Book S6.15. According to it, you should be able to do this if you want ‘wearing’ to apply to multiple objects–

Understand "wear [things]" as wearing.

Note that it says things–plural.

If you have a bunch of unwearable things in your inventory (which the parser will prioritize over things in the room), you’ll need to change up what is called the ‘multiple object list’, which is generated when [things] is used, because some of these objects will not be wearable. This is what I suggest (take with a grain of salt):

Before wearing:
	let L be the multiple object list;
	repeat with n running through L:
		if n is not wearable:
			remove n from L;
	alter the multiple object list to L.

This is a bit ‘jumpy’ so you may need to experiment. I think when there are no objects being held by the player, the object list includes any take-able objects that are present in the room. I’ll let the experts here chime in.

1 Like