Scripting your pet frog

Join us in Outworldz at www.outworldz.com:9000 or follow us:

[Table of Contents]

Scripting your pet frog

Its time to make the legs move on your frog. The technique is the simplest possible one to make it appear that legs are moving: I use many legs and turn them invisible or visible to make it appear they are moving. Other techniques such as using Prim Animation and Sculpt Flipping are more advanced.

You will need to add each of these scripts to each set of leg and tongue prims.

ZIp fileDownload the Zip file of scripts

I have spread them out so you can see the ordering, click for a larger view

script names and locations

Once you have put the leg and tongue scripts in, add the 'test legs' script to the main, root prim

Test legs script

default
{
       
    touch_start(integer who)
    {
        
        llMessageLinked(LINK_SET,0,"SIT","");
        llSleep(2);
        
        llMessageLinked(LINK_SET,0,"HOP","");
        llSleep(2);
        
        llMessageLinked(LINK_SET,0,"SIT","");
        llSleep(2);
        
        llMessageLinked(LINK_SET,0,"EAT","");
        llSleep(2);
        
        llMessageLinked(LINK_SET,0,"SIT","");
        llSleep(2);
    }
    
}

This script will animate your frog legs as a test. Legs should show normal looking frog, a frog leaping, sitting, then eating with tongue out and rear legs back, and again seated.

If this passes the tests, congratulations, you are almost done. You can delete or stop the frog test script.

If the legs did not animate, check your scripts and make sure they are in the correct order and that they all compiled and ran.

Scripting the frog body

The last step is to add the frog body script. This script goes into the main, root prim.

Once the script is in, and compiled. touch the frog. It should start to hop around.

Make sure your frog is up and looking for food. It should periodically chase after your bug and eat it.

Menu

You can click the frog again to reset the home point, and to set how often it hunts for bugs.

Menu

Clicking "Home" will set the location of the frog. It will not wander more than 5 meters from that location as it looks for food.

Clicking "Time" will let you set a time interval that the frog sits before seeking food.

Clicking "Range" will let you change the distance the frog will move.

Clicking "Help" will take you to this article on how to make your own frog.


If you have any problems, please comment below or email me, fred@outworldz.com and I will do my best to figure out what is wrong and get it working for you.

Back to the Best Free Tools in Second Life and OpenSim.