Backpacks and Wearables don't mix?

In my game, inventory is handled via a backpack, a container which has special pockets (other containers) for different types of items (weapons, clothing, food/drink), with miscellaneous items just being placed in the backpack. Everything goes in the backpack when acquired, and stays in the backpack unless currently being worn. (Items are returned to the backpack when removed.)
This is useful because in certain parts of the game, the player has all their items confiscated and doesn't get them back until they leave the room.
This has led to a problem- when first picked up, items don't inherit the verbs from the "Inventory" or "Worn" verb lists on the Wearable tab. You can enter "wear stick" manually, which equips the stick properly and causes the extra verbs from the "worn" list to show correctly. Strangely, when you unequip the stick (thus returning it to the pocket), it DOES show the verbs from the "Inventory" list properly.

(Here's what the code for the 'stick' weapon looks like, though the other weapons have the same issue.)

How do I get the verbs to work when initially placed into the inventory?


When a wearable object is taken, it runs the function SetVerbs, which then runs the internal function _SetVerbsForGarment on every object in the inventory. As this doesn't seem to be working, I'm guessing that the backpack isn't in the inventory?

I'd suggest adding the line:

_SetVerbsForGarment (this)

to your 'ontake' script, which forces the 'wear' or 'remove' verbs to be added, just like is done when the garment is worn or removed.


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

Support

Forums