QueuePersonCommand

From Spheriki

Jump to: navigation, search

Adds a command to a person's command queue for the person to execute this command.
The commands are:

  • COMMAND_WAIT
  • COMMAND_ANIMATE
  • COMMAND_FACE_NORTH
  • COMMAND_FACE_NORTHEAST
  • COMMAND_FACE_EAST
  • COMMAND_FACE_SOUTHEAST
  • COMMAND_FACE_SOUTH
  • COMMAND_FACE_SOUTHWEST
  • COMMAND_FACE_WEST
  • COMMAND_FACE_NORTHWEST
  • COMMAND_MOVE_NORTH
  • COMMAND_MOVE_EAST
  • COMMAND_MOVE_SOUTH
  • COMMAND_MOVE_WEST

These descriptions are pretty obvious, so they are not explained. They will be if requested.


Contents

Usage

QueuePersonCommand(person, command, immediate);
  • person string. The person's name.
  • command string. The command to queue. See above.
  • immediate boolean. If false the mapengine will stop executing the person's command queue after executing this command and won't resume execution of the queue until the next mapengine update. If true the following queued commands (or scripts) are executed within the current update until one script or command has 'immediate' set to false.


Examples

In a renderscript or updatescript:

QueuePersonCommand("Pete", COMMAND_ANIMATE, false);

The person's animation will always animate, even if the person is standing still.

Also in a renderscript or updatescript:

QueuePersonCommand("Pete", COMMAND_MOVE_SOUTH, false);

Moves the person to the south endlessly.


Notes

  • As the name states, QueuePersonCommand() puts commands in a queue. The command queue is automatically processed by the Sphere map engine. If a person still has commands to execute, it will first execute these commands before executing the command that was queued with this function.
  • For each map engine update and person, the mapengine will execute the next queued scripts or commands that have their 'immediate' flag set to true until one has the flag set to false. This last one will be executed too during the current update, while execution of the following queued scripts or commands will be continued during the next update.


See also

Personal tools