PDA

View Full Version : onObjectEnterScriptingZone never gets called



Lobachevsky
02-04-2017, 05:07 PM
It seems that if object starts inside a scripting zone at the time of loading, onObjectEnterScriptingZone never gets called for that object/zone pair. Other ones work fine with that object, and other objects work fine with that zone.

Didn't test anything else.

Also, I placed the function definition inside object's attached script, not global script.

Version 8.6

MrStump
02-04-2017, 09:49 PM
I didn't think this was a bug. After all, it didn't enter a scripting zone, it was already there. You could do a check on objects in the scripting zone if you wanted to know what was already there at any point.

But that's just my 2 cents, maybe I've interpreted it wrong

Thels
02-05-2017, 02:36 AM
@Lobachevsky: Are you saying it doesn't trigger upon loading? If so, that's working as intended, as it's not entering but starting inside, and there are plenty of reasons people may not want a script to fire for that. It's easy to run a script upon loading for all objects inside.

Or are you saying it no longer registers, even if you pull it out and put it back in. If so, that would be a bug.

Huffel
02-05-2017, 03:31 AM
Yes, it is a bug:
http://www.berserk-games.com/forums/showthread.php?2503-Spawning-a-custom-object-inside-scripting-zone-breaks-onObjectEnter-Leave-events

An object spawned inside a scripting zone won't fire the events anymore. Even if dragged out and back in. It is not such a big problem when you spawn an object inside a scripting zone but it is a problem if that happens automatically (rewind -> object loads inside the zone). In my mod I have a card that gives players victory points while they have it in their player area. If you rewind the game and the card changes owner, it will no longer affect the points for the player who held it when the game was rewound.

Lobachevsky
02-05-2017, 06:33 AM
It's just as Huffel says. When I say the event never fires, I mean it never fires. Not if you drag it out and back in, never.

And apparently it's an old bug too.

MrStump
02-05-2017, 12:27 PM
Ok good clarification, thank you. That is 100% a bug then, good call.