Changing Animations Using the Value of Animindex

Non-platform specific questions.

Changing Animations Using the Value of Animindex

Postby bamby1983 » Fri Feb 22, 2013 12:24 am

Is there a way in which animations can be changed using the animindex value without explicitly stating the animation name within the ChangeAnimation function?
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Re: Changing Animations Using the Value of Animindex

Postby lcl » Fri Feb 22, 2013 1:18 am

Yes there is. The function you want to use is getAnimName().
You give it the index of the animation and it returns the name of the animation with that index.
Code: Select all
ChangeAnimation("myActor", getAnimName(put your animindex here), FORWARD);

For more info about getAnimName() and other functions, check the Game Editor Script reference: http://game-editor.com/docs/script_reference.htm

Also, topics like this belong to the support forum, not the Game Editor Development forum. :)
It's not a crime to use wrong section of the forum. It's just that your posts will be noticed more easily from the support forum.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Changing Animations Using the Value of Animindex

Postby skydereign » Fri Feb 22, 2013 1:24 am

The topic has been moved to its appropriate forum. But on a more related note, you'll notice that the getAnimName and getAnimIndex functions only work for the event actor. This has been fixed in future versions, but for now, if you need to use it for other actors, you'll have to use activation events.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Changing Animations Using the Value of Animindex

Postby bamby1983 » Fri Feb 22, 2013 1:33 am

Thanks for the quick response, guys!
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron