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

Weird Error

X_Anero

New Member
Joined
Apr 10, 2013
Messages
74
Reaction score
1
Location
United Kingdom
Hey otlanders,
Today i have added new scirpt to Movements
and i get this strange error.
LUA:
[25/02/2013 01:59:02] [Error - MoveEvent::executeStep] Call stack overflow.
I would fix the problem myself but i never seen this error before.

movements/scirpts/xxx.lua
LUA:
function onStepIn(cid, item, position, fromPosition)
    for i = 17000, 17122 do
        local pos = getThingPos(i)
        if not isPlayer(getTopCreature(pos).uid) then
            doTeleportThing(cid, pos)
             doCreatureSay(cid, 'Using a tool to cast spells or to keep your character online is legal.', 19, false, cid)
            doSendMagicEffect(position, CONST_ME_TELEPORT)
            doSendMagicEffect(pos, CONST_ME_TELEPORT)
            return
        end
    end
    doTeleportThing(cid, fromPosition, true)
    doCreatureSay(cid, 'All training slots are taken', 19, false, cid)
    doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end

Rep++ for explaining the error.
Kind Regards,
X_anero
 
From what I can tell, there's a hardcoded limitation on how many event-driven scripts can execute at the same time, and when you go over that limit, this error happens.
 
LUA:
local config = {
	{x = 100, y = 100, z = 7}, -- this is the first training spot, you add the rest
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)
	for _, pos in pairs(config) do
		if not isPlayer(getTopCreature(pos).uid) then
			if doTeleportThing(cid, pos) then
				doCreatureSay(cid, "Using a tool to cast spells or to keep your character online is legal.", TALKTYPE_MONSTER)
				return true
			end
		end
	end
	doTeleportThing(cid, fromPosition)
	doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
	doCreatureSay(cid, "All training slots are taken.", TALKTYPE_MONSTER, nil, nil, fromPosition)
	return true
end
 
Use all the uniqueids in the script 1x. If you have more or less training places, change the number in the script so every uniqueid is used 1x.
 
Back
Top