Frictional Games Forum (read-only)
Collide Callback multiple times problem - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Collide Callback multiple times problem (/thread-12095.html)



Collide Callback multiple times problem - pawsUp1703 - 12-26-2011

So I have a problem with all my entitycollide callbacks
When you don't change the map you can only activate it once as I want it to be, the callback is deleted afterwards.
But when you change maps and the get into the old map again the callback is resetted somehow..
is there a way to change that?


RE: Collide Callback multiple times problem - Khyrpa - 12-26-2011

Put it to OnStart instead of OnEnter so it only triggers the first time the map is loaded



RE: Collide Callback multiple times problem - pawsUp1703 - 12-26-2011

(12-26-2011, 08:33 PM)Khyrpa Wrote: Put it to OnStart instead of OnEnter so it only triggers the first time the map is loaded
Thats not possible since some of these maps are maps where you can enter another map before the event is triggered


RE: Collide Callback multiple times problem - Khyrpa - 12-26-2011

(12-26-2011, 08:54 PM)pawsUp1703 Wrote: Thats not possible since some of these maps are maps where you can enter another map before the event is triggered
I dont know if I actually got what you meant, but if thats not what you want then use variable and if cases inside OnEnter



RE: Collide Callback multiple times problem - Your Computer - 12-26-2011

(12-26-2011, 08:54 PM)pawsUp1703 Wrote: Thats not possible since some of these maps are maps where you can enter another map before the event is triggered

Why isn't it possible? Are you uncertain of how AddEntityCollideCallback works?



RE: Collide Callback multiple times problem - palistov - 12-26-2011

The collision callbacks you declare in OnStart shouldn't be removed if you leave the map before triggering them. If you find otherwise, try using a local variable to track whether the collision has happened, and in OnEnter, only add the callback if it hasn't been triggered earlier.


RE: Collide Callback multiple times problem - pawsUp1703 - 12-27-2011

(12-26-2011, 11:24 PM)palistov Wrote: The collision callbacks you declare in OnStart shouldn't be removed if you leave the map before triggering them. If you find otherwise, try using a local variable to track whether the collision has happened, and in OnEnter, only add the callback if it hasn't been triggered earlier.
So basically if I set them in OnStart they will be triggered only once and it doesn't matter how often I changed maps before activating them?


RE: Collide Callback multiple times problem - pawsUp1703 - 12-28-2011

(12-27-2011, 06:04 PM)pawsUp1703 Wrote:
(12-26-2011, 11:24 PM)palistov Wrote: The collision callbacks you declare in OnStart shouldn't be removed if you leave the map before triggering them. If you find otherwise, try using a local variable to track whether the collision has happened, and in OnEnter, only add the callback if it hasn't been triggered earlier.
So basically if I set them in OnStart they will be triggered only once and it doesn't matter how often I changed maps before activating them?
anyone?

I desperately need the info as I want to gift the full conversion to my boyfriend as christmas present on friday and the only thing that doesn't work are the collide callbacks..


RE: Collide Callback multiple times problem - Your Computer - 12-28-2011

(12-28-2011, 03:45 PM)pawsUp1703 Wrote: anyone?

I desperately need the info as I want to gift the full conversion to my boyfriend as christmas present on friday and the only thing that doesn't work are the collide callbacks..

Why wait for a response? Part of creating a story is trying and testing things out. The game will save certain script mechanisms during the game session and afterwards when the player decides to save and exit: this if the script didn't request for removal upon being triggered. Unless you want things to repeat, setting collide callbacks (and other kinds of interactions) in OnStart is the practical method.

If you want other people to test your work, you can request for testers.