<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Myopic+Mole</id>
	<title>Second Life Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Myopic+Mole"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Myopic_Mole"/>
	<updated>2026-05-10T03:29:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlDetectedKey&amp;diff=1177237</id>
		<title>LlDetectedKey</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlDetectedKey&amp;diff=1177237"/>
		<updated>2013-03-08T12:56:40Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: Added to Key category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|inject-2={{LSL_Function/detected|number|key}}&lt;br /&gt;
|func_id=32|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|sort=DetectedKey|func=llDetectedKey&lt;br /&gt;
|return_type=key&lt;br /&gt;
|p1_type=integer|p1_name=number&lt;br /&gt;
|func_footnote=Returns an {{HoverText|empty key|{{String}}}} if &#039;&#039;&#039;number&#039;&#039;&#039; does not correspond to a valid sensed object or avatar.&lt;br /&gt;
|func_desc&lt;br /&gt;
|return_text=that is the [[UUID]] of the {{LSLGC|Detected|detected}} object or avatar &#039;&#039;&#039;number&#039;&#039;&#039;.&lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, &amp;quot;touch_start event: key of avatar touching: &amp;quot; + (string) llDetectedKey(0) );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles&lt;br /&gt;
|notes&lt;br /&gt;
|permission&lt;br /&gt;
|cat1=Key&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1175761</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1175761"/>
		<updated>2012-12-30T21:46:06Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: cleared up unecessary embellishments that were not relevant, fixed math error in comment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
//  insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//  called as necessary from events such as script reset or rezzing&lt;br /&gt;
startup()&lt;br /&gt;
{&lt;br /&gt;
//  create the character&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 25,&lt;br /&gt;
                        CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
&lt;br /&gt;
    doSomething();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        startup();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 25,&lt;br /&gt;
                        CHARACTER_DESIRED_SPEED, 15.0,&lt;br /&gt;
                        CHARACTER_RADIUS, 0.25,&lt;br /&gt;
                        CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llUpdateCharacter([CHARACTER_LENGTH, 6.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llExecCharacterCmd(CHARACTER_CMD_STOP, []);&lt;br /&gt;
&lt;br /&gt;
    llSleep(15.0);&lt;br /&gt;
&lt;br /&gt;
    vector currentPosition = llGetPos();&lt;br /&gt;
//  resume with any desired pathfinding function&lt;br /&gt;
    llWanderWithin(currentPosition, &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
//  insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
//  insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup()&lt;br /&gt;
{&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]);&lt;br /&gt;
    state wander;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        startup();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        vector currentPosition = llGetPos();&lt;br /&gt;
        llWanderWithin(currentPosition, &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    path_update(integer type, list reserved)&lt;br /&gt;
    {&lt;br /&gt;
        if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
        {&lt;br /&gt;
            llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
            state graze;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        animateGrassEating();&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(15.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent((float)FALSE);&lt;br /&gt;
        animateTailWiggle();&lt;br /&gt;
        state wander;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===random timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what if this was a zombie bunny with a taste for brains? hmm, brains).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  random period in between [0.0, 15.0)&lt;br /&gt;
//  which means the random float returned could be 0.0 but not 15.0&lt;br /&gt;
&lt;br /&gt;
    llSetTimerEvent( llFrand(15.0) );&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  random period in between (0.0, (30.0-random number up to 15)]&lt;br /&gt;
//  which means the resulting float could be 0 but not (30 - random number up to but not including 15)&lt;br /&gt;
&lt;br /&gt;
    llSetTimerEvent( 30.0 - llFrand(15.0) );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===enabled check===&lt;br /&gt;
&lt;br /&gt;
If you&#039;re giving other people your creations, you&#039;d be wise to have your script check to see if pathfinding is enabled where they rez it. Pathfinding can be disabled on private regions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// returns TRUE if patfinding is enabled, FALSE if not.&lt;br /&gt;
integer IsPFEnabled()&lt;br /&gt;
{&lt;br /&gt;
    if ( llGetEnv(&amp;quot;dynamic_pathfinding&amp;quot;) == &amp;quot;enabled&amp;quot; ) &lt;br /&gt;
        return TRUE;&lt;br /&gt;
    return FALSE;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1175760</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1175760"/>
		<updated>2012-12-30T21:40:33Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* pathfinding character skeleton */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
//  insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//  called as necessary from events such as script reset or rezzing&lt;br /&gt;
startup()&lt;br /&gt;
{&lt;br /&gt;
//  create the character&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 25,&lt;br /&gt;
                        CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
&lt;br /&gt;
    doSomething();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        startup();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 25,&lt;br /&gt;
                        CHARACTER_DESIRED_SPEED, 15.0,&lt;br /&gt;
                        CHARACTER_RADIUS, 0.25,&lt;br /&gt;
                        CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llUpdateCharacter([CHARACTER_LENGTH, 6.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llExecCharacterCmd(CHARACTER_CMD_STOP, []);&lt;br /&gt;
&lt;br /&gt;
    llSleep(15.0);&lt;br /&gt;
&lt;br /&gt;
    vector currentPosition = llGetPos();&lt;br /&gt;
//  resume with any desired pathfinding function&lt;br /&gt;
    llWanderWithin(currentPosition, &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
//  insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
//  insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup()&lt;br /&gt;
{&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]);&lt;br /&gt;
    state wander;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        startup();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        vector currentPosition = llGetPos();&lt;br /&gt;
        llWanderWithin(currentPosition, &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    path_update(integer type, list reserved)&lt;br /&gt;
    {&lt;br /&gt;
        if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
        {&lt;br /&gt;
            llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
            state graze;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        animateGrassEating();&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(15.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent((float)FALSE);&lt;br /&gt;
        animateTailWiggle();&lt;br /&gt;
        state wander;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===random timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what if this was a zombie bunny with a taste for brains? hmm, brains).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  random period in between [0.0, +15.0)&lt;br /&gt;
//  which means the random float returned could be 0.0 but not 15.0&lt;br /&gt;
    llSetTimerEvent( llFrand(15.0) );&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  random period in between (+15.0, +30.0]&lt;br /&gt;
//  which means the resulting float could be 30.0 but not 15.0&lt;br /&gt;
&lt;br /&gt;
    llSetTimerEvent( 30.0 - llFrand(15.0) );&lt;br /&gt;
&lt;br /&gt;
//  same results for:&lt;br /&gt;
//  llSetTimerEvent( 30.0 + llFrand(-15.0) );&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===enabled check===&lt;br /&gt;
&lt;br /&gt;
If you&#039;re giving other people your creations, you&#039;d be wise to have your script check to see if pathfinding is enabled where they rez it. Pathfinding can be disabled on private regions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// returns TRUE if patfinding is enabled, FALSE if not.&lt;br /&gt;
integer IsPFEnabled()&lt;br /&gt;
{&lt;br /&gt;
    if ( llGetEnv(&amp;quot;dynamic_pathfinding&amp;quot;) == &amp;quot;enabled&amp;quot; ) &lt;br /&gt;
        return TRUE;&lt;br /&gt;
    return FALSE;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1174207</id>
		<title>Resetting Scripts in a Large Build</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1174207"/>
		<updated>2012-11-04T16:24:18Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Random Staggered Reset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a complex build, perhaps sim wide and you need to reset all of the scripts, there isn&#039;t an easy way to do this, say from from parcel properties or the region tools.&lt;br /&gt;
&lt;br /&gt;
This presents a few startegies for providing this ability but it does require some forethought.&lt;br /&gt;
&lt;br /&gt;
=Region Restart=&lt;br /&gt;
&lt;br /&gt;
Detect region restart and restart script.&lt;br /&gt;
&lt;br /&gt;
(or other event)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if (change &amp;amp; CHANGED_REGION_START) &lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;The regions has just restarted, resetting the script.&amp;quot;);&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        //  setup and do stuff&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Listener - restart on command=&lt;br /&gt;
&lt;br /&gt;
Listen for instruction and restart script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  this script sends the command to reset the other scripts to reset.&lt;br /&gt;
//  change to use any trigger event that is suitable.&lt;br /&gt;
&lt;br /&gt;
    touch(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        llRegionSay(chatChannel, chatCommand);//  (3)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
        llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
            llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Random Staggered Reset=&lt;br /&gt;
&lt;br /&gt;
Script load on the sim may be a concern, if so you could use a random timer in the target script to stagger the reset as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //setup and do stuff&lt;br /&gt;
    llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
        {&lt;br /&gt;
            //random timer within [0.0, 60.0)&lt;br /&gt;
            llSetTimerEvent( llFrand(60.0) );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you need to stagger the resets, perhaps because the order the sxripts start is imortant, use different commands with appropriate pauses between start commands, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function. &amp;quot;reset3&amp;quot; will trigger after 15 seconds.&lt;br /&gt;
string chatCommand = &amp;quot;reset3&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
        llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand) llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1174206</id>
		<title>Resetting Scripts in a Large Build</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1174206"/>
		<updated>2012-11-04T16:23:55Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Random Staggered Reset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a complex build, perhaps sim wide and you need to reset all of the scripts, there isn&#039;t an easy way to do this, say from from parcel properties or the region tools.&lt;br /&gt;
&lt;br /&gt;
This presents a few startegies for providing this ability but it does require some forethought.&lt;br /&gt;
&lt;br /&gt;
=Region Restart=&lt;br /&gt;
&lt;br /&gt;
Detect region restart and restart script.&lt;br /&gt;
&lt;br /&gt;
(or other event)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if (change &amp;amp; CHANGED_REGION_START) &lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;The regions has just restarted, resetting the script.&amp;quot;);&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        //  setup and do stuff&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Listener - restart on command=&lt;br /&gt;
&lt;br /&gt;
Listen for instruction and restart script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  this script sends the command to reset the other scripts to reset.&lt;br /&gt;
//  change to use any trigger event that is suitable.&lt;br /&gt;
&lt;br /&gt;
    touch(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        llRegionSay(chatChannel, chatCommand);//  (3)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
        llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
            llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Random Staggered Reset=&lt;br /&gt;
&lt;br /&gt;
Script load on the sim may be a concern, if so you could use a random timer in the target script to stagger the reset as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //setup and do stuff&lt;br /&gt;
    llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
       {&lt;br /&gt;
            //random timer within [0.0, 60.0)&lt;br /&gt;
            llSetTimerEvent( llFrand(60.0) );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you need to stagger the resets, perhaps because the order the sxripts start is imortant, use different commands with appropriate pauses between start commands, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function. &amp;quot;reset3&amp;quot; will trigger after 15 seconds.&lt;br /&gt;
string chatCommand = &amp;quot;reset3&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
        llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand) llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1174205</id>
		<title>Resetting Scripts in a Large Build</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1174205"/>
		<updated>2012-11-04T16:22:46Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Random Staggered Reset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a complex build, perhaps sim wide and you need to reset all of the scripts, there isn&#039;t an easy way to do this, say from from parcel properties or the region tools.&lt;br /&gt;
&lt;br /&gt;
This presents a few startegies for providing this ability but it does require some forethought.&lt;br /&gt;
&lt;br /&gt;
=Region Restart=&lt;br /&gt;
&lt;br /&gt;
Detect region restart and restart script.&lt;br /&gt;
&lt;br /&gt;
(or other event)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if (change &amp;amp; CHANGED_REGION_START) &lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;The regions has just restarted, resetting the script.&amp;quot;);&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        //  setup and do stuff&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Listener - restart on command=&lt;br /&gt;
&lt;br /&gt;
Listen for instruction and restart script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  this script sends the command to reset the other scripts to reset.&lt;br /&gt;
//  change to use any trigger event that is suitable.&lt;br /&gt;
&lt;br /&gt;
    touch(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        llRegionSay(chatChannel, chatCommand);//  (3)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
        llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
            llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Random Staggered Reset=&lt;br /&gt;
&lt;br /&gt;
Script load on the sim may be a concern, if so you could use a random timer in the target script to stagger the reset as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
    llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
//      {&lt;br /&gt;
        //  random timer within [0.0, 60.0)&lt;br /&gt;
            llSetTimerEvent( llFrand(60.0) );&lt;br /&gt;
//      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you need to stagger the resets, perhaps because the order the sxripts start is imortant, use different commands with appropriate pauses between start commands, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function. &amp;quot;reset3&amp;quot; will trigger after 15 seconds.&lt;br /&gt;
string chatCommand = &amp;quot;reset3&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
        llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand) llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1174204</id>
		<title>Resetting Scripts in a Large Build</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1174204"/>
		<updated>2012-11-04T16:21:04Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Region Restart */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a complex build, perhaps sim wide and you need to reset all of the scripts, there isn&#039;t an easy way to do this, say from from parcel properties or the region tools.&lt;br /&gt;
&lt;br /&gt;
This presents a few startegies for providing this ability but it does require some forethought.&lt;br /&gt;
&lt;br /&gt;
=Region Restart=&lt;br /&gt;
&lt;br /&gt;
Detect region restart and restart script.&lt;br /&gt;
&lt;br /&gt;
(or other event)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if (change &amp;amp; CHANGED_REGION_START) &lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;The regions has just restarted, resetting the script.&amp;quot;);&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        //  setup and do stuff&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Listener - restart on command=&lt;br /&gt;
&lt;br /&gt;
Listen for instruction and restart script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  this script sends the command to reset the other scripts to reset.&lt;br /&gt;
//  change to use any trigger event that is suitable.&lt;br /&gt;
&lt;br /&gt;
    touch(integer num_detected)&lt;br /&gt;
    {&lt;br /&gt;
        llRegionSay(chatChannel, chatCommand);//  (3)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
        llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
            llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Random Staggered Reset=&lt;br /&gt;
&lt;br /&gt;
Script load on the sim may be a concern, if so you could use a random timer in the target script to stagger the reset as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function&lt;br /&gt;
string chatCommand = &amp;quot;reset&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
//  insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
    llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
//      {&lt;br /&gt;
        //  random timer within [0.0, 60.0)&lt;br /&gt;
            llSetTimerEvent( llFrand(60.0) );&lt;br /&gt;
//      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you need to stagger the resets, perhaps because the order the sxripts start is imortant, use different commands with appropriate pauses between start commands, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  some random negative number&lt;br /&gt;
integer chatChannel = -1324628;&lt;br /&gt;
&lt;br /&gt;
//  could consider using a random string for the command to obscure the function. &amp;quot;reset3&amp;quot; will trigger after 15 seconds.&lt;br /&gt;
string chatCommand = &amp;quot;reset3&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
    //  setup and do stuff&lt;br /&gt;
        llListen(chatChannel, &amp;quot;&amp;quot;, NULL_KEY, chatCommand);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    listen(integer channel, string name, key id, string message)&lt;br /&gt;
    {&lt;br /&gt;
        if (message == chatCommand)&lt;br /&gt;
            llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1174202</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1174202"/>
		<updated>2012-11-04T16:10:55Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* more than one state */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
//  insert pathfinding functionality here&lt;br /&gt;
    ;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//  called as necessary from events such as script reset or rezzing&lt;br /&gt;
startup()&lt;br /&gt;
{&lt;br /&gt;
//  create the character&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 25,&lt;br /&gt;
                        CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
&lt;br /&gt;
    doSomething();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        startup();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 25,&lt;br /&gt;
                        CHARACTER_DESIRED_SPEED, 15.0,&lt;br /&gt;
                        CHARACTER_RADIUS, 0.25,&lt;br /&gt;
                        CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llUpdateCharacter([CHARACTER_LENGTH, 6.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
    llExecCharacterCmd(CHARACTER_CMD_STOP, []);&lt;br /&gt;
&lt;br /&gt;
    llSleep(15.0);&lt;br /&gt;
&lt;br /&gt;
    vector currentPosition = llGetPos();&lt;br /&gt;
//  resume with any desired pathfinding function&lt;br /&gt;
    llWanderWithin(currentPosition, &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
//  insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
//  insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup()&lt;br /&gt;
{&lt;br /&gt;
    llCreateCharacter([ CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]);&lt;br /&gt;
    state wander;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        llResetScript();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        startup();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        vector currentPosition = llGetPos();&lt;br /&gt;
        llWanderWithin(currentPosition, &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    path_update(integer type, list reserved)&lt;br /&gt;
    {&lt;br /&gt;
        if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
        {&lt;br /&gt;
            llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
            state graze;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        animateGrassEating();&lt;br /&gt;
&lt;br /&gt;
        llSetTimerEvent(15.0);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent((float)FALSE);&lt;br /&gt;
        animateTailWiggle();&lt;br /&gt;
        state wander;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Random Timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what if this was a zombie bunny with a taste for brains? hmm, brains).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  random period in between [0.0, +15.0)&lt;br /&gt;
//  which means the random float returned could be 0.0 but not 15.0&lt;br /&gt;
    llSetTimerEvent( llFrand(15.0) );&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
//  random period in between (+15.0, +30.0]&lt;br /&gt;
//  which means the resulting float could be 30.0 but not 15.0&lt;br /&gt;
&lt;br /&gt;
    llSetTimerEvent( 30.0 - llFrand(15.0) );&lt;br /&gt;
&lt;br /&gt;
//  same results for:&lt;br /&gt;
//  llSetTimerEvent( 30.0 + llFrand(-15.0) );&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1173789</id>
		<title>Resetting Scripts in a Large Build</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Resetting_Scripts_in_a_Large_Build&amp;diff=1173789"/>
		<updated>2012-10-21T21:30:43Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: first draft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a complex build, perhaps sim wide and you need to reset all of the scripts, there isn&#039;t an easy way to do this, say from from parcel properties or the region tools.&lt;br /&gt;
&lt;br /&gt;
This presents a few startegies for providing this ability but it does require some forethought.&lt;br /&gt;
&lt;br /&gt;
=Region Restart=&lt;br /&gt;
&lt;br /&gt;
Detect region restart and restart script.&lt;br /&gt;
&lt;br /&gt;
(or other event)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		//setup and do stuff&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	changed(integer change)&lt;br /&gt;
	{&lt;br /&gt;
		if (change &amp;amp; CHANGED_REGION_START) &lt;br /&gt;
		{&lt;br /&gt;
			llOwnerSay(&amp;quot;The regions has just restarted, resetting the script.&amp;quot;);&lt;br /&gt;
			llResetScript();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Listener - restart on command=&lt;br /&gt;
&lt;br /&gt;
Listen for instruction and restart script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	// this script sends the command to reset the other scripts to reset.&lt;br /&gt;
	// change to use any trigger event that is suitable.&lt;br /&gt;
&lt;br /&gt;
	integer channel = -1324628; // some random negative number&lt;br /&gt;
	string command = &amp;quot;reset&amp;quot;; // could consider using a random string for the command to obscure the function&lt;br /&gt;
&lt;br /&gt;
	touch(integer num_detected)&lt;br /&gt;
	{&lt;br /&gt;
		llRegionsSay(channel, command); // (3)&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	//insert the lisetn into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
	integer channel = -1324628; //some random negative number&lt;br /&gt;
	string command = &amp;quot;reset&amp;quot;; //could consider using a random string for the command to obscure the function&lt;br /&gt;
&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		//setup and do stuff&lt;br /&gt;
		llListen(channel, &amp;quot;&amp;quot;, NULL_KEY, command);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	listen(integer channel, string name, key id, string message)&lt;br /&gt;
	{&lt;br /&gt;
		if (message == command) llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Random Staggered Reset=&lt;br /&gt;
&lt;br /&gt;
Script load on the sim may be a concern, if so you could use a random timer in the target script to stagger the reset as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	//insert the listen into your scripts that need to reset on command&lt;br /&gt;
&lt;br /&gt;
	integer channel = -1324628; //some random negative number&lt;br /&gt;
	string command = &amp;quot;reset&amp;quot;; //could consider using a random string for the command to obscure the function&lt;br /&gt;
&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		//setup and do stuff&lt;br /&gt;
		llListen(channel, &amp;quot;&amp;quot;, NULL_KEY, command);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	listen(integer channel, string name, key id, string message)&lt;br /&gt;
	{&lt;br /&gt;
		if (message == command) llSetTimer(llFrand(60)); //random timer within 60 seconds&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you need to stagger the resets, perhaps because the order the sxripts start is imortant, use different commands with appropriate pauses between start commands, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
	integer channel = -1324628; //some random negative number&lt;br /&gt;
	string command = &amp;quot;reset3&amp;quot;; //could consider using a random string for the command to obscure the function. &amp;quot;reset3&amp;quot; will trigger after 15 seconds.&lt;br /&gt;
&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		//setup and do stuff&lt;br /&gt;
		llListen(channel, &amp;quot;&amp;quot;, NULL_KEY, command);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	listen(integer channel, string name, key id, string message)&lt;br /&gt;
	{&lt;br /&gt;
		if (message == command) llResetScript();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1173788</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1173788"/>
		<updated>2012-10-21T20:03:31Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Good building practices verified by Linden Lab ==&lt;br /&gt;
This guide is a collection of officially verified building practices for moderate to advanced creators that result in efficient, high performance creations in Second Life. If you are new to building in Second Life, please check out the [http://community.secondlife.com/t5/English-Knowledge-Base/Build-Tools/ta-p/700039 Knowledge Base].&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Make your creations move without dragging Second Life to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
* &#039;&#039;&#039;[[Mesh and LOD]]&#039;&#039;&#039; - Mesh objects that don&#039;t crash your friends&#039; old computer.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Tools_in_the_Second_Life_Viewer]]&#039;&#039;&#039; - The Pathfinding tools.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
*&#039;&#039;&#039;[[Universal_Attribute_Changes_for_Pathfinding]]&#039;&#039;&#039; Configure objects for pathfinding in bulk&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional development toolkit&lt;br /&gt;
* &#039;&#039;&#039;[[Resetting Scripts in a Large Build]]&#039;&#039;&#039; - strategies for resetting scripts in a large coordinated build&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Pathfinding&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;[[Pathfinding LSL Functions]]&#039;&#039;&#039; - standard reference for all of the pathfinding functions.&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviors.&lt;br /&gt;
** &#039;&#039;&#039;[[Pathfinding Cookbook]]&#039;&#039;&#039; - ready made solutions for some critters.&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Vehicles&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;[[Linden Vehicle Tutorial]]&#039;&#039;&#039; - Vehicle scripting best practices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sound ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
Tips for adding sound effects to your builds.&lt;br /&gt;
* [[Environment_Sounds|Environment Sounds]]&lt;br /&gt;
* [[Event_Driven_Sounds|Event Driven Sounds]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
= Coming Soon =&lt;br /&gt;
We&#039;ll be highlighting examples of great builds and answer the questions: &amp;quot;What next? What do I do with what I&#039;ve built?&amp;quot; Keep checking back for more information!&lt;br /&gt;
&lt;br /&gt;
;Other Topics to be added in the Near Future : &lt;br /&gt;
: SL Animation Tutorial Videos;&lt;br /&gt;
: How to retrofit an existing home to work with Pathfinding&lt;br /&gt;
&lt;br /&gt;
= Resident contributions awaiting official approval =&lt;br /&gt;
If you&#039;d like to contribute some of your own best practices for efficient content creation, please link to them in this section so that Linden Lab subject matter experts can verify them before they are added to the official guide.&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1172755</id>
		<title>Pathfinding Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1172755"/>
		<updated>2012-09-19T19:51:44Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;UNDER DEVELOPMENT - INCOMPLETE&lt;br /&gt;
&lt;br /&gt;
=Rezzer=&lt;br /&gt;
&lt;br /&gt;
The code below is for a simple rezzer for the creatures. For a region scale rezzer system see [[Holistic_Pathfinding_Management]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Simple Creatures=&lt;br /&gt;
&lt;br /&gt;
==Grazing Animal==&lt;br /&gt;
Wanders pauses and eat, wanders, repeat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sentient Treasure Chest==&lt;br /&gt;
Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Fairy==&lt;br /&gt;
Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dragonfly==&lt;br /&gt;
Moves along designated path, lingers by designated waypoint and moves to next random waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Snake==&lt;br /&gt;
Wanders about an area, includes special movement example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Treetop Birds==&lt;br /&gt;
Birds that move between treetops at random intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
==Vulture==&lt;br /&gt;
Birds that glide about on thermals&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Ecosystem Creatures=&lt;br /&gt;
&lt;br /&gt;
==Hunting Animal==&lt;br /&gt;
Wanders looking for specific prey and pursues when prey is spotted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grazing Prey Animal==&lt;br /&gt;
Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rat==&lt;br /&gt;
Wanders about a specified area, flees and hides if an agent approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mount==&lt;br /&gt;
Build a character that can be ridden with race example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dog==&lt;br /&gt;
Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cat==&lt;br /&gt;
Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hopping Scarecrow==&lt;br /&gt;
Wanders about hopping and approaches random people, lingers and moves on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1171355</id>
		<title>Pathfinding Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1171355"/>
		<updated>2012-08-02T21:21:36Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: restructure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;UNDER DEVELOPMENT - INCOMPLETE&lt;br /&gt;
&lt;br /&gt;
=Rezzer=&lt;br /&gt;
&lt;br /&gt;
The code below is for a simple rezzer for the creatures. For a region scale rezzer system see...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Simple Creatures=&lt;br /&gt;
&lt;br /&gt;
==Grazing Animal==&lt;br /&gt;
Wanders pauses and eat, wanders, repeat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sentient Treasure Chest==&lt;br /&gt;
Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Fairy==&lt;br /&gt;
Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dragonfly==&lt;br /&gt;
Moves along designated path, lingers by designated waypoint and moves to next random waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Snake==&lt;br /&gt;
Wanders about an area, includes special movement example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Treetop Birds==&lt;br /&gt;
Birds that move between treetops at random intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
==Vulture==&lt;br /&gt;
Birds that glide about on thermals&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Ecosystem Creatures=&lt;br /&gt;
&lt;br /&gt;
==Hunting Animal==&lt;br /&gt;
Wanders looking for specific prey and pursues when prey is spotted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grazing Prey Animal==&lt;br /&gt;
Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rat==&lt;br /&gt;
Wanders about a specified area, flees and hides if an agent approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mount==&lt;br /&gt;
Build a character that can be ridden with race example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dog==&lt;br /&gt;
Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cat==&lt;br /&gt;
Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hopping Scarecrow==&lt;br /&gt;
Wanders about hopping and approaches random people, lingers and moves on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1171354</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1171354"/>
		<updated>2012-08-02T21:04:18Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: I hadn&amp;#039;t intended to describe brain eating, must cut back on zombie movies&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
{&lt;br /&gt;
	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
	doSomething();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez(integer start_param) //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
{&lt;br /&gt;
	llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
	state wander;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez(integer start_param) //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0); //replace this with random timer, see next section&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Random Timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what if this was a zombie bunny with a taste for brains? hmm, brains).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llSetTimerEvent(llFrand(15.0));&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This generates a random grazing period of between 0s and 15s, each time it&#039;s called.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170916</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170916"/>
		<updated>2012-07-26T23:25:45Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* more than one state */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
{&lt;br /&gt;
	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
	doSomething();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez(integer start_param) //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
{&lt;br /&gt;
	llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
	state wander;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez(integer start_param) //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0); //replace this with random timer, see next section&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Random Timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what if this was a zombie bunny with a taste for brains? hmm, brains).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llSetTimerEvent(llFrand(15.0));&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This generates a random graze/brain eating of between 0s and 15s, each time it&#039;s called.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170915</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170915"/>
		<updated>2012-07-26T23:25:13Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* pathfinding character skeleton */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
{&lt;br /&gt;
	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
	doSomething();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez(integer start_param) //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
{&lt;br /&gt;
	llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
	state wander;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0); //replace this with random timer, see next section&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Random Timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what if this was a zombie bunny with a taste for brains? hmm, brains).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llSetTimerEvent(llFrand(15.0));&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This generates a random graze/brain eating of between 0s and 15s, each time it&#039;s called.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170909</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170909"/>
		<updated>2012-07-26T21:47:10Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: fixed glaring scripting error before anyone noted ;-)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
{&lt;br /&gt;
	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
	doSomething();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
{&lt;br /&gt;
	llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
	state wander;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0); //replace this with random timer, see next section&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Random Timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what if this was a zombie bunny with a taste for brains? hmm, brains).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llSetTimerEvent(llFrand(15.0));&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This generates a random graze/brain eating of between 0s and 15s, each time it&#039;s called.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1170549</id>
		<title>Pathfinding Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1170549"/>
		<updated>2012-07-12T21:05:24Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;UNDER DEVELOPMENT - INCOMPLETE&lt;br /&gt;
&lt;br /&gt;
==Hunting Animal==&lt;br /&gt;
Wanders looking for specific prey and pursues when prey is spotted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grazing Animal==&lt;br /&gt;
Wanders pauses and eat, wanders, repeat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grazing Prey Animal==&lt;br /&gt;
Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dragonfly==&lt;br /&gt;
Moves along designated path, lingers by designated waypoint and moves to next random waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Fairy==&lt;br /&gt;
Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sentient Treasure Chest==&lt;br /&gt;
Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rat==&lt;br /&gt;
Wanders about a specified area, flees and hides if an agent approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Snake==&lt;br /&gt;
Wanders about an area, includes special movement example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mount==&lt;br /&gt;
Build a character that can be ridden with race example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dog==&lt;br /&gt;
Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cat==&lt;br /&gt;
Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hopping Scarecrow==&lt;br /&gt;
Wanders about hopping and approaches random people, lingers and moves on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Treetop Birds==&lt;br /&gt;
Birds that move between treetops at random intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
==Vulture==&lt;br /&gt;
Birds that glide about on thermals&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170406</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170406"/>
		<updated>2012-07-09T14:27:20Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Random Timers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
		doSomething();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0); //replace this with random timer, see next section&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Random Timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what if this was a zombie bunny with a taste for brains? hmm, brains).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llSetTimerEvent(llFrand(15.0));&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This generates a random graze/brain eating of between 0s and 15s, each time it&#039;s called.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170405</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170405"/>
		<updated>2012-07-09T14:25:06Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: added random timer section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
		doSomething();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0); //replace this with random timer, see next section&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Random Timers===&lt;br /&gt;
&lt;br /&gt;
In the example above the rabbit eat grass for 15 seconds then wanders again, for a random period defined by how long it takes to reach it&#039;s next random wander target. This 15 second wait will make it an easy target for hunting creatures or agents (hunting game? what is it was a zombie bunny with a taste for brains?).&lt;br /&gt;
&lt;br /&gt;
To make things less predictable use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llSetTimerEvent(llFrand(15.0));&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This generates a random graze/brain eating of between 0s and 15s, each time it&#039;s called.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170404</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170404"/>
		<updated>2012-07-09T14:17:42Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: removed undesirable double line space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
		doSomething();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170403</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170403"/>
		<updated>2012-07-09T14:15:48Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: added hopping/jumping&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
		doSomething();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
===hopping/jumping===&lt;br /&gt;
&lt;br /&gt;
Use llExecCharacterCmd(CHARACTER_CMD_JUMP, [height, 1.0]) to make the character hop 1m into the air. If done with a timer event while using another pathfinding command such as [[llWanderWithin]] the hop will have an arc rather than just vertical movement. &lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170401</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170401"/>
		<updated>2012-07-09T05:59:39Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: major content addition&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
=Quick Guide=&lt;br /&gt;
&lt;br /&gt;
&amp;gt; object + pathfinding character skeleton + behavioural tropes = autonomous pathfinding creature&lt;br /&gt;
&lt;br /&gt;
This guide gives quick guidance of how to create specific behavioural tropes (commonly found autonomous characteristics) and doesn&#039;t go into detail about individual functions - see [[Pathfinding LSL Functions]] for more details.&lt;br /&gt;
&lt;br /&gt;
=Components=&lt;br /&gt;
&lt;br /&gt;
==pathfinding character skeleton==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
doSomething()&lt;br /&gt;
{&lt;br /&gt;
	//insert pathfinding functionality here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]); //create the character&lt;br /&gt;
		doSomething();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
==Behavioural Tropes==&lt;br /&gt;
&lt;br /&gt;
===flying/hovering===&lt;br /&gt;
3D spatial free flight is at present unavailable. We can however fake it but one of the following methods:&lt;br /&gt;
&lt;br /&gt;
# create a small object with a tall root prim - not recommended, causes excessive collisions&lt;br /&gt;
# create a small object and create a large character envelope - recommended&lt;br /&gt;
&lt;br /&gt;
The example below creates a character with a 1.5m tall and 0.25m wide envelope. If the object itself if 0.25 it will appear to be &amp;quot;flying&amp;quot;, or, more accurately, hovering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0, CHARACTER_RADIUS, 0.25, CHARACTER_LENGTH, 1.5]);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to further the illusion of flying we can do a number of things. If the creature is something that works at near ground height, such as a hummingbird or dragonfly just use one of the movement tropes, such as wandering.&lt;br /&gt;
&lt;br /&gt;
If you want the creature to fly higher than the 10.0m maximum character height (which will give a centre of mass height of 5.0m), we can use a platform. If you want a parrot to fly between trees place a prim or series of prims that stretch between them and use something like [[llPatrolPoints]] or [[llWanderWithin]]. Even if you use a series of narrow pathways the pathfinding will find a way to valid targets.&lt;br /&gt;
&lt;br /&gt;
We can make a really nice effect by using a mesh surface with an undulating form - the creature will follow the dips and rises giving the appearance of varying flight.&lt;br /&gt;
&lt;br /&gt;
For ground hugging creatures we can something similar that looks natural for hovering creatures by dynamically changing the envelope size of the creature by calling [[llUpdateCharacter]], as below. Call this function repeatedly with different values and the character will change the level it hovers at.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llUpdateCharacter(CHARACTER_LENGTH, 6.5);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===fleeing===&lt;br /&gt;
&lt;br /&gt;
There are two distinct behaviours we can exploit. If we wanted a character to run from a specific point such as an explosion we can use [[llFleeFrom]]. If we want to run from a specific object or agent (avatar) use [[llEvade]]&lt;br /&gt;
&lt;br /&gt;
===hiding===&lt;br /&gt;
&lt;br /&gt;
Part of [[llEvade]] is hiding (blocked line of sight) from the agent/object the character is fleeing from. See [[llEvade]] for more details.&lt;br /&gt;
&lt;br /&gt;
===move-wait-repeat===&lt;br /&gt;
&lt;br /&gt;
By responding to path events we can create varying behaviour. All pathfinding functions are moving to specific targe coordinates, whether determined randomly by something like [[llWanderWithin]], specific as in [[llPatrolPoints]] or even [[llPursue]]. &lt;br /&gt;
&lt;br /&gt;
Have a look at [[Path update]] for guidance, and see the example script in the multiple states discussion at the end of this article.&lt;br /&gt;
&lt;br /&gt;
===chase===&lt;br /&gt;
&lt;br /&gt;
Use [[llPursue]] and specify a target object or avatar.&lt;br /&gt;
&lt;br /&gt;
===hunt===&lt;br /&gt;
&lt;br /&gt;
Use a sensor of some description, such as [[llSensorRepeat]] or some sort of collision detection such [[llVolumeDetect]]&lt;br /&gt;
&lt;br /&gt;
===wait===&lt;br /&gt;
&lt;br /&gt;
To make a character pause you can use a state change with a new event trigger making the character active again, or simply use something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
llExecCharacterCmd([CHARACTER_CMD_STOP]);&lt;br /&gt;
llSleep(15.0);&lt;br /&gt;
llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []); //resume with any desired pathfinding function&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s a personal preference but generally speaking state changes are easier to manage and debug.&lt;br /&gt;
&lt;br /&gt;
===wandering===&lt;br /&gt;
&lt;br /&gt;
Use [[llWanderWithin]] to specify an area to wander within.&lt;br /&gt;
&lt;br /&gt;
==Optional Extras==&lt;br /&gt;
&lt;br /&gt;
To add to immersion it&#039;s worth adding some extras. If desired add...&lt;br /&gt;
&lt;br /&gt;
===animation===&lt;br /&gt;
see [[Animation Streamlined]] for tips&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
see [[Creature Sounds]] and [[Event Driven Sounds]]&lt;br /&gt;
&lt;br /&gt;
===more than one state===&lt;br /&gt;
&lt;br /&gt;
States are an excellent way of managing pathfinding creatures, but note however that pathfinding behaviour survives state changes - it&#039;s simple a simpler way of managing a status than using a variable. See the example below, which simulates a rabbit grazing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
animateGrassEating()&lt;br /&gt;
{&lt;br /&gt;
	//insert a cunning grass eating animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
animateTailWiggle()&lt;br /&gt;
{&lt;br /&gt;
	//insert very cute tail wiggle animation here&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	startup() //called as necessary from events such as script reset or rezzing&lt;br /&gt;
	{&lt;br /&gt;
		llCreateCharacter([CHARACTER_MAX_SPEED, 2, CHARACTER_DESIRED_SPEED, 1.0]); //create the character&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	state_entry() //standard event, called when the script resets&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	on_rez() //good to include so it scuttles off when rezzed from inventory or a rezzer&lt;br /&gt;
	{&lt;br /&gt;
		startup();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state wander&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		llWanderWithin(llGetPos(), &amp;lt;10.0, 10.0, 5.0&amp;gt;, []);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	path_update(integer type, list reserved)&lt;br /&gt;
	{&lt;br /&gt;
		if (type == PU_SLOWDOWN_DISTANCE_REACHED)&lt;br /&gt;
		{&lt;br /&gt;
			//we&#039;re near the goal, we need to switch behaviour&lt;br /&gt;
			llExecCharacterCmd([CHARACTER_CMD_SMOOTH_STOP]);&lt;br /&gt;
			state graze;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state graze&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
		animateGrassEating();&lt;br /&gt;
		llSetTimerEvent(15.0);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	timer()&lt;br /&gt;
	{&lt;br /&gt;
		llSetTimerEvent(0);&lt;br /&gt;
		animateTailWiggle();&lt;br /&gt;
		state wander;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1170396</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1170396"/>
		<updated>2012-07-09T02:28:19Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: added link to standard Pathfinding_LSL_Functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Tools_in_the_Second_Life_Viewer]]&#039;&#039;&#039; - The Pathfinding tools.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional development toolkit&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Pathfinding&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;[[Pathfinding LSL Functions]]&#039;&#039;&#039; - standard reference for all of the pathfinding functions.&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviors.&lt;br /&gt;
** &#039;&#039;&#039;[[Pathfinding Cookbook]]&#039;&#039;&#039; - ready made solutions for some critters.&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sounds&#039;&#039;&#039; - tips for adding efficient sound effects to your builds&lt;br /&gt;
** [[Environmental|Environment Sounds]]&lt;br /&gt;
** [[Creatures|Creature Sounds]]&lt;br /&gt;
** [[Event Driven|Event Driven Sounds]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170395</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170395"/>
		<updated>2012-07-09T01:42:00Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llApplyImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
This guide has two paths:&lt;br /&gt;
&lt;br /&gt;
# [[Modular Pathfinding Quick Reference|Quick Reference]] - a quick guide&lt;br /&gt;
# [[Modular Pathfinding Detailed Guide|Detailed Guide]] - a through look at pathfinding scripting theory&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170394</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170394"/>
		<updated>2012-07-09T01:40:52Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding (for instance using llImpulse with a pathfinding character)&lt;br /&gt;
&lt;br /&gt;
This guide has two paths:&lt;br /&gt;
&lt;br /&gt;
# [[Modular Pathfinding Quick Reference|Quick Reference]] - a quick guide&lt;br /&gt;
# [[Modular Pathfinding Detailed Guide|Detailed Guide]] - a through look at pathfinding scripting theory&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170393</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170393"/>
		<updated>2012-07-09T01:36:11Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: added physics exception&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;:&lt;br /&gt;
    1. 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
    2. mixing physics and pathfinding&lt;br /&gt;
&lt;br /&gt;
This guide has two paths:&lt;br /&gt;
&lt;br /&gt;
# [[Modular Pathfinding Quick Reference|Quick Reference]] - a quick guide&lt;br /&gt;
# [[Modular Pathfinding Detailed Guide|Detailed Guide]] - a through look at pathfinding scripting theory&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170392</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170392"/>
		<updated>2012-07-09T01:26:49Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;: 3D spatial movement - for example underwater free movement or aerial free movement, mixing physics and pathfinding&lt;br /&gt;
&lt;br /&gt;
This guide has two paths:&lt;br /&gt;
&lt;br /&gt;
# [[Modular Pathfinding Quick Reference|Quick Reference]] - a quick guide&lt;br /&gt;
# [[Modular Pathfinding Detailed Guide|Detailed Guide]] - a through look at pathfinding scripting theory&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Category:LSL_User-Defined_Functions&amp;diff=1170391</id>
		<title>Category:LSL User-Defined Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Category:LSL_User-Defined_Functions&amp;diff=1170391"/>
		<updated>2012-07-09T01:08:48Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header|ml=3}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}&lt;br /&gt;
==User-Defined Functions==&lt;br /&gt;
This category contains custom pre-defined function contributions from the LSL community to extend the abilities of LSL.&lt;br /&gt;
To add a wiki page to this category, include a link to this page. You may use the [[:Template:LSL_Function/docs|Template:LSL_Function]] (with &amp;quot;mode&amp;quot; set to user) to create the page to be added here.&lt;br /&gt;
&lt;br /&gt;
Go to the {{LSLGC|Functions}} page to view the built-in functions.&lt;br /&gt;
&lt;br /&gt;
=== About User-Defined Functions ===&lt;br /&gt;
LSL allows user-defined functions.  The syntax is very simple:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
return_type variable_name(par1type par1name, par2type par2name,...)&lt;br /&gt;
{&lt;br /&gt;
  function_statements;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  return value_of_return_type;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are no &amp;quot;function&amp;quot; or &amp;quot;def&amp;quot; keywords or function type/inheritance specifiers needed. I have not yet discovered what limits (if any) exist on the length or composition of the parameter list.  Multiple types can be used, as shown in the example below.  A list can be returned, so a single function can return a list with several values in it. User-defined functions will help keep scripts compact and readable, and allow rudimentary code reuse.  The [[LSL_Style_Guide]] suggests that user-defined functions should be placed before the default state definition and after user-defined variables. Placing user-defined functions after the first state will result in a Syntax Error.&lt;br /&gt;
&lt;br /&gt;
examples can be found linked below&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Holistic_Pathfinding_Management&amp;diff=1170390</id>
		<title>Holistic Pathfinding Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Holistic_Pathfinding_Management&amp;diff=1170390"/>
		<updated>2012-07-09T00:57:48Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;coming soon&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1170389</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1170389"/>
		<updated>2012-07-09T00:55:52Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */ minor fix to layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Tools_in_the_Second_Life_Viewer]]&#039;&#039;&#039; - The Pathfinding tools.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional development toolkit&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Pathfinding&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviors.&lt;br /&gt;
** &#039;&#039;&#039;[[Pathfinding Cookbook]]&#039;&#039;&#039; - ready made solutions for some critters&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sounds&#039;&#039;&#039; - tips for adding efficient sound effects to your builds&lt;br /&gt;
** [[Environmental|Environment Sounds]]&lt;br /&gt;
** [[Creatures|Creature Sounds]]&lt;br /&gt;
** [[Event Driven|Event Driven Sounds]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1170388</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1170388"/>
		<updated>2012-07-09T00:55:02Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: Added section for sounds scripting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Tools_in_the_Second_Life_Viewer]]&#039;&#039;&#039; - The Pathfinding tools.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional development toolkit&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Pathfinding&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviors.&lt;br /&gt;
** &#039;&#039;&#039;[[Pathfinding Cookbook]]&#039;&#039;&#039; - ready made solutions for some critters&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sounds&#039;&#039;&#039;&lt;br /&gt;
Tips for adding efficient sound effects to your builds&lt;br /&gt;
** [[Environmental|Environment Sounds]]&lt;br /&gt;
** [[Creatures|Creature Sounds]]&lt;br /&gt;
** [[Event Driven|Event Driven Sounds]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Holistic_Pathfinding_Management&amp;diff=1170386</id>
		<title>Holistic Pathfinding Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Holistic_Pathfinding_Management&amp;diff=1170386"/>
		<updated>2012-07-08T21:33:15Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: Created page with &amp;quot;  ---- Return to Good_Building_Practices&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1170385</id>
		<title>Pathfinding Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1170385"/>
		<updated>2012-07-08T21:33:00Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Hunting Animal==&lt;br /&gt;
Wanders looking for specific prey and pursues when prey is spotted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grazing Animal==&lt;br /&gt;
Wanders pauses and eat, wanders, repeat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grazing Prey Animal==&lt;br /&gt;
Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dragonfly==&lt;br /&gt;
Moves along designated path, lingers by designated waypoint and moves to next random waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Fairy==&lt;br /&gt;
Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sentient Treasure Chest==&lt;br /&gt;
Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rat==&lt;br /&gt;
Wanders about a specified area, flees and hides if an agent approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Snake==&lt;br /&gt;
Wanders about an area, includes special movement example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mount==&lt;br /&gt;
Build a character that can be ridden with race example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dog==&lt;br /&gt;
Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cat==&lt;br /&gt;
Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hopping Scarecrow==&lt;br /&gt;
Wanders about hopping and approaches random people, lingers and moves on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Treetop Birds==&lt;br /&gt;
Birds that move between treetops at random intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
==Vulture==&lt;br /&gt;
Birds that glide about on thermals&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170384</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170384"/>
		<updated>2012-07-08T21:32:40Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;: 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
&lt;br /&gt;
This guide has two paths:&lt;br /&gt;
&lt;br /&gt;
# [[Modular Pathfinding Quick Reference|Quick Reference]] - a quick guide&lt;br /&gt;
# [[Modular Pathfinding Detailed Guide|Detailed Guide]] - a through look at pathfinding scripting theory&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Return to [[Good_Building_Practices]]&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1170379</id>
		<title>Pathfinding Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Pathfinding_Cookbook&amp;diff=1170379"/>
		<updated>2012-07-08T15:54:20Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: Created page with &amp;quot;==Hunting Animal== Wanders looking for specific prey and pursues when prey is spotted.  &amp;lt;lsl&amp;gt; default { 	state_entry() 	{     	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACT…&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Hunting Animal==&lt;br /&gt;
Wanders looking for specific prey and pursues when prey is spotted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grazing Animal==&lt;br /&gt;
Wanders pauses and eat, wanders, repeat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Grazing Prey Animal==&lt;br /&gt;
Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dragonfly==&lt;br /&gt;
Moves along designated path, lingers by designated waypoint and moves to next random waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Fairy==&lt;br /&gt;
Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sentient Treasure Chest==&lt;br /&gt;
Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rat==&lt;br /&gt;
Wanders about a specified area, flees and hides if an agent approaches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Snake==&lt;br /&gt;
Wanders about an area, includes special movement example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mount==&lt;br /&gt;
Build a character that can be ridden with race example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dog==&lt;br /&gt;
Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Cat==&lt;br /&gt;
Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hopping Scarecrow==&lt;br /&gt;
Wanders about hopping and approaches random people, lingers and moves on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Treetop Birds==&lt;br /&gt;
Birds that move between treetops at random intervals.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
==Vulture==&lt;br /&gt;
Birds that glide about on thermals&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry()&lt;br /&gt;
	{&lt;br /&gt;
    	llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);&lt;br /&gt;
    	//script being tested/refined, coming soon&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170378</id>
		<title>Modular Pathfinding Kit</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Modular_Pathfinding_Kit&amp;diff=1170378"/>
		<updated>2012-07-08T15:06:33Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a lot of options for how to create pathfinding creatures. It’s best to start by having an idea of what you want to create, either a real world analogue like a horse or a dog, or something mythical such as a ghost or fairy.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;things that don’t work (at present)&#039;&#039;&#039;: 3D spatial movement - for example underwater free movement or aerial free movement&lt;br /&gt;
&lt;br /&gt;
This guide has two paths:&lt;br /&gt;
&lt;br /&gt;
# [[Modular Pathfinding Quick Reference|Quick Reference]] - a quick guide&lt;br /&gt;
# [[Modular Pathfinding Detailed Guide|Detailed Guide]] - a through look at pathfinding scripting theory&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169750</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169750"/>
		<updated>2012-06-24T21:42:23Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Tools_in_the_Second_Life_Viewer]]&#039;&#039;&#039; - The Pathfinding tools.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional development toolkit&lt;br /&gt;
* &#039;&#039;&#039;Pathfinding&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviours.&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169742</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169742"/>
		<updated>2012-06-24T14:56:26Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional development toolkit&lt;br /&gt;
* &#039;&#039;&#039;[[Scripting for Pathfinding]]&#039;&#039;&#039; - Pathfinding scripting help.&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviours.&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169708</id>
		<title>Debugging Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169708"/>
		<updated>2012-06-23T18:55:45Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: corrected spelling of Mjölnir ;-)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One of the hardest things with scripting anything non trivial in LSL, especially if you come from an software development environment where you&#039;re used to combined editor and debugger, is the seeming inability to debug LSL code.&lt;br /&gt;
&lt;br /&gt;
==Simple Example==&lt;br /&gt;
&lt;br /&gt;
The solution is to define a simple debugging utility function as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then whenever we need to check the value of a variable simple call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(&amp;quot;your debug message here&amp;quot;);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
don&#039;t forget to typecast as necessary, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer a = 3;&lt;br /&gt;
integer b = 4;&lt;br /&gt;
integer result = a * b;&lt;br /&gt;
notify((string)result);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows us to reuse the same function for reporting anything to the owner of the object, rather than using public chat. The advantage to doing this is we can comment out a single line in the code function as follows to disable all debugging, or we can search and replace and instance of &amp;quot;notify&amp;quot; with &amp;quot;//notify&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	//llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if you&#039;re working with list use something along the lines of:&lt;br /&gt;
&lt;br /&gt;
notify(llList2String(listName, integerIndex)); // notification contains one list element&lt;br /&gt;
	or&lt;br /&gt;
notify(llDumpList2String(listName, &amp;quot;,&amp;quot;)); notification contains entire list as a string&lt;br /&gt;
&lt;br /&gt;
==Error Reporting and Debugging==&lt;br /&gt;
We can use the same concept for tracking issues after the code is complete as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg); //coment out this line to turn off debugging&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg); //no prepend because it&#039;s a normal message&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re doing a number of things here: handling different kids of messages, informational for normal running, error reporting to the owner and creator and debug messages. To turn off debug simply comment out the debug line as shown in the code, and uncomment the genus=&amp;quot;off&amp;quot; line to disable all notifications.&lt;br /&gt;
&lt;br /&gt;
We&#039;re using llOwner for the current owner and llInstantMessage for contacting the script creator that will continue to work after ownership has passed - you just have insert your own key at the top.&lt;br /&gt;
&lt;br /&gt;
Other mechanisms that could be used include llEmail or llHTTPRequest to post a message to an external logging system perhaps.&lt;br /&gt;
&lt;br /&gt;
You define your own custome message types and communicate using the most appropriate method.&lt;br /&gt;
&lt;br /&gt;
==More Reuse==&lt;br /&gt;
We can extend the reuse even further by making this a discreet script on it&#039;s own within the object as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg); //coment out this line to turn off debugging&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg);  //no prepend because it&#039;s a normal message&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry() &lt;br /&gt;
	{&lt;br /&gt;
		notify(&amp;quot;info&amp;quot;, &amp;quot;notification system ready&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
    link_message(integer source, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        notify(str, key); //we&#039;re using the key as a second string parameter&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To send a notification you simply use in your implementation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer c)&lt;br /&gt;
    {&lt;br /&gt;
    	string msg = llKey2Name(llDetectedKey(0)) + &amp;quot; attempted to steal Mjölnir!&amp;quot;;&lt;br /&gt;
        llMessageLinked(LINK_SET, 0, &amp;quot;info&amp;quot;, msg);&lt;br /&gt;
        //this may seem odd but it&#039;s valid to use the key paramter of llMessageLinked as a second string passing facility if not actually used for a key&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169707</id>
		<title>Debugging Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169707"/>
		<updated>2012-06-23T18:52:35Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: added instructions on how to use the discreet debug script that got chopped off the end&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One of the hardest things with scripting anything non trivial in LSL, especially if you come from an software development environment where you&#039;re used to combined editor and debugger, is the seeming inability to debug LSL code.&lt;br /&gt;
&lt;br /&gt;
==Simple Example==&lt;br /&gt;
&lt;br /&gt;
The solution is to define a simple debugging utility function as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then whenever we need to check the value of a variable simple call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(&amp;quot;your debug message here&amp;quot;);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
don&#039;t forget to typecast as necessary, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer a = 3;&lt;br /&gt;
integer b = 4;&lt;br /&gt;
integer result = a * b;&lt;br /&gt;
notify((string)result);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows us to reuse the same function for reporting anything to the owner of the object, rather than using public chat. The advantage to doing this is we can comment out a single line in the code function as follows to disable all debugging, or we can search and replace and instance of &amp;quot;notify&amp;quot; with &amp;quot;//notify&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	//llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if you&#039;re working with list use something along the lines of:&lt;br /&gt;
&lt;br /&gt;
notify(llList2String(listName, integerIndex)); // notification contains one list element&lt;br /&gt;
	or&lt;br /&gt;
notify(llDumpList2String(listName, &amp;quot;,&amp;quot;)); notification contains entire list as a string&lt;br /&gt;
&lt;br /&gt;
==Error Reporting and Debugging==&lt;br /&gt;
We can use the same concept for tracking issues after the code is complete as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg); //coment out this line to turn off debugging&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg); //no prepend because it&#039;s a normal message&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re doing a number of things here: handling different kids of messages, informational for normal running, error reporting to the owner and creator and debug messages. To turn off debug simply comment out the debug line as shown in the code, and uncomment the genus=&amp;quot;off&amp;quot; line to disable all notifications.&lt;br /&gt;
&lt;br /&gt;
We&#039;re using llOwner for the current owner and llInstantMessage for contacting the script creator that will continue to work after ownership has passed - you just have insert your own key at the top.&lt;br /&gt;
&lt;br /&gt;
Other mechanisms that could be used include llEmail or llHTTPRequest to post a message to an external logging system perhaps.&lt;br /&gt;
&lt;br /&gt;
You define your own custome message types and communicate using the most appropriate method.&lt;br /&gt;
&lt;br /&gt;
==More Reuse==&lt;br /&gt;
We can extend the reuse even further by making this a discreet script on it&#039;s own within the object as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg); //coment out this line to turn off debugging&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg);  //no prepend because it&#039;s a normal message&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry() &lt;br /&gt;
	{&lt;br /&gt;
		notify(&amp;quot;info&amp;quot;, &amp;quot;notification system ready&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
    link_message(integer source, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        notify(str, key); //we&#039;re using the key as a second string parameter&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To send a notification you simply use in your implementation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer c)&lt;br /&gt;
    {&lt;br /&gt;
    	string msg = llKey2Name(llDetectedKey(0)) + &amp;quot; attempted to steal Mjolnir!&amp;quot;;&lt;br /&gt;
        llMessageLinked(LINK_SET, 0, &amp;quot;info&amp;quot;, msg);&lt;br /&gt;
        //this may seem odd but it&#039;s valid to use the key paramter of llMessageLinked as a second string passing facility if not actually used for a key&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169705</id>
		<title>Debugging Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169705"/>
		<updated>2012-06-23T18:34:12Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: added several line comments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One of the hardest things with scripting anything non trivial in LSL, especially if you come from an software development environment where you&#039;re used to combined editor and debugger, is the seeming inability to debug LSL code.&lt;br /&gt;
&lt;br /&gt;
==Simple Example==&lt;br /&gt;
&lt;br /&gt;
The solution is to define a simple debugging utility function as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then whenever we need to check the value of a variable simple call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(&amp;quot;your debug message here&amp;quot;);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
don&#039;t forget to typecast as necessary, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer a = 3;&lt;br /&gt;
integer b = 4;&lt;br /&gt;
integer result = a * b;&lt;br /&gt;
notify((string)result);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows us to reuse the same function for reporting anything to the owner of the object, rather than using public chat. The advantage to doing this is we can comment out a single line in the code function as follows to disable all debugging, or we can search and replace and instance of &amp;quot;notify&amp;quot; with &amp;quot;//notify&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	//llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if you&#039;re working with list use something along the lines of:&lt;br /&gt;
&lt;br /&gt;
notify(llList2String(listName, integerIndex)); // notification contains one list element&lt;br /&gt;
	or&lt;br /&gt;
notify(llDumpList2String(listName, &amp;quot;,&amp;quot;)); notification contains entire list as a string&lt;br /&gt;
&lt;br /&gt;
==Error Reporting and Debugging==&lt;br /&gt;
We can use the same concept for tracking issues after the code is complete as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg); //coment out this line to turn off debugging&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg); //no prepend because it&#039;s a normal message&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re doing a number of things here: handling different kids of messages, informational for normal running, error reporting to the owner and creator and debug messages. To turn off debug simply comment out the debug line as shown in the code, and uncomment the genus=&amp;quot;off&amp;quot; line to disable all notifications.&lt;br /&gt;
&lt;br /&gt;
We&#039;re using llOwner for the current owner and llInstantMessage for contacting the script creator that will continue to work after ownership has passed - you just have insert your own key at the top.&lt;br /&gt;
&lt;br /&gt;
Other mechanisms that could be used include llEmail or llHTTPRequest to post a message to an external logging system perhaps.&lt;br /&gt;
&lt;br /&gt;
You define your own custome message types and communicate using the most appropriate method.&lt;br /&gt;
&lt;br /&gt;
==More Reuse==&lt;br /&gt;
We can extend the reuse even further by making this a discreet script on it&#039;s own within the object as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg); //coment out this line to turn off debugging&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg);  //no prepend because it&#039;s a normal message&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry() &lt;br /&gt;
	{&lt;br /&gt;
		notify(&amp;quot;info&amp;quot;, &amp;quot;notification system ready&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
    link_message(integer source, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        notify(llString2CSV(str, 0), llString2CSV(str, 1));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169704</id>
		<title>Debugging Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169704"/>
		<updated>2012-06-23T18:29:38Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: Added discreet script dection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One of the hardest things with scripting anything non trivial in LSL, especially if you come from an software development environment where you&#039;re used to combined editor and debugger, is the seeming inability to debug LSL code.&lt;br /&gt;
&lt;br /&gt;
==Simple Example==&lt;br /&gt;
&lt;br /&gt;
The solution is to define a simple debugging utility function as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then whenever we need to check the value of a variable simple call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(&amp;quot;your debug message here&amp;quot;);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
don&#039;t forget to typecast as necessary, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer a = 3;&lt;br /&gt;
integer b = 4;&lt;br /&gt;
integer result = a * b;&lt;br /&gt;
notify((string)result);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows us to reuse the same function for reporting anything to the owner of the object, rather than using public chat. The advantage to doing this is we can comment out a single line in the code function as follows to disable all debugging, or we can search and replace and instance of &amp;quot;notify&amp;quot; with &amp;quot;//notify&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	//llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if you&#039;re working with list use something along the lines of:&lt;br /&gt;
&lt;br /&gt;
notify(llList2String(listName, integerIndex)); // notification contains one list element&lt;br /&gt;
	or&lt;br /&gt;
notify(llDumpList2String(listName, &amp;quot;,&amp;quot;)); notification contains entire list as a string&lt;br /&gt;
&lt;br /&gt;
==Error Reporting and Debugging==&lt;br /&gt;
We can use the same concept for tracking issues after the code is complete as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg);&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re doing a number of things here: handling different kids of messages, informational for normal running, error reporting to the owner and creator and debug messages. To turn off debug simply comment out the debug line as shown in the code, and uncomment the genus=&amp;quot;off&amp;quot; line to disable all notifications.&lt;br /&gt;
&lt;br /&gt;
We&#039;re using llOwner for the current owner and llInstantMessage for contacting the script creator that will continue to work after ownership has passed - you just have insert your own key at the top.&lt;br /&gt;
&lt;br /&gt;
Other mechanisms that could be used include llEmail or llHTTPRequest to post a message to an external logging system perhaps.&lt;br /&gt;
&lt;br /&gt;
You define your own custome message types and communicate using the most appropriate method.&lt;br /&gt;
&lt;br /&gt;
==More Reuse==&lt;br /&gt;
We can extend the reuse even further by making this a discreet script on it&#039;s own within the object as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg);&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
	state_entry() &lt;br /&gt;
	{&lt;br /&gt;
		notify(&amp;quot;info&amp;quot;, &amp;quot;notification system ready&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
    link_message(integer source, integer num, string str, key id)&lt;br /&gt;
    {&lt;br /&gt;
        notify(llString2CSV(str, 0), llString2CSV(str, 1));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169700</id>
		<title>Debugging Tips</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Debugging_Tips&amp;diff=1169700"/>
		<updated>2012-06-23T18:17:09Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: Created page with &amp;quot;One of the hardest things with scripting anything non trivial in LSL, especially if you come from an software development environment where you&amp;#039;re used to combined editor and deb…&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One of the hardest things with scripting anything non trivial in LSL, especially if you come from an software development environment where you&#039;re used to combined editor and debugger, is the seeming inability to debug LSL code.&lt;br /&gt;
&lt;br /&gt;
==Simple Example==&lt;br /&gt;
&lt;br /&gt;
The solution is to define a simple debugging utility function as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then whenever we need to check the value of a variable simple call&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(&amp;quot;your debug message here&amp;quot;);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
don&#039;t forget to typecast as necessary, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
integer a = 3;&lt;br /&gt;
integer b = 4;&lt;br /&gt;
integer result = a * b;&lt;br /&gt;
notify((string)result);&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows us to reuse the same function for reporting anything to the owner of the object, rather than using public chat. The advantage to doing this is we can comment out a single line in the code function as follows to disable all debugging, or we can search and replace and instance of &amp;quot;notify&amp;quot; with &amp;quot;//notify&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string msg)&lt;br /&gt;
{&lt;br /&gt;
	//llOwnerSay(msg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if you&#039;re working with list use something along the lines of:&lt;br /&gt;
&lt;br /&gt;
notify(llList2String(listName, integerIndex)); // notification contains one list element&lt;br /&gt;
	or&lt;br /&gt;
notify(llDumpList2String(listName, &amp;quot;,&amp;quot;)); notification contains entire list as a string&lt;br /&gt;
&lt;br /&gt;
==Error Reporting and Debugging==&lt;br /&gt;
We can use the same concept for tracking issues after the code is complete as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
notify(string genus, string msg)&lt;br /&gt;
{&lt;br /&gt;
	key creator = &amp;quot;a822ff2b-ff02-461d-b45d-dcd10a2de0c2&amp;quot;;&lt;br /&gt;
	//genus = &amp;quot;off&amp;quot; //uncoment this line to turn notifications off&lt;br /&gt;
	if (genus == &amp;quot;dbg&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;DEBUG: &amp;quot; + msg);&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;err&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(&amp;quot;ERROR: &amp;quot; + msg);&lt;br /&gt;
		llInstantMessage(creator, &amp;quot;ERROR: &amp;quot; + msg + &amp;quot; in object &amp;quot; + llGetObjectName() + &amp;quot; that belongs to &amp;quot; + llKey2Name(llGetOwner()) + &amp;quot; in region &amp;quot; + llGetRegionName());&lt;br /&gt;
	}&lt;br /&gt;
	else if (genus == &amp;quot;info&amp;quot;)&lt;br /&gt;
	{&lt;br /&gt;
		llOwnerSay(msg);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing, notifications were turned off&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re doing a number of things here: handling different kids of messages, informational for normal running, error reporting to the owner and creator and debug messages. To turn off debug simply comment out the debug line as shown in the code, and uncomment the genus=&amp;quot;off&amp;quot; line to disable all notifications.&lt;br /&gt;
&lt;br /&gt;
We&#039;re using llOwner for the current owner and llInstantMessage for contacting the script creator that will continue to work after ownership has passed - you just have insert your own key at the top.&lt;br /&gt;
&lt;br /&gt;
Other mechanism that could be used include llEmail or llHTTPRequest to post a message to an external logging system perhaps.&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169691</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169691"/>
		<updated>2012-06-23T09:50:40Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Smart Scripting]]&#039;&#039;&#039; - No lag scripting tips.&lt;br /&gt;
** &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional development toolkit&lt;br /&gt;
* &#039;&#039;&#039;[[Scripting for Pathfinding]]&#039;&#039;&#039; - Pathfinding scripting help.&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviours.&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169690</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169690"/>
		<updated>2012-06-23T09:50:22Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Smart Scripting]]&#039;&#039;&#039; - No lag scripting tips.&lt;br /&gt;
** &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a development toolkit&lt;br /&gt;
* &#039;&#039;&#039;[[Scripting for Pathfinding]]&#039;&#039;&#039; - Pathfinding scripting help.&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviours.&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169689</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169689"/>
		<updated>2012-06-23T09:46:06Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Smart Scripting]]&#039;&#039;&#039; - No lag scripting tips.&lt;br /&gt;
** &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional IDE&lt;br /&gt;
* &#039;&#039;&#039;[[Scripting for Pathfinding]]&#039;&#039;&#039; - Pathfinding scripting help.&lt;br /&gt;
** &#039;&#039;&#039;[[Modular Pathfinding Kit]]&#039;&#039;&#039; - code snippets designed to be plugged together to quickly build unique behaviours.&lt;br /&gt;
** &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169688</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169688"/>
		<updated>2012-06-23T09:43:29Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Smart Scripting]]&#039;&#039;&#039; - No lag scripting tips.&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional IDE&lt;br /&gt;
* &#039;&#039;&#039;[[Holistic Pathfinding Management]]&#039;&#039;&#039; - Strategies for managing large numbers of pathfinding objects.&lt;br /&gt;
* &#039;&#039;&#039;[[Scripting for Pathfinding]]&#039;&#039;&#039; - Pathfinding scripting help.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169687</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169687"/>
		<updated>2012-06-23T09:40:18Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Smart Scripting]]&#039;&#039;&#039; - No lag scripting tips.&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Tips]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional IDE&lt;br /&gt;
* &#039;&#039;&#039;[[Scripting for Pathfinding]]&#039;&#039;&#039; - Pathfinding scripting help.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169686</id>
		<title>Good Building Practices</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Good_Building_Practices&amp;diff=1169686"/>
		<updated>2012-06-23T09:39:41Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to Good Building Practices ==&lt;br /&gt;
This page is all about how to be creative and efficient at the same time!&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|valign=&amp;quot;top&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Animation ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Animation Streamlined]]&#039;&#039;&#039; - Let&#039;s make Second Life move, without dragging it to a crawl!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mesh ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh Physics]]&#039;&#039;&#039; - Why and How.&lt;br /&gt;
* &#039;&#039;&#039;[[Making Mesh for Pathfinding]]&#039;&#039;&#039; - Pathfinding friendly mesh.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pathfinding ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Overview]]&#039;&#039;&#039; - Pathfinding explained.&lt;br /&gt;
*&#039;&#039;&#039;[[Pathfinding_Quick_Start_Guide]]&#039;&#039;&#039; - The best way to get up and running with Pathfinding.&lt;br /&gt;
*&#039;&#039;&#039;[[Visual_Guide_to_Pathfinding|A Visual Guide]]&#039;&#039;&#039; - Watch how easy it is!&lt;br /&gt;
*&#039;&#039;&#039;[[Walkability_Coefficients]]&#039;&#039;&#039; - Control the speed of your Walkable areas.&lt;br /&gt;
*&#039;&#039;&#039;[[Material_Volumes]]&#039;&#039;&#039; - Control the speed of your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Physics ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Physics Optimization]]&#039;&#039;&#039; - Not everything needs physics, learn how to add the least load necessary to the physics engine.&lt;br /&gt;
* &#039;&#039;&#039;[[PRIM_PHYSICS_SHAPE_NONE]]&#039;&#039;&#039; - Additional information on this important attribute.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;|&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Smart Scripting]]&#039;&#039;&#039; - No lag scripting tips.&lt;br /&gt;
* &#039;&#039;&#039;[[Debugging Scripts]]&#039;&#039;&#039; - how to work out what your code is doing without a conventional IDE&lt;br /&gt;
* &#039;&#039;&#039;[[Scripting for Pathfinding]]&#039;&#039;&#039; - Pathfinding scripting help.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sculpted Prims ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Sculpted Prim Usage]]&#039;&#039;&#039; - What you need to know about how sculpted prims effect Second Life.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;[[Texture Usage]]&#039;&#039;&#039; - What size to use, and what to avoid.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Category:LSL_List&amp;diff=1167175</id>
		<title>Category:LSL List</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Category:LSL_List&amp;diff=1167175"/>
		<updated>2012-05-13T11:01:19Z</updated>

		<summary type="html">&lt;p&gt;Myopic Mole: /* Passing a List Into a Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header|ml=*}}{{LSLC|}}{{LSLC|Types}}&lt;br /&gt;
{{RightToc}}&lt;br /&gt;
A list is a special kind of data type which can contain zero or more elements.&lt;br /&gt;
&lt;br /&gt;
Lists are signified by square brackets surrounding their elements; the elements inside are separated by commas.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;lsl&amp;gt;[0,1,2,3,4]&lt;br /&gt;
&lt;br /&gt;
[&amp;quot;Yes&amp;quot;,&amp;quot;No&amp;quot;,&amp;quot;Perhaps&amp;quot;]&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: to be clear for those who have other programming backgrounds, there are no arrays in LSL: only lists.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Diverse Data Types====&lt;br /&gt;
&lt;br /&gt;
Not all elements in a list need to be the same type of element. In the same list, you can store strings, integers, floats, vectors, etc, right side by side.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;lsl&amp;gt;//a list with an integer, a float, a string, and a vector.&lt;br /&gt;
[1,14.154,&amp;quot;Isn&#039;t this fun?&amp;quot;,&amp;lt;0,0,0&amp;gt;]&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, a list may not contain another list (i.e. you can&#039;t nest them.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;[1, &amp;quot;one&amp;quot;, 2, &amp;quot;two&amp;quot;] + [3, &amp;quot;three&amp;quot;] returns [1, &amp;quot;one&amp;quot;, 2, &amp;quot;two&amp;quot;, 3, &amp;quot;three&amp;quot;]&amp;lt;/lsl&amp;gt;&lt;br /&gt;
not &lt;br /&gt;
&amp;lt;lsl&amp;gt;[1, &amp;quot;one&amp;quot;, 2, &amp;quot;two&amp;quot;, [3, &amp;quot;three&amp;quot;]]&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you add an element to a list, the list remembers automatically what data type the value was.&lt;br /&gt;
&lt;br /&gt;
Generally, because you&#039;re the one adding something to a list, you know what datatype is in what place in the list, and you retrieve it out of the list with the appropriate llList2&amp;amp;lt;type&amp;amp;gt; function such as: [[llList2String]], [[llList2Vector]], etc. (more on this later.)&lt;br /&gt;
&lt;br /&gt;
If for some reason, though, you need to test what data type an element is in a list, you can use the [[llGetListEntryType]] function.&lt;br /&gt;
&lt;br /&gt;
Tip! When adding a [[float]] to a list, always add it with a decimal point (e.g 1.0 as opposed to 1) to ensure that it is preserved as a float.&lt;br /&gt;
&lt;br /&gt;
List can be directly typecast into string&lt;br /&gt;
&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
     touch_start(integer total_number)&lt;br /&gt;
    {   &lt;br /&gt;
        list a = [&amp;quot;abc&amp;quot;,1,2,3.14,&amp;lt;0,0,0&amp;gt;];&lt;br /&gt;
        llOwnerSay((string)a); // outcome:  abc123.140000&amp;lt;0.000000, 0.000000, 0.000000&amp;gt;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or can use a [[do while]] condition to say each list item separately&lt;br /&gt;
&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
     touch_start(integer total_number)&lt;br /&gt;
    {   &lt;br /&gt;
        list a = [&amp;quot;abc&amp;quot;,&amp;quot;def&amp;quot;,&amp;quot;ghi&amp;quot;,&amp;quot;jkl&amp;quot;,&amp;quot;lmn&amp;quot;,&amp;quot;opq&amp;quot;];&lt;br /&gt;
        integer i;&lt;br /&gt;
        integer s = llGetListLength(a);&lt;br /&gt;
        do&lt;br /&gt;
        llOwnerSay(llList2String(a,i));&lt;br /&gt;
        while(s&amp;gt;++i);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Common List Operations ===&lt;br /&gt;
====Counting place in a list vs list length====&lt;br /&gt;
&lt;br /&gt;
It&#039;s important at the outset to note the following (which can trip up even experienced minds when they are battle-weary):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;[&amp;quot;Yes&amp;quot;,&amp;quot;No&amp;quot;,&amp;quot;Perhaps&amp;quot;]&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of this list is 3, because it has 3 elements in it. The length of a list is returned by the [[llGetListLength]]() function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer length = llGetListLength(mylist);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BUT, counting to determine an element&#039;s place in its list (aka &amp;quot;indexing&amp;quot;) starts at 0 -- NOT 1.&lt;br /&gt;
&lt;br /&gt;
The position of &amp;quot;Yes&amp;quot; in the above list is 0, &amp;quot;No&amp;quot; is at position 1, and &amp;quot;Perhaps&amp;quot; is at position 2.&lt;br /&gt;
&lt;br /&gt;
Consequently, if you have 7 elements in a list, the last item in the list will be at position 6.&lt;br /&gt;
&lt;br /&gt;
Thus to retrieve the last element in a list, without having to know in advance what position it is at, you can just go:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;integer length = llGetListLength(mylist);&lt;br /&gt;
string item = llList2String(myList,length - 1);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====List Limits====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;(As of 2/20/11 these limits do not appear to apply for both LSO and Mono.)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
While a script is running, a list can grow dynamically as large as needed, limited only by the amount of memory that is available in the script.&lt;br /&gt;
&lt;br /&gt;
However, at compile (aka save) time, there is a 72 element limit to pre-defined lists hardcoded in the script. Such long, predefined lists are common, for example, when someone is offering the user a plethora of colour choices.&lt;br /&gt;
&lt;br /&gt;
Tip! If you really need 72 or more such choices in a pre-defined list, just make 2 (or more) lists that don&#039;t upset the compiler, and join them together in state_entry() or wherever appropriate:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;biggerlist = biglist01 + biglist02;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Adding an Element to a list====&lt;br /&gt;
&lt;br /&gt;
There are several ways used to add an element to an existing list via prepending/appending:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;lsl&amp;gt;myList = [new_item] + myList; // Best method for Mono-LSL: prepended list concatenation&amp;lt;/lsl&amp;gt;&lt;br /&gt;
# &amp;lt;lsl&amp;gt;myList = myList + [new_item]; // appended list concatenation&amp;lt;/lsl&amp;gt;&lt;br /&gt;
# &amp;lt;lsl&amp;gt;myList += [new_item]; // appended list concatenation with simplified syntax&amp;lt;/lsl&amp;gt;&lt;br /&gt;
# &amp;lt;lsl&amp;gt;myList = (myList=[]) + myList + [new_item]; // appended list concatenation with memory fragmentation optimization&amp;lt;/lsl&amp;gt;&lt;br /&gt;
# &amp;lt;lsl&amp;gt;myList = myList + new_item; // appended item&amp;lt;/lsl&amp;gt;&lt;br /&gt;
# &amp;lt;lsl&amp;gt;myList += new_item; // appended item with simplified syntax&amp;lt;/lsl&amp;gt;&lt;br /&gt;
# &amp;lt;lsl&amp;gt;myList = (myList=[]) + myList + new_item; // Best method for LSO-LSL: appended item with memory fragmentation optimization&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Notes=====&lt;br /&gt;
* As of 8/8/2009 Method 1 gives significant savings over any other method used in Mono-LSL.&lt;br /&gt;
** Note that prepending the new_item &#039;&#039;&#039;without&#039;&#039;&#039; brackets &#039;&#039;&#039;negates&#039;&#039;&#039; any memory savings in Mono-LSL.&lt;br /&gt;
** Method 1 will consume more memory than other methods in LSO-LSL.&lt;br /&gt;
* As of 8/8/2009 Method 7 returns the best value for savings in LSO-LSL.&lt;br /&gt;
** Method 7 is better than Method 4 due to the fact that Method 7 takes up less script overhead.&lt;br /&gt;
** Method 7 test script compiled to have a start memory of 15878, while Method 4 compiled to have a start memory of 15871. As a result Method 7 had more free memory than Method 4 at the end of the test operation.&lt;br /&gt;
* Methods 2 &amp;amp; 3 compile to the same thing.&lt;br /&gt;
* Methods 5 &amp;amp; 6 compile to the same thing.&lt;br /&gt;
* Methods 5, 6 &amp;amp; 7 have a bytecode savings over methods 2, 3 &amp;amp; 4 respectively, though there is an LSO-LSL VM bug that causes the string &amp;amp; key typecasts to not stick properly: {{Jira|SVC-1710}}.&lt;br /&gt;
* Methods 4 &amp;amp; 7 can result in a considerable memory savings in LSO-LSL over methods 2, 3, 5 &amp;amp; 6 (it helps reduce heap fragmentation, which would otherwise result in unusable blocks of heap memory){{Footnote|This method was invented and popularized by {{User|Strife Onizuka}}|This method was invented and popularized by Strife Onizuka}}. In Mono-LSL it provides no significant memory advantage or disadvantage.&lt;br /&gt;
** Depending upon the situation (in LSO-LSL) this method may not provide any advantage what so ever. If in doubt profile the script with and without using this method.&lt;br /&gt;
&lt;br /&gt;
====Joining Lists (aka Concatenation)====&lt;br /&gt;
&lt;br /&gt;
Lists can be joined simply by using the + sign:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;newlist = list01 + list02;&lt;br /&gt;
&lt;br /&gt;
newlist = list01 + [&amp;quot;red&amp;quot;,&amp;quot;brown&amp;quot;,&amp;lt;0,0,0&amp;gt;];&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The above example actually creates 3 lists in memory while the command runs, even though just one is returned. This can affect memory usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Clearing a List====&lt;br /&gt;
&lt;br /&gt;
To clear a list, set it equal to two square, empty brackets like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;myList = [];&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Passing a List Into a Function====&lt;br /&gt;
&lt;br /&gt;
Passing a list into a function is little different than passing any other data type, however, there are some useful cases to be aware of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;myList = llListReplaceList(myList, [&amp;quot;myString&amp;quot;], 2, 2);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, we call [[llListReplaceList]](), an innocent enough operation, however, due to the way passing of lists, and functions such as llListReplaceList(), [[llDeleteSubList]](), [[llList2List]]() and [[llListSort]]() (and others), work, you can end up using two, three, or even four times the amount of memory required to store your list, just by calling that function! To avoid this problem, we can use a small piece of optimisation; if you know that the list you&#039;re passing into such a function will never be read again (for example if the result of the function will overwrite the list) then we can do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;myList = llListReplaceList((myList = []) + myList, [&amp;quot;myString&amp;quot;], 2, 2);&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of this is to greatly reduce the memory usage, in both LSO-LSL and Mono VMs, and also reduce the fragmentation of memory. This can also work for other cases other than function-calls, for example when concatenating lists (above), you may find that this nearly eliminates any memory problem:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list list1 = [&amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot;];&lt;br /&gt;
list2 = [&amp;quot;d&amp;quot;, &amp;quot;e&amp;quot;, &amp;quot;f&amp;quot;];&lt;br /&gt;
list3 = (list1 = list2 = []) + list1 + list2;&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Processing a List Into Another List====&lt;br /&gt;
&lt;br /&gt;
A more complex case, but sometimes when processing a large list you may find that you are producing a similarly large list as a result. In such cases there is a very large risk of running out of memory. As a result, in any case where you know you will, or might, be working on a particularly large list, it will often be worth manipulating them similarly to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list myOutput = [];&lt;br /&gt;
&lt;br /&gt;
integer i = 0; integer x = myList != [];&lt;br /&gt;
for (; i &amp;lt; x; ++i) {&lt;br /&gt;
    if (i &amp;gt; 10) { // Prune list every 10 elements&lt;br /&gt;
        myList = llDeleteSubList((myList = []) + myList, 0, i - 1);&lt;br /&gt;
        x -= i;&lt;br /&gt;
        i = 0;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   // Do some work here:&lt;br /&gt;
   myOutput += llList2List(myList, i, i); // A silly bit of example work&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method (deleting every few list entries or strides) is preferable to deleting an entry every loop, as the cost of calling llDeleteSubList() is very high. It is up to the scripter to decide what their optimal chunk-size is for pruning an input list, as you will need to balance memory use with delete cost.&lt;br /&gt;
&lt;br /&gt;
== Strided lists ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One common use of lists is to duplicate the functionality of structured collections of data (aka &amp;lt;i&amp;gt;structs&amp;lt;/i&amp;gt;). Such collections, available in many programming languages, are absent from LSL.&lt;br /&gt;
&lt;br /&gt;
In-world in SL, (still as of July 2008), a strided list is the closest you can get to storing limited amounts of data in some kind of structure that you can access and manipulate in a few, limited ways.&lt;br /&gt;
&lt;br /&gt;
Strided lists allow you to store related data pieces grouped (aka &amp;quot;strided&amp;quot;) in sets. You can determine how many pieces of data in each &amp;quot;grouping.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
An example is best at this point. You might use a strided list to track the names, gender and rez dates of a group of avatars:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;list demographics = [&amp;quot;John Adams&amp;quot;, &amp;quot;male&amp;quot;, &amp;quot;2007-06-22&amp;quot;, &amp;quot;Shirley Bassey&amp;quot;, &amp;quot;female&amp;quot;, &amp;quot;2005-11-02&amp;quot;, &amp;quot;Matt Damon&amp;quot;, &amp;quot;male&amp;quot;, &amp;quot;2008-05-19&amp;quot;];&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example has a &amp;lt;i&amp;gt;stride&amp;lt;/i&amp;gt; of three, because each grouping (or stride) has three data elements. Index 0 (&amp;quot;John Adams&amp;quot;) is the start of the first instance (because list counting starts a 0), index 3 (&amp;quot;Shirley Bassey&amp;quot;) is the start of the second instance, and so on.&lt;br /&gt;
&lt;br /&gt;
It is important that the pieces of information in each grouping are always entered in the same sequence for every instance of the grouping in the list! In the example above, this means that the name needs to be always the first of the three related elements. You should consider carefully the order in which you record information because the function to sort a list, [[llListSort]], will only sort on the &amp;lt;i&amp;gt;first element&amp;lt;/i&amp;gt; of the instances. In other words, if the avatar&#039;s rez date were the most important attribute for your script, then you would need to record it first, and the name second. If you wish to be able to sort by avatar last name rather than first name, the name should be added to the list in Lastname FirstName format (avoiding a comma, though, of course, unless you wanted LastName and FirstName treated as separate elements in the list.)&lt;br /&gt;
&lt;br /&gt;
To add another person to the above list, you would do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;demographics += [&amp;quot;Dorthy Lamour&amp;quot;, &amp;quot;female&amp;quot;, &amp;quot;2010-01-22&amp;quot;];&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You cannot do any kind of fancy data analysis or manipulation with strided lists, as you can in off-world databases or spreadsheets, but they can meet some limited, in-world needs, if you don&#039;t have the resources to tie-in off-world tools. It should be noted that when manipulating extremely large strided lists, that if you expect to be editing the lists that you may wish to use one list for each &amp;quot;column&amp;quot;, this may be more complex but significantly reduces the amount of memory required when manipulating the lists, though it will be a lot more difficult to sort.&lt;br /&gt;
&lt;br /&gt;
Here are the tools we do have for strided lists:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following three (as of July 2008) native LSL functions can be used with strided lists:&lt;br /&gt;
&lt;br /&gt;
*[[llList2ListStrided]]&lt;br /&gt;
*[[llListRandomize]]&lt;br /&gt;
*[[llListSort]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are some additional, user-created functions for working with strided lists:&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable}}&lt;br /&gt;
|+&lt;br /&gt;
|-{{Hl2}}&lt;br /&gt;
!function&lt;br /&gt;
!purpose&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListStridedMove]] || Moves something in a strided list to another place in the strided list.&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListStridedRemove]] || Removes part of a strided list.&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListStridedUpdate]] || Updates part of a strided list.&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListStridedReorder]] || Reorder the contents of every stride or reorder entire strides.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Extended List Operations ==&lt;br /&gt;
&lt;br /&gt;
These functions have been created and contributed by LSL users to perform operations not covered by built-in LSL functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable}}&lt;br /&gt;
|+&lt;br /&gt;
|-{{Hl2}}&lt;br /&gt;
!function&lt;br /&gt;
!purpose&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListCast]] || Processes a list so that its contents are of a single-type.&lt;br /&gt;
|-&lt;br /&gt;
|| [[List_cast]] || Processes a list so that its contents are converted from strings to their respective types.&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListCompare]] || Compares two lists for equality&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListItemDelete]] || Removes one element from a list.&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListKeyCase]] || Changes the values of the whole list into uppercase or lowercase based on input&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListToWholeNumbers]] || Given a list of floats, converts them all to whole numbers (aka integers.)&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListXorY]] || Join two lists to make one new combined list, while also eliminating any resulting duplicates in the new list.&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListXandY]] || This function examines two lists, and returns a new list composed of the elements that both lists have in common. &lt;br /&gt;
|-&lt;br /&gt;
|| [[ListXnotY]] || Show what x list has that y list is missing. &lt;br /&gt;
|-&lt;br /&gt;
|| [[ListXxorY]] || Returns a new list, composed of elements that were in either original script, but not both. Note: This is not the same as getting rid duplicates by preserving just one of each duplicated item. It goes further, and removes both items. &lt;br /&gt;
|-&lt;br /&gt;
|| [[ListXequY]] || Answers the question: is list X identical to list Y? &lt;br /&gt;
|-&lt;br /&gt;
|| [[ListXneqY]] || Answers the question: is list X different from list Y?&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListItemReplace|Replace]] || Replaces a single occurrence of something in a list with something else that you specify.&lt;br /&gt;
|-&lt;br /&gt;
|| [[Library_Combined_Library#Replace_2|Replace All]] || Replaces all occurrences of &#039;from list&#039; with those in &#039;to list&#039; in &#039;src list&#039;. Not as concise as the replace function above, but will handle multiple items at the same time.&lt;br /&gt;
|-&lt;br /&gt;
|| [[ListUnique ]] || Given a list of elements, returns a list of only the unique individual elements in that list.&lt;br /&gt;
|-&lt;br /&gt;
|| [[ccFixListDatatypes ]] || Walks a list, casts the elements to the appropriate types, and returns a fixed list. Useful for things like [[llSetPrimitiveParams]] when you&#039;ve parsed your data out of a string.&lt;br /&gt;
|-&lt;br /&gt;
|| [[2D Pseudo-Array]] || A way to emulate the behavior of a 2 dimensional array.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Myopic Mole</name></author>
	</entry>
</feed>