• 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+ Argument has out-of-range value

Addams

OTMadness.com OTSes Services
Staff member
Board Moderator
Joined
Sep 29, 2009
Messages
2,920
Solutions
342
Reaction score
1,688
Location
Egypt
I am getting quite a few of those last days of my tests so I will post 3 of them in this thread, All of them are scripts in the TFS itself without any of my changes.
First one: occurs on magic_rope script when casting it on a hole that has no south position (above it) so it successfully teleports me north position but throws this warning.
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/support/magic_rope.lua:onCastSpell
LuaScriptInterface::getNumber(). Argument -1 has out-of-range value for unsigned short: -1
stack traceback:
        [C]: in function '__add'
        data/lib/core/position.lua:38: in function 'moveUpstairs'
        data/spells/scripts/support/magic_rope.lua:11: in function <data/spells/scripts/support/magic_rope.lua:1>
Just doing like in this gif.
exani_tera_warn.gif
I am also getting those ones
Code:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/teleport_ntiles.lua:onSay
LuaScriptInterface::getNumber(). Argument -1 has out-of-range value for unsigned short: -2
stack traceback:
        [C]: in function 'teleportTo'
        data/talkactions/scripts/teleport_ntiles.lua:20: in function <data/talkactions/scripts/teleport_ntiles.lua:1>
Code:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/add_skill.lua:onSay
LuaScriptInterface::getNumber(). Argument 2 has out-of-range value for unsigned __int64: -1.2824513806854554e+19
stack traceback:
        [C]: in function 'addSkill'
        data/talkactions/scripts/add_skill.lua:55: in function <data/talkactions/scripts/add_skill.lua:24>
I haven't changed any of the above scripts, I am using the main ones included in TFS 1.4.2
Magic_rope, Add_skill, and Teleport_ntiles
I am aware that the last 2 warns are triggered because I wrote a high value, so I added a limit on them by myself (If there's a better solution then I will go with it otherwise my limit is mostly enough).
But for the first one, I don't know why it happens, I might be missing some commits/fixes from TFS 1.5.
 
I haven't looked into it, but Sarah usually knows what she's talking about. lol

 
I haven't looked into it, but Sarah usually knows what she's talking about. lol
Those changes indeed fix the stairs and NPCs warns, I have added them since my reply there and I double-checked my sources/Lua now, They are there.
But it doesn't fix the 3 warns above, So there could be more commits/changes made on 1.5 that I am missing on 1.4.2
Edit
: I noticed that the ladders throw the same warning if there's a stone or something there too.
Ladders_Tes.gif
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/teleport.lua:onUse
LuaScriptInterface::getNumber(). Argument -1 has out-of-range value for unsigned short: -1
stack traceback:
        [C]: in function '__add'
        data/lib/core/position.lua:38: in function 'moveUpstairs'
        data/actions/scripts/other/teleport.lua:4: in function <data/actions/scripts/other/teleport.lua:2>
Note: on both gifs, the player was supposed to go to the stone wall position if it's walkable ground tile.
 
Last edited:
Those changes indeed fix the stairs and NPCs warns, I have added them since my reply there and I double-checked my sources/Lua now, They are there.
But it doesn't fix the 3 warns above, So there could be more commits/changes made on 1.5 that I am missing on 1.4.2
Edit
: I noticed that the ladders throw the same warning if there's a stone or something there too.
View attachment 72848
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/teleport.lua:onUse
LuaScriptInterface::getNumber(). Argument -1 has out-of-range value for unsigned short: -1
stack traceback:
        [C]: in function '__add'
        data/lib/core/position.lua:38: in function 'moveUpstairs'
        data/actions/scripts/other/teleport.lua:4: in function <data/actions/scripts/other/teleport.lua:2>
Note: on both gifs, the player was supposed to go to the stone wall position if it's walkable ground tile.
well, line 4 in that script is
fromPosition:moveUpstairs()

and I suppose that function is from lib

But.. idk what's wrong with it.. xD
 
But.. idk what's wrong with it.. xD
Same, I checked it and tried to add different/random checks there and also in the magic_rope script itself but not sure what's exactly exceeding the max value.
 
I was still trying on this by myself but after some prints, I believe it will always show the warning whenever the moveUpstairs is not teleporting to south position.
So I will just try to remap the ones I find to be all teleporting to south as a temporary solution.
 
Back
Top