Frictional Games Forum (read-only)
How can I call a callback multiple times? - 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: How can I call a callback multiple times? (/thread-16910.html)



How can I call a callback multiple times? - Magasztos - 07-12-2012

This might be a really stupid question but I made a key to "lock & Unlock" a door (Active/non-active) but I can only do this once, so if this is possible



How can I call a callback multiple times?





(And I mean without copying it like 100x :p)


RE: How can I call a callback multiple times? - Ongka - 07-12-2012

Put a AddEntityCollideCallback or ItemCallback depending on what you want to do in the function you're calling.

e.g.

Code:
void OnStart
{
    AddEntityCollideCallback("Player", "AreaTest", "CollideTest", true, 1);
}

void CollideTest(string &in asParent, string &in asChild)
{
   AddEntityCollideCallback("Player", "AreaTest", "CollideTest", true, 1);
}
I think you got the idea now.


RE: How can I call a callback multiple times? - Magasztos - 07-12-2012

(07-12-2012, 02:55 PM)Ongka Wrote: Put a AddEntityCollideCallback or ItemCallback depending on what you want to do in the function you're calling.



e.g.



Code:
void OnStart

{

    AddEntityCollideCallback("Player", "AreaTest", "CollideTest", true, 1);

}



void CollideTest(string &in asParent, string &in asChild)

{

   AddEntityCollideCallback("Player", "AreaTest", "CollideTest", true, 1);

}

I think you got the idea now.




That's really clever :p
Thanks alot.

-Imre