Page 1 of 1

Procedures / Functions

PostPosted: Mon Aug 13, 2007 4:01 pm
by motorollin
Is it possible to define a procedure or a function which will run when called from another script? E.g.:

Code: Select all
procedure doSomething(var){
  //Do something
}


in the global code, and

Code: Select all
doSomething(1);


in a script called by an action.

PostPosted: Mon Aug 13, 2007 4:19 pm
by Jay S.
The answer is yes. :)

Code: Select all
void somefunction(int var){
if(var==1)
{
  //something...
}
                          }

Then in an actor's script:
Code: Select all
somefunction(1);

:)

PostPosted: Mon Aug 13, 2007 4:24 pm
by motorollin
Thank you!

PostPosted: Mon Aug 13, 2007 7:52 pm
by Jay S.
Glad to help! :)