Procedures / Functions

Non-platform specific questions.

Procedures / Functions

Postby motorollin » Mon Aug 13, 2007 4:01 pm

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.
motorollin
 
Posts: 54
Joined: Sun Aug 12, 2007 8:05 am
Score: 1 Give a positive score

Postby Jay S. » Mon Aug 13, 2007 4:19 pm

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);

:)
User avatar
Jay S.
 
Posts: 118
Joined: Thu Apr 26, 2007 6:51 pm
Location: My computer desk. :P
Score: 9 Give a positive score

Postby motorollin » Mon Aug 13, 2007 4:24 pm

Thank you!
motorollin
 
Posts: 54
Joined: Sun Aug 12, 2007 8:05 am
Score: 1 Give a positive score

Postby Jay S. » Mon Aug 13, 2007 7:52 pm

Glad to help! :)
User avatar
Jay S.
 
Posts: 118
Joined: Thu Apr 26, 2007 6:51 pm
Location: My computer desk. :P
Score: 9 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest