• Vote in May Mapping Competition to select a winner!
  • There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Making second weapon slot

Cornwallis

Member
Joined
Jan 3, 2010
Messages
472
Best answers
0
Reaction score
15
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
 

margoh

{{ user.title }}
Joined
Apr 1, 2013
Messages
736
Best answers
14
Reaction score
257
Of course it is possible.
 
OP
Cornwallis

Cornwallis

Member
Joined
Jan 3, 2010
Messages
472
Best answers
0
Reaction score
15
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
736
Best answers
14
Reaction score
257
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

Member
Joined
Oct 2, 2010
Messages
53
Best answers
0
Reaction score
12
Margoh, can you do a tutorial who noob peoples like me can add more slots in the otserv/otc?
 
OP
Cornwallis

Cornwallis

Member
Joined
Jan 3, 2010
Messages
472
Best answers
0
Reaction score
15
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
 

margoh

{{ user.title }}
Joined
Apr 1, 2013
Messages
736
Best answers
14
Reaction score
257
Open terminal (ctrl + t).
 
Top