Skip to content
lsl.devlsl.devLSL Dev

llUpdateCharacter

function
Function syntax
llUpdateCharacter(
  1. list options// A list of key-value pairs specifying the character's new configuration options (takes same constants as llCreateCharacter).
);
Energy
10

Updates settings for a pathfinding character using the parameters specified in options.

Updates settings for a character

How to use
llUpdateCharacter([]);
From the LSL definitions: CharacterParam (rule, then its arguments)
// Speed and turningCHARACTER_DESIRED_SPEED, float speed  // m/s, 0.2 to 40.0; default 6CHARACTER_MAX_SPEED, float max_speed  // 1 to 40.0; default 20CHARACTER_MAX_ACCEL, float acceleration  // 0.5 to 40.0; default 20CHARACTER_MAX_DECEL, float deceleration  // 0.5 to 60.0; default 30CHARACTER_DESIRED_TURN_SPEED, float speed  // 0.02 to 40.0; default 6; loosely enforcedCHARACTER_MAX_TURN_RADIUS, float radius  // 0.1 to 10.0; default 1.25// Size and shapeCHARACTER_RADIUS, float radius  // capsule, 0.125 to 5.0CHARACTER_LENGTH, float length  // capsule, up to 10.0; at least 2 × radius + 0.1CHARACTER_ORIENTATION, integer  // VERTICAL (default) or HORIZONTAL// Terrain and avoidanceCHARACTER_TYPE, integer  // CHARACTER_TYPE_*; default _NONETRAVERSAL_TYPE, integer  // TRAVERSAL_TYPE_*; default _SLOW; needs CHARACTER_TYPECHARACTER_AVOIDANCE_MODE, integer  // AVOID_* flags; default AVOID_CHARACTERS | AVOID_DYNAMIC_OBSTACLESCHARACTER_STAY_WITHIN_PARCEL, integer  // boolean; TRUE keeps it on its parcelCHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES, integer  // boolean; default TRUE

(subject to change)

  • CHARACTER_DESIRED_SPEED ranges from 0.2 to 40.0.
  • CHARACTER_RADIUS ranges from 0.1 to 5.0.
  • CHARACTER_LENGTH ranges from 0.0 to 10.0.
  • TRAVERSAL_TYPE_SLOW | TRAVERSAL_TYPE_FAST | TRAVERSAL_TYPE_NONE - only use one of these parameters or omit. Defaults to TRAVERSAL_TYPE_NONE to if omitted. This affects whether a character moving on terrain that is less than 100% walkable will move faster (e.g., a cat crossing a street) or slower (e.g., a car driving in a swamp).
  • CHARACTER_TYPE_A | CHARACTER_TYPE_B | CHARACTER_TYPE_C | CHARACTER_TYPE_D | CHARACTER_TYPE_NONE - only use one of these parameters or omit. Defaults to CHARACTER_TYPE_NONE if omitted. This determines which of the 4 walkability coefficients the character pays attention to.
  • The character’s shape is a capsule (cylinder with spherical ends) with a length (from tip to tip) and a circular cross section of some radius. These two size parameters are what is controlled by the CHARACTER_LENGTH and CHARACTER_RADIUS params respectively.
  • Note that the characters true “length” cannot be smaller than twice the radius however you’re welcome to specify a value lower than that (but more than zero) — the script shouldn’t complain.
  • The capsule is usually oriented vertically. It is possible to make the capsule lie horizontal by using an object that is long in its local X-axis, however these characters might not be able to navigate through gaps that cannot fit them lengthwise.
  • Use a vertical capsule whenever possible; horizontal capsules may become stuck more easily than vertical capsules.
  • Removing the script from a prim will not stop pathing behavior, in the same way that particles and hover text remain. To stop a pathing command use llExecCharacterCmd(CHARACTER_CMD_STOP, []).
Example 1
default
{
state_entry()
{
llCreateCharacter([CHARACTER_DESIRED_SPEED, 10.0]);
list points = [llGetPos() + <5,0,0>, llGetPos() - <5,0,0>];
llPatrolPoints(points, []);
}
touch_start(integer total_number)
{
llUpdateCharacter([CHARACTER_DESIRED_SPEED, 50.0]);
}
}

Date of Release 31/07/2012

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.