So I've added my slot type on my server.
Added it to player.lua in the gamelib folder.
Added it to const.h
Then in my game_inventory files.
But I get this error when I run the client.
Added it to player.lua in the gamelib folder.
Code:
InventorySlotOther = 0
InventorySlotHead = 1
InventorySlotNeck = 2
InventorySlotBack = 3
InventorySlotBody = 4
InventorySlotRight = 5
InventorySlotLeft = 6
InventorySlotLeg = 7
InventorySlotFeet = 8
InventorySlotFinger = 9
InventorySlotFinger2 = 13
InventorySlotAmmo = 10
InventorySlotPurse = 11
InventorySlotFirst = 1
InventorySlotLast = 10
Added it to const.h
Code:
enum InventorySlot {
InventorySlotHead = 1,
InventorySlotNecklace,
InventorySlotBackpack,
InventorySlotArmor,
InventorySlotRight,
InventorySlotLeft,
InventorySlotLegs,
InventorySlotFeet,
InventorySlotRing,
InventorySlotRing2,
InventorySlotAmmo,
InventorySlotPurse,
InventorySlotExt1,
InventorySlotExt2,
InventorySlotExt3,
InventorySlotExt4,
LastInventorySlot
};
Then in my game_inventory files.
Code:
InventorySlotStyles = {
[InventorySlotHead] = "HeadSlot",
[InventorySlotNeck] = "NeckSlot",
[InventorySlotBack] = "BackSlot",
[InventorySlotBody] = "BodySlot",
[InventorySlotRight] = "RightSlot",
[InventorySlotLeft] = "LeftSlot",
[InventorySlotLeg] = "LegSlot",
[InventorySlotFeet] = "FeetSlot",
[InventorySlotFinger] = "FingerSlot",
[InventorySlotFinger2] = "FingerSlot2",
[InventorySlotAmmo] = "AmmoSlot"
}
Code:
FingerSlot2 < InventoryItem
id: slot13
image-source: /images/game/slots/finger
&position: {x=65536, y=9, z=0}
But I get this error when I run the client.
Code:
ERROR: Unable to send extended opcode 1, extended opcodes are not enabled
ERROR: protected lua call failed: LUA ERROR:
/game_inventory/inventory.lua:94: attempt to index global 'inventoryPanel' (a nil value)
stack traceback:
[C]: in function '__index'
/game_inventory/inventory.lua:94: in function 'onInventoryChange'
/game_inventory/inventory.lua:60: in function </game_inventory/inventory.lua:56>
ERROR: protected lua call failed: LUA ERROR:
/game_inventory/inventory.lua:94: attempt to index global 'inventoryPanel' (a nil value)
stack traceback:
[C]: in function '__index'
/game_inventory/inventory.lua:94: in function </game_inventory/inventory.lua:84>
ERROR: protected lua call failed: LUA ERROR:
/game_inventory/inventory.lua:94: attempt to index global 'inventoryPanel' (a nil value)
stack traceback:
[C]: in function '__index'
/game_inventory/inventory.lua:94: in function </game_inventory/inventory.lua:84>
ERROR: protected lua call failed: LUA ERROR:
/game_inventory/inventory.lua:94: attempt to index global 'inventoryPanel' (a nil value)
stack traceback:
[C]: in function '__index'
/game_inventory/inventory.lua:94: in function </game_inventory/inventory.lua:84>