Difference between revisions of "Pathfinding Cookbook"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "==Hunting Animal== Wanders looking for specific prey and pursues when prey is spotted. <lsl> default { state_entry() { llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACT…")
 
m
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
==Hunting Animal==
UNDER DEVELOPMENT - INCOMPLETE
Wanders looking for specific prey and pursues when prey is spotted.
 
=Rezzer=
 
The code below is for a simple rezzer for the creatures. For a region scale rezzer system see [[Holistic_Pathfinding_Management]]
 
<source lang="lsl2">
 
</source>


<lsl>
=Simple Creatures=
default
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Grazing Animal==
==Grazing Animal==
Wanders pauses and eat, wanders, repeat.
Wanders pauses and eat, wanders, repeat.


<lsl>
<source lang="lsl2">
default
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Grazing Prey Animal==
</source>
Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.


<lsl>
==Sentient Treasure Chest==
default
Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Dragonfly==
<source lang="lsl2">
Moves along designated path, lingers by designated waypoint and moves to next random waypoint.


<lsl>
</source>
default
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Fairy==
==Fairy==
Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.
Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.


<lsl>
<source lang="lsl2">
default
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Sentient Treasure Chest==
</source>
Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.


<lsl>
==Dragonfly==
default
Moves along designated path, lingers by designated waypoint and moves to next random waypoint.
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Rat==
<source lang="lsl2">
Wanders about a specified area, flees and hides if an agent approaches.


<lsl>
</source>
default
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Snake==
==Snake==
Wanders about an area, includes special movement example.
Wanders about an area, includes special movement example.


<lsl>
<source lang="lsl2">
default
 
{
</source>
state_entry()
 
{
==Treetop Birds==
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
Birds that move between treetops at random intervals.
    //script being tested/refined, coming soon
 
}
<source lang="lsl2">
}
 
</lsl>
</source>
 
==Vulture==
Birds that glide about on thermals
 
<source lang="lsl2">
 
</source>
 
=Ecosystem Creatures=
 
==Hunting Animal==
Wanders looking for specific prey and pursues when prey is spotted.
 
<source lang="lsl2">
 
</source>
 
==Grazing Prey Animal==
Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.
 
<source lang="lsl2">
 
</source>
 
==Rat==
Wanders about a specified area, flees and hides if an agent approaches.
 
<source lang="lsl2">
 
</source>


==Mount==
==Mount==
Build a character that can be ridden with race example.
Build a character that can be ridden with race example.


<lsl>
<source lang="lsl2">
default
 
{
</source>
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Dog==
==Dog==
Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.
Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.


<lsl>
<source lang="lsl2">
default
 
{
</source>
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Cat==
==Cat==
Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.
Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.


<lsl>
<source lang="lsl2">
default
 
{
</source>
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Hopping Scarecrow==
==Hopping Scarecrow==
Wanders about hopping and approaches random people, lingers and moves on.
Wanders about hopping and approaches random people, lingers and moves on.


<lsl>
<source lang="lsl2">
default
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>


==Treetop Birds==
</source>
Birds that move between treetops at random intervals.
 
<lsl>
default
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>
 
==Vulture==
Birds that glide about on thermals


<lsl>
----
default
Return to [[Good_Building_Practices]]
{
state_entry()
{
    llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
    //script being tested/refined, coming soon
}
}
</lsl>

Latest revision as of 15:34, 25 January 2015

UNDER DEVELOPMENT - INCOMPLETE

Rezzer

The code below is for a simple rezzer for the creatures. For a region scale rezzer system see Holistic_Pathfinding_Management

Simple Creatures

Grazing Animal

Wanders pauses and eat, wanders, repeat.

Sentient Treasure Chest

Treasure chest with legs. Sleeps, but runs and hides if anyone approaches.

Fairy

Wanders about (flying) looking for flowers, lingers by flowers, runs and hides from agents.

Dragonfly

Moves along designated path, lingers by designated waypoint and moves to next random waypoint.

Snake

Wanders about an area, includes special movement example.

Treetop Birds

Birds that move between treetops at random intervals.

Vulture

Birds that glide about on thermals

Ecosystem Creatures

Hunting Animal

Wanders looking for specific prey and pursues when prey is spotted.

Grazing Prey Animal

Wanders and pauses to eat, run a short distance when approached (skittish), runs further and hides from specific predator.

Rat

Wanders about a specified area, flees and hides if an agent approaches.

Mount

Build a character that can be ridden with race example.

Dog

Wanders about, chooses random agent, follows agent for a period, then wanders off, if no agents found sleeps.

Cat

Wanders about, chooses random agent, lingers by agent, then wanders again, if no agents found sleeps.

Hopping Scarecrow

Wanders about hopping and approaches random people, lingers and moves on.


Return to Good_Building_Practices