Pass a variable

You must understand the Game Editor concepts, before post here.

Pass a variable

Postby Fuzzy » Wed Apr 04, 2007 4:16 am

What is a good way to pass a variable to an actor made with create actor in a script?
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby jazz_e_bob » Wed Apr 04, 2007 8:18 am

When you create a child, remember it's name.

Code: Select all
Actor *myChild = CreateActor("child", "icon", "(none)", "(none)", 200, 0, false);

strcpy ( myChildsCloneName, myChild->clonename );


Then you can call it by name to change it's parameters.

Code: Select all
getclone( myChildsCloneName )->xvelocity = 10;
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Fuzzy » Wed Apr 04, 2007 11:08 am

Many thanks.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest