equipping objects
Mewizkuit
09 Feb 2012, 05:27How can I make it possible to wear or equip items? For instance, the player might want to wear a pair of gloves, or a pendant or coat, or they might want to wield a sword. I can see a wear verb here, but how do I make it so that objects can be worn?
RedTulip
09 Feb 2012, 06:53There is a clothing library, so that might solve your first problem.
As for equipping, you could add an boolean attribute called "equipped". Make a command "equip #object#" (or "equip #weapon#" if you made a type) then use an if script that checks if an object has an equipped Boolean set to false. if it is, it should then add " (equipped)" in the end of the object's name.
To add " (equipped)" to the end of the object's name/alias, you add a script that adds it in the end. Something like this:
If the above "code" doesn't work, try using the this.original_alias trick in the clothing library.
As for equipping, you could add an boolean attribute called "equipped". Make a command "equip #object#" (or "equip #weapon#" if you made a type) then use an if script that checks if an object has an equipped Boolean set to false. if it is, it should then add " (equipped)" in the end of the object's name.
To add " (equipped)" to the end of the object's name/alias, you add a script that adds it in the end. Something like this:
object.alias = object.alias + " (equipped)"
If the above "code" doesn't work, try using the this.original_alias trick in the clothing library.
