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

Wierd bug with high hp

mattehj

Premium User
Premium User
Joined
Oct 8, 2009
Messages
117
Reaction score
21
So i had a problem with im not getting loot text, and autoloot dosent work for 2 of the monsters i have.
I have trying to figure out what it is cause every other monster work.
Now i know what the problem is.
Its something with their HP. if i lower their hp.
<health now="2000000000" max="2000000000" /> If i have this health, everything works.
If i raise their hp, like <health now="2200000000" max="2200000000" />

Im not getting loot text and the autoloot function wont work
And im getting this in console (
Lua Script Error: [Event Interface]
data/events/scripts/monster.lua:Monster@onDropLoot)

Anyone has a solution?
 
Hello dear friend, please check if you accidentally deleted any syntax, use the print command to find out what's causing the error or if it's a logic error.

Exemple:
Lua:
function onDropLoot(monster, killer)
    -- Example debugging: Print information about the monster and the player who killed it
    print("Monster:", monster:getName())
    print("Player who killed:", killer:getName())


    -- Your loot handling code here blablabla...
end

And then post again.
 
Hello dear friend, please check if you accidentally deleted any syntax, use the print command to find out what's causing the error or if it's a logic error.

Exemple:
Lua:
function onDropLoot(monster, killer)
    -- Example debugging: Print information about the monster and the player who killed it
    print("Monster:", monster:getName())
    print("Player who killed:", killer:getName())


    -- Your loot handling code here blablabla...
end

And then post again.
Lua:
function Monster:onDropLoot(corpse)
    if hasEventCallback(EVENT_CALLBACK_ONDROPLOOT) then
        EventCallback(EVENT_CALLBACK_ONDROPLOOT, self, corpse)
    end
end


function Monster:onSpawn(position, startup, artificial)
    if hasEventCallback(EVENT_CALLBACK_ONSPAWN) then
        return EventCallback(EVENT_CALLBACK_ONSPAWN, self, position, startup, artificial)
    else
        return true
    end
end


This is how my Monster looks like
 
So i had a problem with im not getting loot text, and autoloot dosent work for 2 of the monsters i have.
I have trying to figure out what it is cause every other monster work.
Now i know what the problem is.
Its something with their HP. if i lower their hp.
<health now="2000000000" max="2000000000" /> If i have this health, everything works.
If i raise their hp, like <health now="2200000000" max="2200000000" />

Im not getting loot text and the autoloot function wont work
And im getting this in console (
Lua Script Error: [Event Interface]
data/events/scripts/monster.lua:Monster@onDropLoot)

Anyone has a solution?
2000000000 is just below and 2200000000 just above the max value for 32-bit signed integer (2147483647), so perhaps this is the cause of your errors. The solution would be to change the type or simply to not exceed that limit.
 
Back
Top