Hope I didn't make it wrong, and you can understand my poor English...
1st: after creating the objects class, you should modify your Game class's "loaded" method to make it load the object class, like this:
Zone:setup{npc_class="mod.class.NPC", grid_class="mod.class.Grid", object_class="mod.class.object",}
If you don't, you will encount an error when clicking on an item in your inventory:
attempt to call function "canUseObject", which is a nil value.
2nd: the "use" functions of consumable items should return a table which contains an element "used", and set it to true. Or the item power will not be consumed, you can use it every turn.
Modify the "use" functions like this:
return {true, used=true}
So... be it an error or not, my mod runs as expected now. If I'm just making a bigger mistake instead of a smaller one, please tell me...
Two mistakes in t4modules: Inventory and Equipment Dialogs
Moderator: Moderator