Work Around Solution
(does not address the problem, only avoids it)
I have a solution that seems to have fixed this.. but it is not addressing the error, just avoiding it.
The script I wrote works by objects moving into script zones I have set at each map location, as it enters it checks the token name to see if it is a active player, and then changes the location button as shown in the video above.
What I have done is simply used a "timer wait function" code that I use a lot in TTS to only trigger functions after a function is triggered for the last time.
Code:
function TimmerChangeDraw(zone, obj)
local prams = {z=zone, o=obj}
Timer.destroy("Time_functionName"..obj.getGUID())
Timer.create({
identifier="Time_functionName"..obj.getGUID(), delay=0.8,
function_name="functionName", function_owner=self, parameters = prams
})
end
Basically this is it. Instead of a function being called each time it enters a zone it instead calls this timer code. What it does is simply start a timer that last 0.8 seconds. When the timer finishes it then runs a function. The trick is that in the timer code at the start it also destroys the timer. So what this means is that everytime the timer is function is called it destroys the existing timer if it is there and starts a new one that lasts for 0.8 seconds. The upshot of this is that no matter how many times the timer function is called in quick succession the actual function I want to trigger is only called once.
You can use this method for all sorts of cool things like counting bowls, card draws and other stuff.
By using this code so the reload() thing is done only once when the icon has stopped moving through the map zones, has (or so it seems) completely bypassed the error. Which I am certain was occurring, when reload() was being called on a object that had not fully spawned, as the reference exists before the spawn is completed. Meaning if I moved the token to fast through the map zones, it would try to change a mid spawning object and this somehow makes the copies.. (I think)