llExecCharacterCmd
function
Function syntax
llExecCharacterCmd(integer command,// Pathfinding command to execute. Values: CharacterCommandlist options// A list of options for the command (e.g., jump height forCHARACTER_CMD_JUMP).
);- Energy
- 10
Sends a command (specified by command) to the pathing system with options. Currently only supports stopping pathfinding or making the character jump.
Send a command to the pathing system.
Currently only supports stopping the current pathfinding operation or causing the character to jump.
llExecCharacterCmd(0, []);Specification
Section titled “Specification”- float — height — height to jump, between 0.1m and 2.0m
| Command | Value | Description & Required Parameters |
|---|---|---|
CHARACTER_CMD_JUMP | 0x1 | Makes the character jump. The option list is required to start with a height parameter: [float height] |
CHARACTER_CMD_SMOOTH_STOP | 0x2 | Stops any current pathfinding operation in a smooth like fashion. |
CHARACTER_CMD_STOP | 0x0 | Stops any current pathfinding operation. |
Caveats
Section titled “Caveats”- If another script in the same object issues
CHARACTER_CMD_STOPthen pathing in all scripts is cancelled.
Examples
Section titled “Examples”Example 1
30 collapsed lines
vector patrol;
default{ state_entry() { patrol = llGetPos(); llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); state awake; }}
state awake{ state_entry() { llSay(0, "I am guarding now"); list points = [patrol + <5,0,0>, patrol - <5,0,0>]; llPatrolPoints(points, []); }
touch_start(integer total_number) { state sleep; }}
state sleep{ state_entry() { llSay(0, "Going to sleep"); llExecCharacterCmd(CHARACTER_CMD_SMOOTH_STOP, []); }
touch_start(integer total_number) { patrol = llGetPos(); //Jump to attention! llExecCharacterCmd(CHARACTER_CMD_JUMP, [0.5]); state awake; }}History
Section titled “History”Date of Release 31/07/2012
See also
Section titled “See also”Functions
Section titled “Functions”llCreateCharacterllDeleteCharacterllEvadellExecCharacterCmdllGetClosestNavPointllFleeFromllNavigateTollPatrolPointsllPursuellUpdateCharacterllWanderWithin
Events
Section titled “Events”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.