{
ConnectEntities("door_connection", //Name of connection
"Lever1", //Parent entity (Affects)
"Shelf", //Child entity (Affected)
false, //Invert the state sent
1, //States used (0=both), checked before invertion.
"CreateDust"); //callback
}
(This post was last modified: 07-29-2011, 09:26 AM by clock123.)
{
ConnectEntities("door_connection", //Name of connection
"Lever1", //Parent entity (Affects)
"Shelf", //Child entity (Affected)
false, //Invert the state sent
1, //States used (0=both), checked before invertion.
"CreateDust"); //callback
}
this is not a proper function. It needs a head (void example(...){}) to work (like your
void KeyOnDoor(...){}).
So you have to decide: Should the code trigger automatically at the beginning, then put it
in the OnStart(){}. Otherwise, add your Callback in your OnStart() and the function for the
callback before the {.
If you don't understand it, then you can tell me what should happen, that the function gets triggered, so I can give you an example code.
If you're referring to multiple script files, then no. Just one script file is required. If you're referring to co-routines (multiple functions being executed at the same time) then yes it is possible and very easy to do with AngelScript.
Looking at your code example, you need to make sure you use appropriate syntax and scripting practices. You have a call stack without a name/type! If that braced call stack is supposed to be part of the 'KeyOnDoor' function, just remove the two middle braces. All lines in the function will be executed at the same time. You can use double fore-slashes to indicate a comment line with which you can organize and/or label your call stack.
You can combine functions when appropriate but there is always support for co-routines when needed.