I want the player to start wearing something

pretty self explanatory, is there an initialization script I can run to accomplish this?


n b

You do not need an initialisation script.

Create an object. Move the object to make it a child of the player object. On the features tab tick 'wearable'. On the wearable tab that has now appeared change 'cannot be worn' to 'can be worn'. Make the alias the same as the name plus '(worn)' - i.e. if the object is 'coat' the alias will be 'coat (worn)'. On the inventory tab untick the 'object can be dropped' option. Lastly on the attributes tab in the attribute section find 'worn' and set it to 'true'.

The command 'remove' will, by default, change the 'object can be dropped' to true, remove '(worn)' from the alias and set 'worn' to false.

I hope that is clear and I have not over or under explained anything.


The command 'remove' will, by default, change the 'object can be dropped' to true, remove '(worn)' from the alias and set 'worn' to false.

Incorrect. It will restore the object's alias and drop to what they were before the last time the WearGarment function was used on it. If you change the worn attribute manually as you suggest, this would remove the object's alias (causing it to default to the object name) and it would still not be droppable.

If you're following the steps in your post, you also need to create a string attribute original_alias containing the object's alias without the "(worn)", and an attribute original_drop set to true if you want it to be droppable after the player removes it.

If you don't want to play with all those attributes, you can just make it wearable on the 'Wearable' tab, and then give it the initialisation script WearGarment (this).


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums