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

TFS 1.X+ Cap problem

Tubeshop

Member
Joined
Nov 23, 2023
Messages
173
Reaction score
19
I have a problem with displaying the cap. In the first screenshot from eq you can see the cap before lifting the mat, which weighs 38 oz. In the second screenshot, after lifting the mat. What is wrong?

20:17 You see a mace (Atk:16, Def:11).
It weighs 38.00 oz.

1712168217569.png
 

Attachments

Solution
game_inventory/inventory.lua

Lua:
function onFreeCapacityChange(player, freeCapacity)
  if not freeCapacity then return end
  if freeCapacity > 99 then
    freeCapacity = math.floor(freeCapacity * 10) / 10
  end
  if freeCapacity > 999 then
    freeCapacity = math.floor(freeCapacity)
  end
  if freeCapacity > 99999 then
    freeCapacity = math.min(9999, math.floor(freeCapacity/1000)) .. "k"
  end
  capLabel:setText(tr('Cap') .. ':\n' .. freeCapacity * 100)
end


game_npctrade module
Lua:
function onFreeCapacityChange(localPlayer, freeCapacity, oldFreeCapacity)
  playerFreeCapacity = freeCapacity * 100

  if npcWindow:isVisible() then
    refreshPlayerGoods()
  end
end
game_inventory/inventory.lua

Lua:
function onFreeCapacityChange(player, freeCapacity)
  if not freeCapacity then return end
  if freeCapacity > 99 then
    freeCapacity = math.floor(freeCapacity * 10) / 10
  end
  if freeCapacity > 999 then
    freeCapacity = math.floor(freeCapacity)
  end
  if freeCapacity > 99999 then
    freeCapacity = math.min(9999, math.floor(freeCapacity/1000)) .. "k"
  end
  capLabel:setText(tr('Cap') .. ':\n' .. freeCapacity * 100)
end


game_npctrade module
Lua:
function onFreeCapacityChange(localPlayer, freeCapacity, oldFreeCapacity)
  playerFreeCapacity = freeCapacity * 100

  if npcWindow:isVisible() then
    refreshPlayerGoods()
  end
end
 
Solution
there is still a bug in skills lua i believe because it displays as 3.82
Lua:
function onFreeCapacityChange(localPlayer, freeCapacity)
  setSkillValue('capacity', freeCapacity * 100)
  checkAlert('capacity', freeCapacity, localPlayer:getTotalCapacity(), 20)
end

function onTotalCapacityChange(localPlayer, totalCapacity)
  checkAlert('capacity', localPlayer:getFreeCapacity(), totalCapacity * 100, 20)
end
 
Back
Top