Hey guys!
Searched the forums, read the Script Reference, tried it out in the Script Editor - but I cannot get the function to work. Can someone please post an example of usage - how do you get the animation name of an Event Actor?
getAnimName(animindex); // this returns the name of the event actor's animation
ChangeAnimation("Event Actor", getAnimName(var), FORWARD);
// the event that makes the actor move left
dir=1;
ChangeAnimation("Event Actor", getAnimName(dir), FORWARD);
ChangeAnimation("Event Actor", getAnimName(animindex==0), FORWARD);
skydereign wrote:
- Code: Select all
getAnimName(animindex); // this returns the name of the event actor's animation
if(strcmp(getAnimName(animindex), "goleft")==0) // strcmp returns a 0 when the strings are the same
{
// do this
}
else
{
// do that
}
#define goleft 4
// in global code make definitions that stand for the proper animindexes (in this example goleft would be the 5th animation)
if(animindex==goleft)
{
//
}
Users browsing this forum: No registered users and 1 guest