My function onObjectLeaveScriptingZone(zone, obj) are triggering on load and once loaded and triggered properly will trigger at least 3 times.
Here is the mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=2092091239
Press the buttons on the setup & difficulty board to see the triggers go haywire.
Additional observation: Just clicking on a card will trigger the script, for example using the vector gizmo (which doesn’t even move the card) will trigger it’s script.
I think one part of the bug is that when the card ENTERS the scripting zone and becomes part of the deck there it is DESTROYED, which makes the game think it LEFT the zone, thereby triggering the script. Which is obviously not the intended behaviour.
I’m experiencing the same issue.
Example script:
function onObjectLeaveScriptingZone(zone, object)
if zone.getGUID() == ‘096e86’ then
print(object.getName())
end
end
Place a deck with named cards and remove them one by one from the deck and script zones.
At first it would behave normally.
Upon removing the penultimate card from the deck (not the zone) the name of the deck will be announced followed by the last card in the deck and the last card in the deck again.
Joining the last card and the penultimate card announces each of the two cards, followed by the empty name of the new deck.