Clothes player starts in

Jennifer Wren
06 Aug 2022, 06:23

I have a character who is wearing something before the game begins. (it is not visible, though.) How do I tell the game the player is wearing this?


mrangel
06 Aug 2022, 08:57

The simple solution: set the object's worn flag to true.

However, this won't apply any stat modifiers for the item or change its alias to include "(worn)" at the end. If you want these things to be done, then in the object's initialisation script (which you can enable on the "features" tab) you should put the line:

WearGarment (this)

(it is not visible, though.)

Not sure what you mean by this. You mean you want the object to be worn despite not being visible? This is a somewhat odd thing to ask for, as invisible objects are generally ignored. If you mean an object which the player is "wearing" but it doesn't appear in their inventory or have any effects, it would probably make more sense to treat it as pure flavour – run WearGarment (name_of_object) when it becomes visible.


Jennifer Wren
13 Aug 2022, 02:47

I just don't want it to appear in inventory but have effects before it becomes visible


mrangel
13 Aug 2022, 07:36

In that case, I suspect that the best option would be running WearGarment in your start or initialisation scripts. I don't think those actually check for visibility, but I don't have Quest on this computer to check.


Jennifer Wren
14 Aug 2022, 00:40

I decided to let the player dress. The shoes were complicated.
I need to take them off for the player. Is there any way to do that?
I tried Remove Object. They disappeared.
I tried Move Object to Current Room. They moved from inventory to room still saying (worn).
And then they could not be removed even by the player because they were not still in inventory.
I might just have to say remove your shoes or stay locked in the closet forever, but
the first thing I tried was
Unset flag Object (shoes) Flag name (worn)
which was prewritten not java script (but did absolutely nothing.)


mrangel
14 Aug 2022, 17:35

I think you want RemoveGarment (shoes).

The utility functions WearGarment and RemoveGarment set or clear the worn flag, update the player's stats if necessary, add or remove (worn) at the end of the alias, and change the object's inventory verbs.


Jennifer Wren
14 Aug 2022, 21:15

Thanks, Mr. Angel!
"Unset" flag(worn)
from the dropdownenu does absolutely nothing, but RemoveGarment (shoes) might work. I will give it a try.