Sorry, we don't support your browser.  Install a modern browser
This post is closed.

onObjectEnterScriptingZone() running for nearby objects allready in the zone.#441

My “Mage Knight Highly Scripted” mod use onObjectEnterScriptingZone() to detect when the hexagonal terrain tiles are played, however the existing terrain tiles played allready in the zone will triger this event handler also. To be exact, if my hexagonal tile had a square bounding box, all the object within that square region would trigger as entering the scripting zone again. My script is pretty robust with error handling, so shrugs this off 90% of the time, but if I log the object fed to this function, expecting just my played tile, I’m getting far more logs sugesting the event is triggering for objects just sitting in the zone. Pre patch 13 this event handled as expected.

3 years ago

Some more observations:-
1) Locking and unlocking objects in the zone will run the entering zone script.
2) Trigering existing objects in the square bounding box effect (described above), actually happens when flipping the tile from stationary. If I pick the tile up and drop it again I only get the tile dropped.
3) The bounding box flip does not triger existing locked objects. Just the loose objects.
4) Existing objects are custom models for terrain tiles, and custom tiles for monster tokens.

3 years ago

Yep, this seems to have appeared more prominently with the last hotfix, but was already some weird stuff going on with plain 13. Can confirm this is happening to my onXScripts as well.

3 years ago

What physics mode are you using in the physics menu?

3 years ago

Full

3 years ago

Also tried with semi and locked but same behaviour.

3 years ago

I just tried with Semi Locked and Locked physics. The locking and unlocking a terrain tile don’t triger the entering script function in these modes.
However the pickup and drop straight , which worked as intended in full physics, now acts like the bounding box is triggering existing objects.
Flipping is better, but it records the flipping tile as entering the script three time. It does not trip any other existing objects in low physics mode. I think maybe the flip animation lifts it out of the zone and rotating it makes it enter and exit, then the drop into position enters again. I understand this problem and have timed code that only executes once per object.
It’s the objects allready in the zone that I don’t want trigering a false event. Hope that makes sense, trying to be detailed, but not confusing….

3 years ago