LlCreateCharacter
De DigiWiki.
Version du 17 mars 2012 à 02:09 par Djphil (discuter | contributions)
caveats=(subject to change)
- You only need to use one llCreateCharacter call per object, calling multiple times has no effect.
- One script can contain an llCreateCharacter call and other scripts can exploit that with other path functions that require it.
- llCreateCharacter status survives state changes, script resets, and rezzing.
- llCreateCharacter is always required for all pathing functions.
- If we have multiple scripts containing llCreateCharacter in the same object nothing untoward happens.
- If multiple scripts use conflicting path functions in the same object (different prims or the same prim) one will take precedence randomly (apparently).
- CHARACTER_DESIRED_SPEED ranges from 0.02 to 50.0.
- CHARACTER_MAX_ANGLAR_ACCEL min = 1.5708
- CHARACTER_RADIUS ranges from 0.1 to 5.0.
- CHARACTER_LENGTH ranges from 0.0 to 10.0.
- [TRAVERSAL_TYPE, 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, 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 to 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 character's true "length" cannot be smaller than twice the radius plus 0.1m; 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. Use [CHARACTER_ORIENTATION, HORIZONTAL] if you need your character to be horizontal.
- 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, []).|
examples=
default { state_entry() { llCreateCharacter([CHARACTER_DESIRED_SPEED, 50.0]); } touch_start(integer total_number) { list points = [llGetPos() + <5,0,0>, llGetPos() - <5,0,0>]; llPatrolPoints(points, []); } }|
notes=This function is currently in alpha testing.| also_functions=
- llCreateCharacter
- llDeleteCharacter
- llEvade
- llExecCharacterCmd
- llGetClosestNavPoint
- llFleeFrom
- llNavigateTo
- llPatrolPoints
- llPursue
- llUpdateCharacter
- llWanderWithin|
also_events=
}}


