Difference between revisions of "Path update"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{TOCright}} {{Box |Event: path_update( integer updateType, list reserved ) { ; } |Contents}} {{Box|Caveats|Contents}} {{Box|Examples|Contents}} {{Bo…")
 
Line 7: Line 7:
{{Box|Caveats|Contents}}
{{Box|Caveats|Contents}}


{{Box|Examples|Contents}}
{{Box|Examples|
<lsl>
default
{
    state_entry()
    {
        llDeleteCharacter(); // Clear any previous character behaviors
        llCreateCharacter([CHARACTER_DESIRED_SPEED, 35.0]);
       
        llWanderWithin(llGetPos(), 10.0, []);
    }
   
    path_update(integer type, list reserved)
    {
        if (type == 0)
        {
            llOwnerSay("Near");
        }
        else if (type == 1)
        {
            llOwnerSay("Stopping");
        }
        else if (type == 2)
        {
            llOwnerSay("Cannot path find from current location! Attempting to go to the center of the region.");
           
            llNavigateTo(<128.0, 128.0, llGround(<128.0, 128.0, 0.0> - llGetPos())>, [FORCE_DIRECT_PATH, TRUE]);
        }
        else if (type == 3)
        {
            llOwnerSay("Goal not on navmesh!");
        }
        else if (type == 4)
        {
            llOwnerSay("Goal unreachable!");
        }
        else if (type == 5)
        {
            llOwnerSay("Target gone!");
        }
        else if (type == 6)
        {
            llOwnerSay("No place to go!");
        }
        else if (type == 7)
        {
            llOwnerSay("Hiding from pursuer...");
        }
        else if (type == 8)
        {
            llOwnerSay("Switched from hiding to running...");
        } else
        {
            llOwnerSay("Unknown failure");
        }
    }
}
</lsl>
}}


{{Box|Notes|Contents}}
{{Box|Notes|Contents}}


{{Box|See Also|Contents}}
{{Box|See Also|Contents}}

Revision as of 11:40, 14 February 2012

Event: path_update( integer updateType, list reserved ) { ; }

Contents


Caveats

Contents


Examples


Notes

Contents


See Also

Contents