Checking if an item is worn or making an item worn by player

I looked up the clothing commands in the help part of Quest but it seemed to refer to the following:
'For more on handling wearable objects, see [here]((../wearables.html)'.
There seems to be a link missing to an internet address.

In my case I want to check if the player is wearing boots before climbing.
I also want to put the boots on the player if the player types "wear boots".


I also want to put the boots on the player if the player types "wear boots".

Make the boots wearable (I think you need to tick a box on the features tab, and then a new tab appears which lets you choose more options)

This should enable the "wear" and "remove" commands.

In my case I want to check if the player is wearing boots before climbing.

if (Boots.worn) { or if (GetBoolean (Boots, "worn")) { will tell you if the boots are worn.
That won't tell you if the boots are worn by the player or by an NPC, so you might need to check if the player has the boots as well; but if you've not written any code to make an NPC wear them, it's safe enough to just check the object's worn flag.

(The difference between the two versions is that if (Boots.worn) { will give an error if the boots aren't wearable; while the GetBoolean version will just treat not-wearable items the same as not-currently-worn ones)

(I'm not sure how those options will display in the GUI. You can probably paste it into codeview and then switch back to the GUI to find out how it appears)


Thanks mrangel

I must have missed seeing the wear option in the features tab.


Log in to post a reply.

Support

Forums