Page 1 of 1

Help with Actor*

PostPosted: Fri Jan 22, 2010 10:29 pm
by Hblade
Hey guys me again I know I asked this before, but how would you use the function "Actor* variable = variable2" or what ever cause I'm trying to make an event called "Event_Jump(actor name, jump_height)" but inside of the script, I have this:
Code: Select all
void Event_Jump(char *actor_name, int jump_height)
{
    Actor* ename = actor_name;
   code here
}

but that doesnt work :/

Re: Help with Actor*

PostPosted: Fri Jan 22, 2010 11:53 pm
by skydereign
Well, you would need to set the Actor * by giving it an Actor*, not a char*. To do this use the getclone function. I prefer getclone2 derivatives as it allows you to get specific clones' Actor *s, by way of a variable index. Anyway not sure if this was part of the question, but to set an Actor *'s variables, you need to do it like this.
Code: Select all
Actor * demo = getclone("demo");
demo->x = 0;

Re: Help with Actor*

PostPosted: Sat Jan 23, 2010 4:02 pm
by Hblade
Thanks a bunch :D