Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Callback Syntax
saito100 Offline
Junior Member

Posts: 15
Threads: 8
Joined: Jul 2013
Reputation: 0
#1
Question  Callback Syntax

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!
12-01-2013, 08:01 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Callback Syntax

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

Trying is the first step to success.
12-01-2013, 02:38 PM
Find
saito100 Offline
Junior Member

Posts: 15
Threads: 8
Joined: Jul 2013
Reputation: 0
#3
RE: Callback Syntax

(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
12-01-2013, 08:53 PM
Find




Users browsing this thread: 2 Guest(s)