Making second weapon slot

Cornwallis

Intermediate OT User
Joined
Jan 3, 2010
Messages
460
Reaction score
12
Hello, i want to make a second slot for weapons, like 2 sets of left and right hands, is this possible? i was looking at the coordinates and they seem predisposed. here's what i did in the game_inventory module:
inventory.lua:
Code:
InventorySlotStyles = {
  [InventorySlotHead] = "HeadSlot",
  [InventorySlotNeck] = "NeckSlot",
  [InventorySlotBack] = "BackSlot",
  [InventorySlotBody] = "BodySlot",
  [InventorySlotRight] = "RightSlot",
  [InventorySlotLeft] = "LeftSlot",
  [InventorySlotLeg] = "LegSlot",
  [InventorySlotFeet] = "FeetSlot",
  [InventorySlotFinger] = "FingerSlot",
  [InventorySlotAmmo] = "AmmoSlot",
  [InventorySlotLeft2] = "Left2Slot",
  [InventorySlotRigt2] = "Right2Slot"
inventory.otui:
Code:
InventoryItem < Item
  $on:
    image-source: /images/ui/item-blessed

HeadSlot < InventoryItem
  id: slot1
  image-source: /images/game/slots/head
  &position: {x=65535, y=1, z=0}
  $on:
    image-source: /images/game/slots/head-blessed

BodySlot < InventoryItem
  id: slot4
  image-source: /images/game/slots/body
  &position: {x=65535, y=4, z=0}
  $on:
    image-source: /images/game/slots/body-blessed

LegSlot < InventoryItem
  id: slot7
  image-source: /images/game/slots/legs
  &position: {x=65535, y=7, z=0}
  $on:
    image-source: /images/game/slots/legs-blessed

FeetSlot < InventoryItem
  id: slot8
  image-source: /images/game/slots/feet
  &position: {x=65535, y=8, z=0}
  $on:
    image-source: /images/game/slots/feet-blessed

NeckSlot < InventoryItem
  id: slot2
  image-source: /images/game/slots/neck
  &position: {x=65535, y=2, z=0}
  $on:
    image-source: /images/game/slots/neck-blessed

LeftSlot < InventoryItem
  id: slot6
  image-source: /images/game/slots/left-hand
  &position: {x=65535, y=6, z=0}
  $on:
    image-source: /images/game/slots/left-hand-blessed

FingerSlot < InventoryItem
  id: slot9
  image-source: /images/game/slots/finger
  &position: {x=65535, y=9, z=0}
  $on:
    image-source: /images/game/slots/finger-blessed

BackSlot < InventoryItem
  id: slot3
  image-source: /images/game/slots/back
  &position: {x=65535, y=3, z=0}
  $on:
    image-source: /images/game/slots/back-blessed

RightSlot < InventoryItem
  id: slot5
  image-source: /images/game/slots/right-hand
  &position: {x=65535, y=5, z=0}
  $on:
    image-source: /images/game/slots/right-hand-blessed

LeftSlot2 < InventoryItem
  id: slot11
  image-source: /images/game/slots/left-hand
  &position: {x=65535, y=11, z=0}
  $on:
    image-source: /images/game/slots/left-hand-blessed
    
RightSlot2 < InventoryItem
  id: slot12
  image-source: /images/game/slots/right-hand
  &position: {x=65535, y=12, z=0}
  $on:
    image-source: /images/game/slots/right-hand-blessed

AmmoSlot < InventoryItem
  id: slot10
  image-source: /images/game/slots/ammo
  &position: {x=65535, y=10, z=0}
  $on:
    image-source: /images/game/slots/ammo-blessed
 
OP
Cornwallis

Cornwallis

Intermediate OT User
Joined
Jan 3, 2010
Messages
460
Reaction score
12
i've never worked with ui, those coordinates for the slots look weird, like they're predefined, any idea where they might be defined at?
 

margoh

{{ user.title }}
Joined
Apr 1, 2013
Messages
684
Reaction score
229
Coordinates can be whatever - just tested it. They are needed for item dragging to slots to work.
Go check game_interface/widgets/uiitem.lua.
 

esnio12

Well-Known Member
Joined
Oct 2, 2010
Messages
37
Reaction score
11
Margoh, can you do a tutorial who noob peoples like me can add more slots in the otserv/otc?
 
OP
Cornwallis

Cornwallis

Intermediate OT User
Joined
Jan 3, 2010
Messages
460
Reaction score
12
I can handle the coding server side, idk what to do otc side, is there an error log somewhere? Game_inventory just won't launch and won't tell me why
 
Top