• 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!

OTClient - Change the number of slots backpack

secondlife

Member
Joined
Aug 1, 2009
Messages
298
Reaction score
23
Hi guys,
How i can change the number of slots in the backpack? Show only 4 slots instead of 5.

Look:

tBILcwP.png


Thank you guys!!
 
Last edited:
@margoh
Hi bro, thank you for reply.

No, i think you did not understand me correctly.
I'm trying to change the number of slots that otclient displays in containers, not the number of slots in the container item.xml.

Look this in cip client:

pm7NABB.png


Understand?

thxxx
 
Change the width of side panels or change width of contentsPanel only inside containers.lua.
Ofc, going with first option you need to change width of every module displayed inside of sidepanels.
 
Last edited:
look for gameinterface.otui for
GameSidePanel
id: gameRightPanel

and put this inside

Code:
    anchors.left: parent.left
    margin-left: 1203
 
@II Knight

Hi, now gives error on start otc.exe (Unable to load 'game_interface' module)

Code:
  GameSidePanel
    id: gameRightPanel
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    focusable: false
    on: true
    anchors.left: parent.left
    margin-left: 1203
 
because you are using tab, instead of 4 spaces

Code:
 GameSidePanel
    id: gameRightPanel
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    anchors.left: parent.left
    margin-left: 1203
    focusable: false
    on: true
 
well, that line some times will make problems if you resize the client
margin-left: 1203

so better use this one.

Code:
  GameSidePanel
    id: gameRightPanel
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    anchors.left: parent.right
    margin-left: -185
    focusable: false
 
I'm trying to do the same thing!! But I don't wanna change the game panel width.

I wanna change how much Slots have inline, add some margin, something like this:

Ue72J55.png


Where I can edit this ?
 
Inside game_containers/container.otui

Yea, thanks Margoh!

I put 3 slots!! Now I need put margin among them 4px, but in container.otui don't have any option to do it.

qrW8Q8F.png


@Edit: in container.lua I found this code

Lua:
  for slot=0,container:getCapacity()-1 do
    local itemWidget = g_ui.createWidget('Item', containerPanel)
    itemWidget:setId('item' .. slot)
    itemWidget:setItem(container:getItem(slot))
    itemWidget:setMargin(0)
    itemWidget.position = container:getSlotPosition(slot)

    if not container:isUnlocked() then
      itemWidget:setBorderColor('red')
    end
  end

But this code does not put a certain margin
 
Code:
layout:
      type: grid
      cell-size: 34 34
      flow: true
Here you have to add cell-spacing or sth like that.
 
Code:
layout:
      type: grid
      cell-size: 34 34
      flow: true
Here you have to add cell-spacing or sth like that.

Yes, I did it, look at my result.
7GEtqAS.png


I just did not find out one thing, when I open any container, it opens with very small height, even though it has a minimum height, like this:
dJHCXop.png
 
i want this for otcv8 but cant fin the way the files are decrypted help me pls
 
the 185 means the size of 4 slots when you open the containers
i have this in otcv8
Lua:
  Panel
    id: gameRightPanels
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    focusable: false
    layout:
      type: horizontalBox
      fit-children: true   
      spacing: -1
Change the width of side panels or change width of contentsPanel only inside containers.lua.
Ofc, going with first option you need to change width of every module displayed inside of sidepanels.
how do i do for otcv8? is a bit different, this is gameinterface.otui
Code:
GameSidePanel < UIMiniWindowContainer
  image-source: /images/ui/panel_side
  image-border: 4
  padding: 3
  padding-top: 0
  width: 198
  focusable: false
  on: true
  layout:
    type: verticalBox
  $mobile:
    padding: 0
    width: 200
 

GameMapPanel < UIGameMap
  padding: 4
  image-source: /images/ui/panel_map
  image-border: 4

  $on:
    padding: 0
  
GameAction < UIButton
  size: 64 64
  phantom: false
  
  UIButton
    id: image
    size: 48 48
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.verticalCenter: parent.verticalCenter
    phantom: true
    $checked:
      opacity: 1.0
      background: #00FF0033
    $!checked:
      opacity: 0.6
      background: alpha


UIWidget
  id: gameRootPanel
  anchors.fill: parent
 
  GameMapPanel
    id: gameMapPanel
    anchors.left: gameLeftPanels.right
    anchors.right: gameRightPanels.left
    anchors.top: parent.top
    anchors.bottom: gameBottomPanel.top
    focusable: false 
  
  Panel
    id: gameLeftActions
    focusable: false
    anchors.bottom: parent.bottom
    anchors.left: parent.left
    width: 64
  
    $!mobile:
      visible: false
      width: 0
  
    layout:
      type: verticalBox
      fit-children: true
    
    GameAction
      id: use
      @onSetup: self.image:setImageSource("/images/game/mobile/use")
    GameAction
      id: attack
      @onSetup: self.image:setImageSource("/images/game/mobile/attack")
    GameAction
      id: follow
      @onSetup: self.image:setImageSource("/images/game/mobile/follow")
    GameAction
      id: look
      @onSetup: self.image:setImageSource("/images/game/mobile/look")
    GameAction
      id: chat
      @onSetup: self.image:setImageSource("/images/game/mobile/chat")
  
  Panel
    id: gameLeftPanels
    focusable: false
    anchors.top: parent.top
    anchors.bottom: parent.bottom 
    $!mobile:
      anchors.left: parent.left
    $mobile:
      anchors.left: gameLeftActions.right

    layout:
      type: horizontalBox
      fit-children: true
      spacing: -1

  Panel
    id: gameLeftActionPanel
    phantom: true
    focusable: false
    anchors.top: gameTopBar.bottom
    anchors.left: gameLeftPanels.right
    anchors.bottom: bottomSplitter.top
    margin-top: 3

    $mobile:
      visible: false
    
    layout:
      type: horizontalBox
      fit-children: true
    
  Panel
    id: gameRightPanels
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    focusable: false
    layout:
      type: horizontalBox
      fit-children: true   
      spacing: -1

  Panel
    id: gameRightActionPanel
    phantom: true
    focusable: false
    anchors.top: gameTopBar.bottom
    anchors.right: gameRightPanels.left
    anchors.bottom: bottomSplitter.top
    margin-top: 3

    $mobile:
      visible: false
    
    layout:
      type: horizontalBox
      fit-children: true
  
  Splitter
    id: bottomSplitter
    anchors.left: gameLeftPanels.right
    anchors.right: gameRightPanels.left
    anchors.bottom: parent.bottom
    height: 5
    relative-margin: bottom
    margin-bottom: 150
    @canUpdateMargin: function(self, newMargin) if modules.client_options.getOption('dontStretchShrink') then return self:getMarginBottom() end return math.max(math.min(newMargin, self:getParent():getHeight() - 150), 80) end
    @onGeometryChange: function(self) self:setMarginBottom(math.min(math.max(self:getParent():getHeight() - 150, 80), self:getMarginBottom())) end
  
    $mobile:
      visible: false
    
  Panel
    id: gameBottomActionPanel
    phantom: true
    focusable: false

    $!mobile:
      anchors.left: bottomSplitter.left
      anchors.right: bottomSplitter.right
      anchors.top: bottomSplitter.top
      margin-top: 3

    $mobile:
      anchors.left: gameLeftPanels.right
      anchors.right: gameRightPanels.left
      anchors.bottom: gameBottomPanel.top 
    
    layout:
      type: verticalBox
      fit-children: true
  
  Panel
    id: gameBottomPanel 
    $!mobile:
      anchors.left: gameBottomActionPanel.left
      anchors.right: gameBottomActionPanel.right
      anchors.top: gameBottomActionPanel.bottom
      anchors.bottom: parent.bottom

    $mobile:
      anchors.left: gameLeftPanels.right
      anchors.right: gameRightPanels.left
      anchors.bottom: parent.bottom
    
  UIWidget
    id: mouseGrabber
    focusable: false
    visible: false

  Panel
    id: gameTopBar
    image-source: /images/ui/panel_bottom2
    anchors.top: parent.top
    anchors.left: gameBottomActionPanel.left
    anchors.right: gameBottomActionPanel.right
    focusable: false

    $mobile:
      height: 0

    layout:
      type: verticalBox
      fit-children: true

and i don't have gamecontainer.otui inside game_containers

help im almost there, i need to resize a frame to the right in the backpack a buttons but can't find where, this is how it's looking

need to know where to remove the frame of the right >>>>
 
Last edited:
i have this in otcv8
Lua:
  Panel
    id: gameRightPanels
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    focusable: false
    layout:
      type: horizontalBox
      fit-children: true
      spacing: -1

how do i do for otcv8? is a bit different, this is gameinterface.otui
Code:
GameSidePanel < UIMiniWindowContainer
  image-source: /images/ui/panel_side
  image-border: 4
  padding: 3
  padding-top: 0
  width: 198
  focusable: false
  on: true
  layout:
    type: verticalBox
  $mobile:
    padding: 0
    width: 200
 

GameMapPanel < UIGameMap
  padding: 4
  image-source: /images/ui/panel_map
  image-border: 4

  $on:
    padding: 0
 
GameAction < UIButton
  size: 64 64
  phantom: false
 
  UIButton
    id: image
    size: 48 48
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.verticalCenter: parent.verticalCenter
    phantom: true
    $checked:
      opacity: 1.0
      background: #00FF0033
    $!checked:
      opacity: 0.6
      background: alpha


UIWidget
  id: gameRootPanel
  anchors.fill: parent
 
  GameMapPanel
    id: gameMapPanel
    anchors.left: gameLeftPanels.right
    anchors.right: gameRightPanels.left
    anchors.top: parent.top
    anchors.bottom: gameBottomPanel.top
    focusable: false
 
  Panel
    id: gameLeftActions
    focusable: false
    anchors.bottom: parent.bottom
    anchors.left: parent.left
    width: 64
 
    $!mobile:
      visible: false
      width: 0
 
    layout:
      type: verticalBox
      fit-children: true
 
    GameAction
      id: use
      @onSetup: self.image:setImageSource("/images/game/mobile/use")
    GameAction
      id: attack
      @onSetup: self.image:setImageSource("/images/game/mobile/attack")
    GameAction
      id: follow
      @onSetup: self.image:setImageSource("/images/game/mobile/follow")
    GameAction
      id: look
      @onSetup: self.image:setImageSource("/images/game/mobile/look")
    GameAction
      id: chat
      @onSetup: self.image:setImageSource("/images/game/mobile/chat")
 
  Panel
    id: gameLeftPanels
    focusable: false
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    $!mobile:
      anchors.left: parent.left
    $mobile:
      anchors.left: gameLeftActions.right

    layout:
      type: horizontalBox
      fit-children: true
      spacing: -1

  Panel
    id: gameLeftActionPanel
    phantom: true
    focusable: false
    anchors.top: gameTopBar.bottom
    anchors.left: gameLeftPanels.right
    anchors.bottom: bottomSplitter.top
    margin-top: 3

    $mobile:
      visible: false
 
    layout:
      type: horizontalBox
      fit-children: true
 
  Panel
    id: gameRightPanels
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    focusable: false
    layout:
      type: horizontalBox
      fit-children: true
      spacing: -1

  Panel
    id: gameRightActionPanel
    phantom: true
    focusable: false
    anchors.top: gameTopBar.bottom
    anchors.right: gameRightPanels.left
    anchors.bottom: bottomSplitter.top
    margin-top: 3

    $mobile:
      visible: false
 
    layout:
      type: horizontalBox
      fit-children: true
 
  Splitter
    id: bottomSplitter
    anchors.left: gameLeftPanels.right
    anchors.right: gameRightPanels.left
    anchors.bottom: parent.bottom
    height: 5
    relative-margin: bottom
    margin-bottom: 150
    @canUpdateMargin: function(self, newMargin) if modules.client_options.getOption('dontStretchShrink') then return self:getMarginBottom() end return math.max(math.min(newMargin, self:getParent():getHeight() - 150), 80) end
    @onGeometryChange: function(self) self:setMarginBottom(math.min(math.max(self:getParent():getHeight() - 150, 80), self:getMarginBottom())) end
 
    $mobile:
      visible: false
 
  Panel
    id: gameBottomActionPanel
    phantom: true
    focusable: false

    $!mobile:
      anchors.left: bottomSplitter.left
      anchors.right: bottomSplitter.right
      anchors.top: bottomSplitter.top
      margin-top: 3

    $mobile:
      anchors.left: gameLeftPanels.right
      anchors.right: gameRightPanels.left
      anchors.bottom: gameBottomPanel.top
 
    layout:
      type: verticalBox
      fit-children: true
 
  Panel
    id: gameBottomPanel
    $!mobile:
      anchors.left: gameBottomActionPanel.left
      anchors.right: gameBottomActionPanel.right
      anchors.top: gameBottomActionPanel.bottom
      anchors.bottom: parent.bottom

    $mobile:
      anchors.left: gameLeftPanels.right
      anchors.right: gameRightPanels.left
      anchors.bottom: parent.bottom
 
  UIWidget
    id: mouseGrabber
    focusable: false
    visible: false

  Panel
    id: gameTopBar
    image-source: /images/ui/panel_bottom2
    anchors.top: parent.top
    anchors.left: gameBottomActionPanel.left
    anchors.right: gameBottomActionPanel.right
    focusable: false

    $mobile:
      height: 0

    layout:
      type: verticalBox
      fit-children: true

and i don't have gamecontainer.otui inside game_containers

help im almost there, i need to resize a frame to the right in the backpack a buttons but can't find where, this is how it's looking

need to know where to remove the frame of the right >>>>

Hi,

I'm using OTClientV8 3.2 rev 4

In order to modify the style of the container cells and windows max size and cell spacing, first you should check the file "../data/styles/40-container.lua" and add something like this at the bottom:

1692509310116.png

Then, go to "../modules/game_containers/containers.lua" and add this line e.g.:

1692509457788.png

Why the value "178"? Because It is the sum of the base value + cell-spacing + cell-size resize + any padding

So if you did this right, it should look something like this:

1692509280721.png

I hope it helps!
:)
 
Last edited:
Back
Top