GetPersonFrame

From Spheriki

Jump to: navigation, search

Gets the person's current frame in the direction it is using. For example, if a direction had four frames and the person is using this direction, it can range from 0 to 3.


Contents

Usage

Number GetPersonFrame(person);
  • person The name of the person as a string.
  • Number is returned, containing the frame number in the direction.


Examples

SetPersonDirection("Pete", "south");
Abort(GetPersonFrame("Pete") + "\n");

Abort will return 0 because when a direction is set, the frame reverts to 0.

In a renderscript or updatescript:

if (GetPersonFrame("Pete") < 10)
  QueuePersonCommand("Pete", COMMAND_ANIMATE, true);

The direction will animate until frame 10 in the direction animation was reached.


Notes

  • The frame number returned is not the frame number of the total amount of frames, but the frame number of the direction animation frames set up in the spriteset direction editor.


See also

Personal tools