Help with Actor*

Non-platform specific questions.

Help with Actor*

Postby Hblade » Fri Jan 22, 2010 10:29 pm

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 :/
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Help with Actor*

Postby skydereign » Fri Jan 22, 2010 11:53 pm

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;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Help with Actor*

Postby Hblade » Sat Jan 23, 2010 4:02 pm

Thanks a bunch :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron