Frictional Games Forum (read-only)
Callback Syntax - 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: Callback Syntax (/thread-23999.html)



Callback Syntax - saito100 - 12-01-2013

Not really a problem, but I was wondering why you have to use callback syntax when scripting. I have never had any problems with it its just that i'm curios to why it is needed or what it does. Ex: The callback syntax for "AddEntityCollideCallback" would be "(string &in asParent, string &in asChild, int alState)". Thanks in advance!


RE: Callback Syntax - FlawlessHappiness - 12-01-2013

It's for the editor to understand what parameters that are in play at the moment.
See, when using (string &in asParent, string &in asChild, int alState) it's about 1 entity (asParent) colliding with another entity (asChild), and how they are colliding (alState).


In your function you can then use if-statements like:
if(alState == -1)
{
//DO SOMETHING WHEN asPARENT WALKS OUT OF asCHILD
}


-1 equals that the function will only call if asParent walks out of asChild.


this might help you:
http://www.frictionalgames.com/forum/thread-18368.html


RE: Callback Syntax - saito100 - 12-01-2013

(12-01-2013, 02:38 PM)FlawlessHair Wrote: It's for the editor to understand what parameters that are in play at the moment.
See, when using (string &in asParent, string &in asChild, int alState) it's about 1 entity (asParent) colliding with another entity (asChild), and how they are colliding (alState).


In your function you can then use if-statements like:
if(alState == -1)
{
//DO SOMETHING WHEN asPARENT WALKS OUT OF asCHILD
}


-1 equals that the function will only call if asParent walks out of asChild.


this might help you:
http://www.frictionalgames.com/forum/thread-18368.html

Awesome reply, Thanks! I understand now. Big Grin