removed useless _ folders
This commit is contained in:
3
Zombies/Scripts/Zombies/Zombies.sol
Normal file
3
Zombies/Scripts/Zombies/Zombies.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="Zombies">
|
||||
<Project name="Zombies" path="Zombies\Zombies.prj" active="true"/>
|
||||
</Solution>
|
||||
14
Zombies/Scripts/Zombies/Zombies/Zombies.prj
Normal file
14
Zombies/Scripts/Zombies/Zombies/Zombies.prj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project name="Zombies" guid="1cf5a964-3691-4049-9167-5da16d4508d5">
|
||||
<Object name="Zombies" guid="a76aff63-526f-4af8-b301-267d076ac2f3" active="true">
|
||||
<Script name="Animator.lsl" guid="b1d52726-b8f9-4e5d-98e8-887c52d3eb8e">
|
||||
</Script>
|
||||
<Notecard name="Movement" guid="6f1df51a-38f5-4be2-978e-44cd86a39c98">
|
||||
</Notecard>
|
||||
<Notecard name="Notecard.txt" guid="d2393620-1bb3-403d-aab8-4f8f98a3d9e4">
|
||||
</Notecard>
|
||||
<Script name="pose ball.lsl" guid="f2a07fc2-16b3-413a-b8cd-293435e9fe04">
|
||||
</Script>
|
||||
<Script name="walk script.lsl" guid="57ea9b17-751a-402c-9d00-e9646e36cfd5">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
@@ -0,0 +1,93 @@
|
||||
float distance = 30.0; // scan range
|
||||
integer delay = 10; // repeat scan every 10 seconds.
|
||||
|
||||
// added
|
||||
// (gnore specific scripts, some scripts need to be off after initial setups
|
||||
// There's a bug that resets scripts in off state after a sim restart, so when activated again they re-initialise.
|
||||
// I've no fix for that.
|
||||
//
|
||||
list ignore_scripts = [];
|
||||
|
||||
integer debug = FALSE; // for debugging purposes, set it to TRUE to see what it's controlling
|
||||
|
||||
|
||||
//////////////////////////////////////
|
||||
// no need to modify the code below //
|
||||
//////////////////////////////////////
|
||||
|
||||
integer g_active = FALSE; // if FALSE disable all other scripts
|
||||
// changed TRUE into FALSE cos of some bug with rezzing, thank you LordGregGreg Back :)
|
||||
list control_scripts; // list for all scriptnames
|
||||
|
||||
active_scripts( integer active )
|
||||
{
|
||||
if(g_active == active) return; else g_active = active; //flip TRUE/FALSE
|
||||
|
||||
integer a;
|
||||
for ( a = 0; a < llGetListLength(control_scripts); a++)
|
||||
{
|
||||
llSetScriptState(llList2String(control_scripts, a), g_active); //(de)activate scripts
|
||||
|
||||
}
|
||||
if (debug) llOwnerSay("Changed: " + llList2CSV(control_scripts) + " to: " + (string)g_active );
|
||||
}
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
string myname = llGetScriptName(); //don't add myself into the list
|
||||
control_scripts = [];
|
||||
|
||||
integer i;
|
||||
integer n = llGetInventoryNumber(INVENTORY_SCRIPT); //count scripts
|
||||
|
||||
if (n == 1) { llOwnerSay("No other scripts found!"); } else //dont be silly ;)
|
||||
|
||||
for(i = 0; i < n; ++i)
|
||||
{
|
||||
string name = llGetInventoryName(INVENTORY_SCRIPT, i); //parse scriptnames
|
||||
if(name != myname) //not my name then continue
|
||||
{
|
||||
//catch states
|
||||
if ( llGetScriptState(name) == TRUE) //not on ignore list & running add it
|
||||
{
|
||||
control_scripts += [name];
|
||||
}
|
||||
else ignore_scripts += [name];
|
||||
}
|
||||
}
|
||||
if (debug) llOwnerSay("Controlling: " + llList2CSV(control_scripts) + "\nIgnoring: " + llList2CSV(ignore_scripts));
|
||||
llSensorRepeat("", NULL_KEY, AGENT, distance, PI, delay); // how far and how often we scan for avatars
|
||||
}
|
||||
|
||||
on_rez(integer s)
|
||||
{
|
||||
if (llGetListLength(control_scripts)== 0 && g_active == TRUE) llResetScript();
|
||||
//first time use or reset only when scripts are still active or they'll be added to the ignorelist
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_OWNER) llResetScript(); // catch new owner
|
||||
if (change & CHANGED_INVENTORY) llResetScript(); // catch new scripts
|
||||
}
|
||||
|
||||
sensor(integer num_detected)
|
||||
{
|
||||
active_scripts(TRUE); //activate the scripts
|
||||
}
|
||||
|
||||
no_sensor() //no-one around? turn off all controlled scripts except myself
|
||||
{
|
||||
active_scripts(FALSE); //deactivate the scripts
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Look for updates at : http://www.outworldz.com/freescripts.plx?ID=1567
|
||||
// __END__
|
||||
|
||||
|
||||
493
Zombies/Scripts/Zombies/Zombies/Zombies/Animator.lsl
Normal file
493
Zombies/Scripts/Zombies/Zombies/Zombies/Animator.lsl
Normal file
@@ -0,0 +1,493 @@
|
||||
// One Script Prim Animation
|
||||
// Playback Script
|
||||
|
||||
// Original Script by: Ferd Frederix
|
||||
// No Spam version by: Gino Rascon
|
||||
|
||||
integer runtime = TRUE;
|
||||
|
||||
string NOTECARD = "Movement"; // the notecard for this script, you can add more than 1 script and notecard, just change this line to match
|
||||
integer playchannel = 1; // the playback channel, this is the channel you use in LinkMessages
|
||||
|
||||
|
||||
integer debug = FALSE; // if set to TRUE, debug info appears
|
||||
|
||||
|
||||
// notecard reading
|
||||
string priorname; // the prior animation name so we can spot differences as we read them in
|
||||
integer iIndexLines; // lines in a card
|
||||
integer inotecardIndex = 0; // notecard counter;
|
||||
integer move = 0; // N movements rea from the notecard
|
||||
|
||||
key kNoteCardLines; // the key of the notecard
|
||||
key kGetIndexLines; // the key of the current line
|
||||
|
||||
//communications
|
||||
integer dialogchannel ; // dialog boxes
|
||||
|
||||
integer nPrims; // total number of prims
|
||||
integer PrimsCounter = 0; // how many have checked in
|
||||
integer timercounter = 0; // how many seconds have gone by
|
||||
integer wantname; // flag indicating we are waiting for a name to be chatted
|
||||
|
||||
|
||||
// the list of coords
|
||||
list masterlist; // master list of all positions
|
||||
list llastPrimList; // storage of the last prim position we learned
|
||||
string curranimation; // what we are playing
|
||||
|
||||
integer STRIDE = 5; // size of the master list
|
||||
integer lastSTRIDE = 4; // size of the last prim list
|
||||
|
||||
integer listener; // temp listener when we are waiting for them to give us a name
|
||||
|
||||
vector InitSize; // the initial size when the prims were recorded
|
||||
list LoadedAnims; // animations read from the notecard added to the Menu display
|
||||
|
||||
// in case of hand editing, we wupe out extra stuff at end
|
||||
string Getline(list Input, integer line)
|
||||
{
|
||||
return llStringTrim(llList2String(Input, line),STRING_TRIM);
|
||||
}
|
||||
|
||||
Record()
|
||||
{
|
||||
if (llStringLength(curranimation) > 0)
|
||||
{
|
||||
integer foundmovement = 0; // will be set if any child moved
|
||||
integer PrimCounter ; // skip past the root prim
|
||||
for (PrimCounter =2; PrimCounter <= nPrims; PrimCounter++ )
|
||||
{
|
||||
list my_list = llGetLinkPrimitiveParams(PrimCounter,[PRIM_POSITION,PRIM_ROTATION, PRIM_SIZE ]);
|
||||
// position is always in region coordinates, even if the prim is a child or the root prim of an attachment.
|
||||
// rot is always the global rotation, even if the prim is a child or the root prim of an attachment.
|
||||
|
||||
// get current prim pos, rot and size
|
||||
vector vrealPrimPos = llList2Vector (my_list,0) - llGetPos(); // position subtract Global Pos
|
||||
vrealPrimPos /= llGetRot();
|
||||
rotation rrealPrimRot = llList2Rot (my_list,1) / llGetRot(); // rotation subtract Global Rot
|
||||
vector vrealPrimSize = llList2Vector (my_list,2); // size
|
||||
|
||||
// compare it to the last one we had, stride of list is a 4, and it is already sorted
|
||||
integer iindex = (PrimCounter - 2) * lastSTRIDE; // zeroth position is PrimCounter - start, or 2
|
||||
|
||||
// get the last thing we remembered about this prim
|
||||
float fprimNum = llList2Integer (llastPrimList, iindex); // must be 0,1,2, in order
|
||||
vector vlastPrimPos = llList2Vector (llastPrimList, iindex+1);
|
||||
rotation rlastPrimRot = llList2Rot (llastPrimList, iindex+2);
|
||||
vector vlastPrimSize = llList2Vector (llastPrimList, iindex+3);
|
||||
|
||||
// if anything changed on this prim, we must record it.
|
||||
if (vlastPrimPos != vrealPrimPos ||
|
||||
rlastPrimRot != rrealPrimRot ||
|
||||
vlastPrimSize!= vrealPrimSize
|
||||
)
|
||||
{
|
||||
foundmovement++;
|
||||
|
||||
// show owner any changes they mnade
|
||||
if (debug)
|
||||
{
|
||||
llOwnerSay("prim:" + (string) PrimCounter);
|
||||
|
||||
if (vlastPrimPos != vrealPrimPos)
|
||||
llOwnerSay("pos delta :" + (string) (vrealPrimPos - vlastPrimPos));
|
||||
|
||||
if (rlastPrimRot != rrealPrimRot)
|
||||
llOwnerSay("rot delta:" + (string) (llRot2Euler (rrealPrimRot - rlastPrimRot) * RAD_TO_DEG));
|
||||
|
||||
if (vlastPrimSize != vrealPrimSize)
|
||||
llOwnerSay("size delta:" + (string) (vrealPrimSize - vlastPrimSize));
|
||||
}
|
||||
|
||||
//Save them in the master list of all animations
|
||||
masterlist += curranimation;
|
||||
masterlist += PrimCounter;
|
||||
masterlist += vrealPrimPos;
|
||||
masterlist += rrealPrimRot;
|
||||
masterlist += vrealPrimSize;
|
||||
|
||||
// save them in the last movement list
|
||||
integer saved = FALSE;
|
||||
integer i;
|
||||
integer imax = llGetListLength(llastPrimList);
|
||||
// save the changes in the last prim list so we can keep our lists smaller
|
||||
for ( i=0; i < imax; i += lastSTRIDE )
|
||||
{
|
||||
if (llList2Float(llastPrimList,i) == PrimCounter)
|
||||
{
|
||||
llastPrimList = llListReplaceList(llastPrimList,[vrealPrimPos],i+1,i+1);
|
||||
llastPrimList = llListReplaceList(llastPrimList,[rrealPrimRot],i+2,i+2);
|
||||
llastPrimList = llListReplaceList(llastPrimList,[vrealPrimSize],i+3,i+3);
|
||||
if (debug) llOwnerSay("In history at position " + (string) (i/lastSTRIDE));
|
||||
saved++;
|
||||
}
|
||||
}
|
||||
|
||||
// never moved before? add it then
|
||||
if (! saved)
|
||||
{
|
||||
if (debug) llOwnerSay("Someone added a new prim and then clicked Record");
|
||||
llastPrimList += PrimCounter;
|
||||
llastPrimList += vrealPrimPos;
|
||||
llastPrimList += rrealPrimRot;
|
||||
llastPrimList += vrealPrimSize;
|
||||
}
|
||||
} // if
|
||||
} // for
|
||||
if (debug) llOwnerSay("history:" + llDumpList2String(llastPrimList,":"));
|
||||
|
||||
if (!foundmovement)
|
||||
llOwnerSay("You must move at least one child prim.");
|
||||
}
|
||||
else
|
||||
{
|
||||
llOwnerSay("You must name your animation.");
|
||||
llOwnerSay("Type the new animation name on channel /" + (string) dialogchannel);
|
||||
wantname++;
|
||||
}
|
||||
}
|
||||
|
||||
// on reset, record the base position in history so we can see changes
|
||||
Clear()
|
||||
{
|
||||
LoadedAnims = []; // wipe out Menu
|
||||
masterlist = []; // wipe all recordings
|
||||
llastPrimList = []; // wipe last animations
|
||||
integer PrimCounter ; // skip 1, which is the root prim
|
||||
integer counter = 0;
|
||||
// save all the current settings in memory
|
||||
for (PrimCounter=2; PrimCounter <= nPrims; PrimCounter++ )
|
||||
{
|
||||
list my_list = llGetLinkPrimitiveParams(PrimCounter,[PRIM_POSITION,PRIM_ROTATION, PRIM_SIZE ]);
|
||||
|
||||
// save the local pos and rot, since llGetLinkPrimitiveParams returns global pos and rot
|
||||
vector primpos = llList2Vector (my_list,0) - llGetPos();
|
||||
rotation primrot = llList2Rot (my_list,1) / llGetRot();
|
||||
vector primsize = llList2Vector (my_list,2) ;
|
||||
|
||||
llastPrimList += PrimCounter;
|
||||
llastPrimList += primpos;
|
||||
llastPrimList += primrot;
|
||||
llastPrimList += primsize;
|
||||
counter++;
|
||||
}
|
||||
if(debug) llOwnerSay("Saved " + (string) counter + " prims initial position in history");
|
||||
}
|
||||
|
||||
DumpBack ()
|
||||
{
|
||||
integer i;
|
||||
integer imax = llGetListLength(masterlist);
|
||||
integer howmany = imax / STRIDE ;
|
||||
llOwnerSay((string) howmany + " movements recorded - copy these and paste them into the notecard");
|
||||
|
||||
integer flag = 0;
|
||||
for (i = 0; i < imax; i+= STRIDE)
|
||||
{
|
||||
if ( i == 0 )
|
||||
llOwnerSay( "|start|" + (string) llGetScale());
|
||||
|
||||
string saniName = llList2String(masterlist,i);
|
||||
curranimation = saniName;
|
||||
|
||||
float fprimNum = llList2Integer(masterlist, i+1);
|
||||
integer iprimNum = (integer) fprimNum;
|
||||
vector vprimPos = llList2Vector(masterlist, i+2);
|
||||
rotation rprimRot = llList2Rot(masterlist, i+3) ;
|
||||
vector vprimSize = llList2Vector(masterlist, i+4);
|
||||
|
||||
llOwnerSay("|"+ saniName + "|" + (string) iprimNum + "|" + (string) vprimPos + "|" + (string) rprimRot + "|" + (string) vprimSize );
|
||||
flag++;
|
||||
}
|
||||
if (! flag)
|
||||
llOwnerSay("No recording was made, nothing to play back." );
|
||||
}
|
||||
|
||||
|
||||
rotation calcChildRot(rotation rdeltaRot)
|
||||
{
|
||||
|
||||
if (llGetAttached())
|
||||
return rdeltaRot/llGetLocalRot();
|
||||
else
|
||||
return rdeltaRot/llGetRootRotation();
|
||||
|
||||
}
|
||||
|
||||
|
||||
PlayBack (string name)
|
||||
{
|
||||
integer i;
|
||||
integer imax = llGetListLength(masterlist);
|
||||
|
||||
integer linknum = 0;
|
||||
|
||||
for (i = 0; i < imax; i+= STRIDE)
|
||||
{
|
||||
string saniName = llList2String(masterlist,i);
|
||||
if (saniName == name)
|
||||
{
|
||||
float fprimNum = llList2Float(masterlist,i+1);
|
||||
vector vPos = llList2Vector(masterlist,i+2);
|
||||
rotation rRot = llList2Rot(masterlist,i+3) ;
|
||||
vector vprimSize = llList2Vector(masterlist,i+4) ;
|
||||
|
||||
vector scale = llGetScale();
|
||||
float delta = scale.x / InitSize.x ; // see if the root prim has grown or shrunk as a percentage
|
||||
|
||||
vPos *= delta; // add any difference in size to it positions there
|
||||
vprimSize *= delta; // grow the child prim, too
|
||||
|
||||
|
||||
// support negative prim numbers as a delay
|
||||
if (fprimNum < 0)
|
||||
{
|
||||
if (debug) llOwnerSay("Sleeping " + (string) (fprimNum * -1));
|
||||
llSleep((float) fprimNum * -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fprimNum > 1 )
|
||||
{
|
||||
// set the local pos and locat rot to the prims orientation and position
|
||||
rRot = calcChildRot(rRot);
|
||||
|
||||
list actions = [PRIM_POSITION,vPos,PRIM_ROTATION,rRot,PRIM_SIZE,vprimSize];
|
||||
if (debug) llOwnerSay("Moving prim :" + (string) fprimNum + ":" + llDumpList2String(actions,":"));
|
||||
|
||||
llSetLinkPrimitiveParamsFast((integer) fprimNum,actions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MakeMenu()
|
||||
{
|
||||
|
||||
while (llGetListLength(LoadedAnims) > 6)
|
||||
LoadedAnims = llDeleteSubList(LoadedAnims,0,0);
|
||||
|
||||
list amenu = ["Reset","Record","Help","Name","Notecard","Pause"] + LoadedAnims;
|
||||
|
||||
llListenRemove(listener);
|
||||
listener = llListen(dialogchannel,"","","");
|
||||
|
||||
|
||||
llDialog(llGetOwner(), "Pick a command",amenu,dialogchannel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
InitSize = llGetScale(); // save the size when we recorded the prims
|
||||
nPrims = llGetNumberOfPrims(); // how many we are recording
|
||||
if (debug) llOwnerSay(" Total Prims = " + (string) nPrims);
|
||||
Clear();
|
||||
|
||||
string notecardname = llGetInventoryName(INVENTORY_NOTECARD,0);
|
||||
|
||||
if (llStringLength(notecardname) > 0)
|
||||
{
|
||||
kNoteCardLines = llGetNumberOfNotecardLines(NOTECARD);
|
||||
kGetIndexLines = llGetNotecardLine(NOTECARD,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
llOwnerSay("If you add a notecard, you can save your animations permanently in a notecard named " + NOTECARD);
|
||||
}
|
||||
dialogchannel = (integer) (llFrand(100) +600);
|
||||
|
||||
}
|
||||
|
||||
// read notecard on bootup
|
||||
dataserver(key queryid, string data)
|
||||
{
|
||||
if (queryid == kNoteCardLines)
|
||||
{
|
||||
iIndexLines = (integer) data;
|
||||
}
|
||||
|
||||
if (queryid == kGetIndexLines)
|
||||
{
|
||||
if (data != EOF)
|
||||
{
|
||||
queryid = llGetNotecardLine(NOTECARD, inotecardIndex);
|
||||
list lLine = (llParseString2List(data, ["|"], []));
|
||||
|
||||
string junk = llList2String(lLine,0);
|
||||
string aniname = llList2String(lLine,1);
|
||||
string aNum = (string) Getline(lLine,2);
|
||||
|
||||
// check for the prim size,and save it, the fiorst line will look like this:
|
||||
// [18:06] prim position 1.2: |start|<1.02306, 1.02306, 1.02306>
|
||||
|
||||
if (inotecardIndex == 0 && aniname == "start")
|
||||
{
|
||||
InitSize = (vector) aNum;
|
||||
}
|
||||
else if (inotecardIndex == 0 && aniname != "start")
|
||||
{
|
||||
llOwnerSay("The notecard " + NOTECARD + " is incorrect, it must begin with 'start|<x,y,z>' with the size of the original prim");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
float Num = (float) aNum;
|
||||
|
||||
vector vPos = (vector) Getline(lLine,3); // global for calcChild()
|
||||
rotation rRot = (rotation) Getline(lLine,4); // global for calcChild()
|
||||
vector Size = (vector) Getline(lLine,5);
|
||||
|
||||
vector scale = llGetScale();
|
||||
float delta = scale.x / InitSize.x ; // see if the root prim has grown or shrunk as a percentage
|
||||
|
||||
|
||||
if (aniname != priorname)
|
||||
{
|
||||
llOwnerSay("Loading animation " + aniname);
|
||||
priorname = aniname;
|
||||
LoadedAnims += aniname;
|
||||
}
|
||||
|
||||
if(Num != 1) // skip root prim
|
||||
{
|
||||
masterlist += [aniname];
|
||||
masterlist += [Num];
|
||||
masterlist += [vPos];
|
||||
masterlist += [rRot];
|
||||
masterlist += [Size];
|
||||
|
||||
if (Num > 1) // not the pauses
|
||||
{
|
||||
rRot = calcChildRot(rRot);
|
||||
vPos *= delta; // add any difference in size to it positions there
|
||||
Size *= delta; // grow the child prim, too
|
||||
|
||||
llSetLinkPrimitiveParamsFast((integer) Num,[PRIM_POSITION,vPos,PRIM_ROTATION,rRot,PRIM_SIZE,Size]);
|
||||
move++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
inotecardIndex++;
|
||||
integer InitPerCent = (integer) llRound(( (inotecardIndex+1) / (float) iIndexLines) * 100);
|
||||
llSetText("Initialising... \n" + (string) InitPerCent + "%" , <1,1,1>, 1.0);
|
||||
if (InitPerCent >= 100)
|
||||
llSetText("" , <1,1,1>, 1.0);
|
||||
kGetIndexLines = llGetNotecardLine(NOTECARD,inotecardIndex);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
llOwnerSay("initialized with " + (string) move + " movements");
|
||||
llSetText("" , <1,1,1>, 1.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
touch_start(integer total_number)
|
||||
{
|
||||
if (llDetectedKey(0) == llGetOwner() && ! runtime)
|
||||
{
|
||||
MakeMenu();
|
||||
}
|
||||
|
||||
// add any control code here
|
||||
// example:
|
||||
// llMessageLinked(LINK_SET,playchannel,"All",""); // will play Animation named "All"
|
||||
|
||||
}
|
||||
|
||||
listen( integer channel, string name, key id, string message )
|
||||
{
|
||||
|
||||
if (channel == dialogchannel)
|
||||
{
|
||||
if (message == "Reset")
|
||||
{
|
||||
Clear();
|
||||
if (debug) llOwnerSay("Reset = " + llDumpList2String(llastPrimList,":"));
|
||||
MakeMenu();
|
||||
}
|
||||
else if (message =="Pause")
|
||||
{
|
||||
masterlist += curranimation;
|
||||
masterlist += -1;
|
||||
masterlist += <0,0,0>; // pos
|
||||
masterlist += <0,0,0,1>;// rot
|
||||
masterlist += <0,0,0>; // size
|
||||
MakeMenu();
|
||||
}
|
||||
else if (message == "Record")
|
||||
{
|
||||
Record();
|
||||
|
||||
MakeMenu();
|
||||
}
|
||||
else if (message == "Name")
|
||||
{
|
||||
llOwnerSay("Type the current animation name on channel /" + (string) dialogchannel);
|
||||
wantname++;
|
||||
MakeMenu();
|
||||
}
|
||||
else if (message =="Menu")
|
||||
{
|
||||
MakeMenu();
|
||||
}
|
||||
else if (message == "Notecard")
|
||||
{
|
||||
DumpBack();
|
||||
MakeMenu();
|
||||
}
|
||||
else if (message == "Help")
|
||||
{
|
||||
llLoadURL(llGetOwner(),"View online help", "http://secondlife.mitsi.com/secondlife/Posts/Prim-Animator");
|
||||
}
|
||||
else if (wantname)
|
||||
{
|
||||
curranimation = message;
|
||||
|
||||
LoadedAnims += message;
|
||||
|
||||
MakeMenu();
|
||||
llOwnerSay("Recording is ready for animation '" + curranimation + "'");
|
||||
llOwnerSay("Position all child prims, then select the Menu item 'Record', and repeat as necessary. When finished, click 'PlayBack' to play back the animation, or click the animation name. Click 'Name' to start a new animation sequence");
|
||||
wantname = 0;
|
||||
PrimsCounter = 0;
|
||||
timercounter = 0;
|
||||
llSetTimerEvent(1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (llListFindList(LoadedAnims,[message]) != -1)
|
||||
{
|
||||
PlayBack(message);
|
||||
MakeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
link_message(integer sender_num, integer num, string message, key id)
|
||||
{
|
||||
if (num == playchannel)
|
||||
{
|
||||
if (debug) llOwnerSay("playback animation " + message);
|
||||
PlayBack(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
90
Zombies/Scripts/Zombies/Zombies/Zombies/Movement
Normal file
90
Zombies/Scripts/Zombies/Zombies/Zombies/Movement
Normal file
@@ -0,0 +1,90 @@
|
||||
[20:01] Headless Zombie: |start|<1.56849, 1.56849, 0.12242>
|
||||
[20:01] Headless Zombie: |stand|2|<0.20512, -0.08922, 0.43042>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.30070, 0.78688, 0.37892>
|
||||
[20:01] Headless Zombie: |stand|3|<-0.40200, 0.40474, 0.43024>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.31500, 0.69428, 0.46512>
|
||||
[20:01] Headless Zombie: |stand|4|<0.40767, -0.08369, -0.04858>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |stand|5|<0.20300, 0.01529, 2.82825>|<0.41936, 0.56207, 0.43079, 0.56801>|<0.39032, 0.50817, 0.40393>
|
||||
[20:01] Headless Zombie: |stand|6|<0.20377, -0.31506, 2.03644>|<0.70643, 0.70643, 0.03102, 0.03102>|<0.20020, 0.35246, 0.67896>
|
||||
[20:01] Headless Zombie: |stand|7|<0.28810, 0.73927, 1.80371>|<0.69728, 0.63816, 0.32054, 0.06172>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |stand|8|<-0.39481, 0.42827, -0.04858>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |stand|9|<0.21972, 0.58127, 2.04114>|<0.69728, 0.63816, 0.32054, 0.06172>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |stand|10|<0.54025, -0.22897, 1.35584>|<0.70643, 0.70643, 0.03102, 0.03102>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |stand|11|<0.10977, -0.07448, 1.00568>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.32772, 0.73561, 0.60303>
|
||||
[20:01] Headless Zombie: |stand|12|<0.43582, -0.29620, 1.61639>|<0.70643, 0.70643, 0.03102, 0.03102>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |stand|13|<-0.02763, 0.10616, 1.92419>|<0.44017, 0.44017, 0.55340, 0.55340>|<0.91588, 1.39186, 1.14379>
|
||||
[20:01] Headless Zombie: |stand|14|<-0.20174, 0.27513, 1.11774>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.40852, 0.93804, 0.34644>
|
||||
[20:01] Headless Zombie: |left|2|<-0.05631, -0.08922, 0.43042>|<0.56099, 0.56099, 0.43046, 0.43046>|<0.30070, 0.78688, 0.37892>
|
||||
[20:01] Headless Zombie: |left|3|<-0.05157, 0.40474, 0.43024>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.31500, 0.69428, 0.46512>
|
||||
[20:01] Headless Zombie: |left|4|<0.01536, -0.08369, -0.08466>|<0.56099, 0.56099, 0.43046, 0.43046>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |left|5|<0.25730, -0.02963, 2.73676>|<0.58952, 0.56121, 0.42169, 0.39963>|<0.39032, 0.50817, 0.40393>
|
||||
[20:01] Headless Zombie: |left|6|<0.38512, -0.31506, 2.13696>|<0.66650, 0.66650, 0.23618, 0.23618>|<0.20020, 0.35246, 0.67896>
|
||||
[20:01] Headless Zombie: |left|7|<0.75589, 0.51143, 2.24616>|<0.61557, 0.38459, 0.47678, 0.49583>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |left|8|<-0.04438, 0.42827, -0.04858>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |left|9|<0.47630, 0.50461, 2.33441>|<0.61557, 0.38459, 0.47678, 0.49583>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |left|10|<1.04467, -0.22897, 1.76086>|<0.66650, 0.66650, 0.23618, 0.23618>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |left|11|<-0.02557, -0.07448, 1.00568>|<0.57206, 0.57206, 0.41563, 0.41563>|<0.32772, 0.73561, 0.60303>
|
||||
[20:01] Headless Zombie: |left|12|<0.81239, -0.29620, 1.91846>|<0.66650, 0.66650, 0.23618, 0.23618>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |left|13|<-0.00626, 0.10616, 1.92419>|<0.44017, 0.44017, 0.55340, 0.55340>|<0.91588, 1.39186, 1.14379>
|
||||
[20:01] Headless Zombie: |left|14|<-0.08570, 0.27513, 1.11774>|<0.35355, 0.35355, 0.61237, 0.61237>|<0.40852, 0.93804, 0.34644>
|
||||
[20:01] Headless Zombie: |right|2|<0.20512, -0.08922, 0.43042>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.30070, 0.78688, 0.37892>
|
||||
[20:01] Headless Zombie: |right|3|<-0.40200, 0.40474, 0.43024>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.31500, 0.69428, 0.46512>
|
||||
[20:01] Headless Zombie: |right|4|<0.40767, -0.08369, -0.04858>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |right|5|<0.31050, 0.01529, 2.72961>|<0.54923, 0.42094, 0.42921, 0.58047>|<0.39032, 0.50817, 0.40393>
|
||||
[20:01] Headless Zombie: |right|6|<0.35924, -0.31506, 2.18445>|<0.62997, 0.62997, 0.32115, 0.32115>|<0.20020, 0.35246, 0.67896>
|
||||
[20:01] Headless Zombie: |right|7|<0.70110, 0.49094, 1.97345>|<0.63805, 0.62952, 0.29043, 0.33504>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |right|8|<-0.39481, 0.42827, -0.04858>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |right|9|<0.53569, 0.49240, 2.21515>|<0.61990, 0.63845, 0.21835, 0.40053>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |right|10|<1.09365, -0.22495, 1.99188>|<0.66854, 0.57916, 0.40568, 0.23033>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |right|11|<0.10977, -0.07448, 1.00568>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.32772, 0.73561, 0.60303>
|
||||
[20:01] Headless Zombie: |right|12|<0.82849, -0.29620, 2.08398>|<0.62997, 0.62997, 0.32115, 0.32115>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |right|13|<-0.02763, 0.10616, 1.92419>|<0.44017, 0.44017, 0.55340, 0.55340>|<0.91588, 1.39186, 1.14379>
|
||||
[20:01] Headless Zombie: |right|14|<-0.20174, 0.27513, 1.11774>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.40852, 0.93804, 0.34644>
|
||||
[20:01] Headless Zombie: |hit|5|<-0.56627, 0.01529, 2.80798>|<0.27973, 0.37762, 0.53215, 0.70425>|<0.39032, 0.50817, 0.40393>
|
||||
[20:01] Headless Zombie: |hit|6|<-0.13437, -0.31506, 2.14435>|<0.66853, 0.66853, 0.23035, 0.23035>|<0.20020, 0.35246, 0.67896>
|
||||
[20:01] Headless Zombie: |hit|7|<0.06311, 0.73927, 1.99512>|<0.57753, 0.59435, 0.50536, 0.24043>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |hit|9|<-0.12355, 0.58127, 2.15698>|<0.57753, 0.59435, 0.50536, 0.24043>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |hit|10|<0.51851, -0.22897, 1.75684>|<0.66853, 0.66853, 0.23035, 0.23035>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |hit|12|<0.28902, -0.29620, 1.91846>|<0.66853, 0.66853, 0.23035, 0.23035>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |hit|13|<-0.26730, 0.10616, 1.92419>|<0.26485, 0.26485, 0.65563, 0.65563>|<0.91588, 1.39186, 1.14379>
|
||||
[20:01] Headless Zombie: |bighit|5|<-0.99889, 0.01529, 2.56751>|<0.20294, 0.27593, 0.56589, 0.74996>|<0.39032, 0.50817, 0.40393>
|
||||
[20:01] Headless Zombie: |bighit|6|<-0.54309, -0.31506, 2.35162>|<0.28525, 0.06369, 0.69581, 0.65607>|<0.20020, 0.35246, 0.67896>
|
||||
[20:01] Headless Zombie: |bighit|7|<-0.45900, 0.60919, 2.90985>|<-0.00029, 0.00629, 0.76351, 0.64577>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |bighit|9|<-0.53775, 0.53465, 2.63733>|<-0.00029, 0.00629, 0.76351, 0.64577>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |bighit|10|<-0.44268, -0.47151, 3.09277>|<0.28525, 0.06369, 0.69581, 0.65607>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |bighit|12|<-0.50218, -0.44795, 2.81128>|<0.28525, 0.06369, 0.69581, 0.65607>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |bighit|13|<-0.46790, 0.10616, 1.80035>|<0.17104, 0.17104, 0.68611, 0.68611>|<0.91588, 1.39186, 1.14379>
|
||||
[20:01] Headless Zombie: |attack|2|<-0.05631, -0.08922, 0.43042>|<0.56099, 0.56099, 0.43046, 0.43046>|<0.30070, 0.78688, 0.37892>
|
||||
[20:01] Headless Zombie: |attack|3|<-0.05157, 0.40474, 0.43024>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.31500, 0.69428, 0.46512>
|
||||
[20:01] Headless Zombie: |attack|4|<0.01536, -0.08369, -0.08466>|<0.56099, 0.56099, 0.43046, 0.43046>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |attack|5|<0.25730, -0.02963, 2.73676>|<0.58952, 0.56121, 0.42169, 0.39963>|<0.39032, 0.50817, 0.40393>
|
||||
[20:01] Headless Zombie: |attack|6|<0.52367, -0.26059, 2.13696>|<0.46415, 0.82038, 0.29069, 0.16446>|<0.20020, 0.35246, 0.67896>
|
||||
[20:01] Headless Zombie: |attack|7|<0.70318, 0.51143, 2.00696>|<0.71264, 0.49311, 0.31370, 0.38806>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |attack|8|<-0.04438, 0.42827, -0.04858>|<0.50000, 0.50000, 0.50000, 0.50000>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |attack|9|<0.49775, 0.50461, 2.21613>|<0.71264, 0.49311, 0.31370, 0.38806>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |attack|10|<1.04467, 0.15289, 1.76086>|<0.46415, 0.82038, 0.29069, 0.16446>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |attack|11|<-0.02557, -0.07448, 1.00568>|<0.57206, 0.57206, 0.41563, 0.41563>|<0.32772, 0.73561, 0.60303>
|
||||
[20:01] Headless Zombie: |attack|12|<0.88019, -0.02437, 1.91846>|<0.46415, 0.82038, 0.29069, 0.16446>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |attack|13|<-0.00626, 0.10616, 1.92419>|<0.44017, 0.44017, 0.55340, 0.55340>|<0.91588, 1.39186, 1.14379>
|
||||
[20:01] Headless Zombie: |attack|14|<-0.08570, 0.27513, 1.11774>|<0.35355, 0.35355, 0.61237, 0.61237>|<0.40852, 0.93804, 0.34644>
|
||||
[20:01] Headless Zombie: |attack|7|<0.70318, 0.32146, 2.00696>|<0.81340, 0.29897, 0.20653, 0.45425>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |attack|9|<0.52020, 0.41508, 2.21613>|<0.81340, 0.29897, 0.20653, 0.45425>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |attack|10|<0.77776, 0.15289, 1.60419>|<-0.53748, -0.82483, -0.10503, 0.14047>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |attack|12|<0.76099, -0.02437, 1.83136>|<-0.53748, -0.82483, -0.10503, 0.14047>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |attack|-1|<0.00000, 0.00000, 0.00000>|<0.00000, 0.00000, 0.00000, 1.00000>|<0.00000, 0.00000, 0.00000>
|
||||
[20:01] Headless Zombie: |attack|6|<0.44720, -0.29334, 2.29028>|<0.35020, 0.70759, 0.24398, 0.56316>|<0.20020, 0.35246, 0.67896>
|
||||
[20:01] Headless Zombie: |attack|7|<0.45404, 0.51031, 2.86304>|<0.12909, 0.02860, 0.74605, 0.65263>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |attack|9|<0.31321, 0.47496, 2.60828>|<0.12909, 0.02860, 0.74605, 0.65263>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |attack|10|<1.14336, -0.15526, 2.33991>|<0.45439, 0.60127, 0.32989, 0.56848>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |attack|12|<0.86126, -0.21498, 2.32806>|<0.45439, 0.60127, 0.32989, 0.56848>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |die|2|<0.42173, -0.83373, 0.01373>|<0.05779, 0.05779, 0.70474, 0.70474>|<0.30070, 0.78688, 0.37892>
|
||||
[20:01] Headless Zombie: |die|3|<-0.30402, 1.00839, 0.01849>|<-0.03470, -0.03470, 0.70626, 0.70626>|<0.31500, 0.69428, 0.46512>
|
||||
[20:01] Headless Zombie: |die|4|<1.57024, -1.35127, 0.07721>|<0.30996, 0.51586, 0.68456, 0.41133>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |die|5|<1.27229, 0.57402, 0.10394>|<0.24287, 0.43766, 0.74480, 0.44130>|<0.39032, 0.50817, 0.40393>
|
||||
[20:01] Headless Zombie: |die|6|<0.29710, -0.24297, 0.12860>|<-0.45891, 0.39457, -0.61948, 0.49997>|<0.20020, 0.35246, 0.67896>
|
||||
[20:01] Headless Zombie: |die|7|<1.12733, 1.11397, 0.10431>|<-0.24762, -0.60960, 0.72874, 0.18979>|<0.20500, 0.27784, 0.54512>
|
||||
[20:01] Headless Zombie: |die|8|<-0.04438, 1.94180, 0.11328>|<0.23604, 0.66655, 0.66655, 0.23604>|<0.22762, 0.41816, 0.53320>
|
||||
[20:01] Headless Zombie: |die|9|<1.39467, 1.44247, -0.01086>|<-0.17338, -0.71066, 0.66739, 0.13959>|<0.28850, 0.21422, 0.69655>
|
||||
[20:01] Headless Zombie: |die|10|<1.00000, -0.30670, 0.03864>|<-0.44124, 0.45032, -0.49243, 0.60003>|<0.27554, 0.35836, 0.60891>
|
||||
[20:01] Headless Zombie: |die|11|<-1.18901, -1.31401, -0.00787>|<-0.08676, 0.38151, 0.83007, 0.39737>|<0.32772, 0.73561, 0.60303>
|
||||
[20:01] Headless Zombie: |die|12|<0.71497, -0.27359, 0.06970>|<-0.44124, 0.45032, -0.49243, 0.60003>|<0.21066, 0.38145, 0.48834>
|
||||
[20:01] Headless Zombie: |die|13|<-1.54277, -0.63835, -0.03906>|<-0.02404, -0.19970, 0.86404, 0.46150>|<0.91588, 1.39186, 1.14379>
|
||||
[20:01] Headless Zombie: |die|14|<-1.50000, 0.12369, -0.07874>|<-0.00083, 0.03169, -0.99916, 0.02613>|<0.40852, 0.93804, 0.34644>
|
||||
38
Zombies/Scripts/Zombies/Zombies/Zombies/Notecard.txt
Normal file
38
Zombies/Scripts/Zombies/Zombies/Zombies/Notecard.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
// 5-6-2012
|
||||
|
||||
// For JodyLDexler Resident & Klatu Resident
|
||||
|
||||
|
||||
I have a 'zombie' I made for you out of some leftover bits that should be a good start to being zombied.
|
||||
|
||||
It has the following animations:
|
||||
|
||||
// stand - just standing there
|
||||
// attack - it does this when it reaches a random spot
|
||||
// left - left foot forward
|
||||
// right - right foot forward
|
||||
// hit - when someone touches it, this happens
|
||||
// bighit - and then this
|
||||
|
||||
Just rez it and touch it. A short animation 'diagnostic' will run to show you the moves.
|
||||
|
||||
It will walk around and roar and wave arms a bit. It wanders within 10 meters of one spot, you can click it to change the range.se drives around the land and over obstacles. You probably should set your zombiues to phantokm so thay can pass thru objects. I prefer mine non-phantom so they bump into things and push people. The downside is that they can get stuck. If stuck, they 'step on the gas', until they lag walk thru the object, usually with an overshoot than can shoot them off the sim, Oh well, They are dead, after all.
|
||||
|
||||
It also has an ability for you to sit on it, i.e., ride on its back and drive it around. When you hop off, they walk back to home ( and can get stuck again). I lose lots of zombies that way.
|
||||
|
||||
You can use the scripts to make your own zombies. They are nothing more than a base, flat prim with something attached and animated. There are no other scripts in them.
|
||||
|
||||
Do not reuse the notecard "Movement' from this zombie in your zombies. Use a blank notecard called 'Movement'. Blank out the contents or it will destroy your new creation! It is specific to each prim set size, position, and rotation. You can animate any part of the animal except the base, that b.
|
||||
|
||||
There is a help menu for how to make your own animations on my website in the help link in the menu.
|
||||
|
||||
Regards
|
||||
|
||||
Ferd Frederix
|
||||
aka Fred Beckhusen
|
||||
fred@mitsi.com
|
||||
|
||||
Best way to reach me is via email
|
||||
|
||||
|
||||
|
||||
51
Zombies/Scripts/Zombies/Zombies/Zombies/pose ball.lsl
Normal file
51
Zombies/Scripts/Zombies/Zombies/Zombies/pose ball.lsl
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
// Send a link message to another script when sat on or unsat
|
||||
// will play back the first animation it finds in inventory
|
||||
|
||||
// position to sit on the ball e.g <0.0, 0.0, 0.43>
|
||||
// sit 1.7 metes above the base., slight backwards
|
||||
vector POSITION=<0.6, 0.0,1.7>;
|
||||
|
||||
// Just code below here
|
||||
|
||||
string animation;
|
||||
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSetSitText("Ride Me");
|
||||
llSitTarget(POSITION, ZERO_ROTATION);
|
||||
}
|
||||
|
||||
changed(integer change)
|
||||
{
|
||||
if (change & CHANGED_LINK)
|
||||
{
|
||||
if (llAvatarOnSitTarget() != NULL_KEY)
|
||||
{
|
||||
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
|
||||
}
|
||||
else
|
||||
{
|
||||
integer perm=llGetPermissions();
|
||||
if ((perm & PERMISSION_TRIGGER_ANIMATION) && llStringLength(animation)>0)
|
||||
llStopAnimation(animation);
|
||||
animation="";
|
||||
llMessageLinked(LINK_SET,2,"unsit",llAvatarOnSitTarget());
|
||||
}
|
||||
}
|
||||
}
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if (perm & PERMISSION_TRIGGER_ANIMATION)
|
||||
{
|
||||
llStopAnimation("sit");
|
||||
animation=llGetInventoryName(INVENTORY_ANIMATION,0);
|
||||
llStartAnimation(animation);
|
||||
llMessageLinked(LINK_SET,2,"sit",llAvatarOnSitTarget()); // left foot forward
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
435
Zombies/Scripts/Zombies/Zombies/Zombies/walk script.lsl
Normal file
435
Zombies/Scripts/Zombies/Zombies/Zombies/walk script.lsl
Normal file
@@ -0,0 +1,435 @@
|
||||
// Animated wandering animal script.
|
||||
// by Ferd Frederix
|
||||
// Sets Home point where rezzed.
|
||||
// Will drive around like a vehicle so it works on most surfaces.
|
||||
|
||||
// Requires prim anmiation for the following movements:
|
||||
|
||||
// stand Just standing there, every prim reset to a start position
|
||||
// attack Arm waving, whetever it needs to do when it reaches a waypoint
|
||||
// left Left foot foward
|
||||
// right ditto
|
||||
// hit when clicked, play this
|
||||
// bighit and then this
|
||||
// die fall to pieces
|
||||
|
||||
|
||||
// Sounds:
|
||||
// footstepmuffled when walking
|
||||
// Zdeath when clicked
|
||||
// Monster2 and Monster1 sounds when it reaches a destination
|
||||
|
||||
// Some tunables:
|
||||
|
||||
integer debug = FALSE;
|
||||
|
||||
float forward_power = 3; //Power used to go forward (1 to 30), massive objects may need larger number
|
||||
float reverse_power = -2; //Power ued to go reverse (-1 to -30)
|
||||
float turning_ratio = .5; //How sharply the vehicle turns. Le
|
||||
vector start_pos; // home point
|
||||
|
||||
vector Destination; // we head thataway
|
||||
float roam_range = 10; // and go no furtherfrom home than this
|
||||
float STRENGTH = 4.0; // how hard to turn, bigger = ?
|
||||
float DAMPING = 0.2; // and how soon
|
||||
vector direction = <6,0,0>; // push 3
|
||||
vector last_pos = <0,0,0>; // save last position so we can detect when to walk
|
||||
vector curpos; // you are here
|
||||
list buttons = ["Range","Home","Help"];
|
||||
integer listener; // handle for menus to use
|
||||
key Owner; // you
|
||||
integer channel; // random channel for listener
|
||||
integer counter = 0; // l-r walk counter
|
||||
key agent ;
|
||||
float FORCE = 1; // bigger numbers make us move faster
|
||||
integer timeout; // give us the gas if we are late
|
||||
|
||||
|
||||
DEBUG(string str)
|
||||
{
|
||||
if (debug)
|
||||
llOwnerSay(str);
|
||||
}
|
||||
// talk Menu to the client
|
||||
|
||||
tMenu()
|
||||
{
|
||||
channel = llCeil(llFrand(10000) + 876);
|
||||
listener = llListen(channel,"","","");
|
||||
llDialog(Owner,"Choose an item",buttons,channel);
|
||||
}
|
||||
|
||||
// sets up the vehicle as a car
|
||||
Physics()
|
||||
{
|
||||
llSetBuoyancy(0.0);
|
||||
llSetVehicleFlags(-1);
|
||||
llSetVehicleType(VEHICLE_TYPE_CAR);
|
||||
llRemoveVehicleFlags(VEHICLE_FLAG_LIMIT_MOTOR_UP | VEHICLE_FLAG_LIMIT_ROLL_ONLY);
|
||||
llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.8);
|
||||
llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.8);
|
||||
llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, .1);
|
||||
llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_TIMESCALE, .1);
|
||||
llSetVehicleFloatParam(VEHICLE_HOVER_EFFICIENCY, 0.8); // hover for lightnes on massive objects
|
||||
llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, .1);
|
||||
llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, .1);
|
||||
llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, .1);
|
||||
llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, .1);
|
||||
llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <1.0, .1, 1000.0>);
|
||||
llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, <.1, .1, .1>);
|
||||
llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, .8);
|
||||
llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, .1);
|
||||
llSetVehicleFloatParam(VEHICLE_BANKING_EFFICIENCY, 0.25);
|
||||
llSetVehicleFloatParam(VEHICLE_BANKING_TIMESCALE, 0.1);
|
||||
|
||||
}
|
||||
|
||||
// points the animal in the correct diriction and give it a walk-like push
|
||||
DoMove()
|
||||
{
|
||||
llStopLookAt();
|
||||
llPlaySound("footstepmuffled",1.0);
|
||||
llRotLookAt(llRotBetween(<1,0,0>, Destination - llGetPos()), STRENGTH, DAMPING);
|
||||
llSleep(DAMPING*3);
|
||||
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, FORCE * direction);
|
||||
llSleep(0.1);
|
||||
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, ZERO_VECTOR);
|
||||
|
||||
}
|
||||
|
||||
// get a new destination
|
||||
next_move()
|
||||
{
|
||||
// random direction and height // we will ignore Y
|
||||
Destination = llGetPos();
|
||||
Destination.x += llFrand(roam_range *2 ) - roam_range; // +/- roam range
|
||||
Destination.y += llFrand(roam_range *2 ) - roam_range;
|
||||
}
|
||||
|
||||
DoMenu(string msg)
|
||||
{
|
||||
|
||||
if (msg == "Range")
|
||||
{
|
||||
llDialog(Owner,"Range from Home:",["5","10","15","20","25","30","40","50","75"],channel);
|
||||
}
|
||||
else if (msg == "Home")
|
||||
{
|
||||
start_pos = llGetPos(); // remember our home
|
||||
llListenRemove(listener);
|
||||
llOwnerSay("Home is set, wander distance is set to " + (string) roam_range + " meters");
|
||||
}
|
||||
else if (msg == "Help")
|
||||
{
|
||||
llLoadURL(Owner,"Click for Help", "http://secondlife.mitsi.com/Secondlife/Posts/Prim-Animator");
|
||||
llListenRemove(listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
roam_range = (float) msg;
|
||||
llOwnerSay("Range set to " + (string) roam_range + " meters");
|
||||
llListenRemove(listener);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
integer score;
|
||||
|
||||
// startup state where we sit, stand and wag tail
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSetStatus(STATUS_PHYSICS, FALSE);
|
||||
llSetAlpha(0.0,ALL_SIDES);
|
||||
Owner = llGetOwner();
|
||||
llOwnerSay("Range set to " + (string) roam_range + " meters");
|
||||
llOwnerSay("Home set to this spot");
|
||||
llOwnerSay("Click me for help");
|
||||
start_pos = llGetPos(); // remember our home
|
||||
|
||||
state sitting;
|
||||
}
|
||||
}
|
||||
|
||||
state sitting
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSetStatus(STATUS_PHYSICS, FALSE);
|
||||
|
||||
|
||||
llOwnerSay("Animation test");
|
||||
llOwnerSay("stand");
|
||||
llMessageLinked(LINK_SET,1,"stand","");
|
||||
llSleep(1);
|
||||
|
||||
llOwnerSay("attack");
|
||||
llMessageLinked(LINK_SET,1,"attack","");
|
||||
llSleep(1);
|
||||
|
||||
llOwnerSay("walking");
|
||||
llMessageLinked(LINK_SET,1,"stand","");
|
||||
llMessageLinked(LINK_SET,1,"left","");
|
||||
llSleep(0.5);
|
||||
llMessageLinked(LINK_SET,1,"right","");
|
||||
llSleep(0.5);
|
||||
llMessageLinked(LINK_SET,1,"left","");
|
||||
llSleep(0.5);
|
||||
llMessageLinked(LINK_SET,1,"right","");
|
||||
llSleep(0.5);
|
||||
|
||||
|
||||
llOwnerSay("hit");
|
||||
llMessageLinked(LINK_SET,1,"hit","");
|
||||
llSleep(1);
|
||||
|
||||
llOwnerSay("bighit");
|
||||
llMessageLinked(LINK_SET,1,"stand","");
|
||||
llMessageLinked(LINK_SET,1,"bighit","");
|
||||
llSleep(2);
|
||||
llMessageLinked(LINK_SET,1,"die","");
|
||||
llSleep(2);
|
||||
|
||||
llMessageLinked(LINK_SET,1,"stand","");
|
||||
llOwnerSay("Test end");
|
||||
|
||||
state moving;
|
||||
}
|
||||
|
||||
|
||||
|
||||
on_rez(integer p)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// walking around
|
||||
state moving
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
Physics();
|
||||
llMessageLinked(LINK_SET,1,"stand",""); // stand on all 4's
|
||||
llSetStatus(STATUS_PHYSICS, TRUE); // get ready to move
|
||||
llSetTimerEvent(0.5);
|
||||
}
|
||||
|
||||
listen(integer channel,string name, key id, string msg)
|
||||
{
|
||||
DoMenu(msg);
|
||||
}
|
||||
|
||||
touch_start(integer n)
|
||||
{
|
||||
if (llDetectedKey(0) == Owner)
|
||||
tMenu();
|
||||
|
||||
|
||||
if (llFrand(5.0) < 3)
|
||||
{
|
||||
llPlaySound("Zdeath",1.0);
|
||||
llMessageLinked(LINK_SET,1,"hit",""); // smack it
|
||||
score++;
|
||||
}
|
||||
else
|
||||
{
|
||||
llPlaySound("Zdeath",1.0);
|
||||
llMessageLinked(LINK_SET,1,"hit",""); // smack it
|
||||
score+=3;
|
||||
}
|
||||
|
||||
llSleep(1);
|
||||
llMessageLinked(LINK_SET,1,"stand","");
|
||||
|
||||
if (score > 10)
|
||||
{
|
||||
llMessageLinked(LINK_SET,1,"die","");
|
||||
llSleep(20.0);
|
||||
llMessageLinked(LINK_SET,1,"stand","");
|
||||
score = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
timer()
|
||||
{
|
||||
DoMove();
|
||||
|
||||
|
||||
if (llVecDist(last_pos, llGetPos()) > .1)
|
||||
{
|
||||
|
||||
llMessageLinked(LINK_SET,1,"left",""); // left foot forward
|
||||
llSleep(.3);
|
||||
llMessageLinked(LINK_SET,1,"right",""); // right foot forward;
|
||||
last_pos = llGetPos();
|
||||
}
|
||||
|
||||
if (llVecDist(start_pos,llGetPos()) > roam_range + 2)
|
||||
{
|
||||
DEBUG("too far");
|
||||
timeout++;
|
||||
Destination = start_pos;
|
||||
FORCE = timeout /2;
|
||||
llPlaySound("Monster2",1.0);
|
||||
llMessageLinked(LINK_SET,1,"attack","");
|
||||
}
|
||||
else
|
||||
{
|
||||
timeout = 0;
|
||||
FORCE = 1;
|
||||
}
|
||||
|
||||
if (llVecDist(start_pos,llGetPos()) < .5) // at home
|
||||
{
|
||||
DEBUG("at home");
|
||||
llPlaySound("Monster2",1.0);
|
||||
llMessageLinked(LINK_SET,1,"attack","");
|
||||
|
||||
next_move();
|
||||
}
|
||||
vector myPos = llGetPos();
|
||||
|
||||
if (llVecDist(<Destination.x,Destination.y,myPos.z>,myPos) < .5) // at destination in X and Y only
|
||||
{
|
||||
|
||||
DEBUG("at dest");
|
||||
llMessageLinked(LINK_SET,1,"attack","");
|
||||
llPlaySound("Monster1",1.0);
|
||||
llSleep(2);
|
||||
llMessageLinked(LINK_SET,1,"stand","");
|
||||
next_move();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
on_rez(integer p)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
|
||||
link_message(integer sender,integer num,string str, key id)
|
||||
{
|
||||
if (num ==2)
|
||||
{
|
||||
if (str == "sit")
|
||||
{
|
||||
agent = id;
|
||||
state riding;
|
||||
}
|
||||
else
|
||||
{
|
||||
llSleep(.1);
|
||||
llReleaseControls();
|
||||
llMessageLinked(LINK_SET,1,"die","");
|
||||
llSleep(5);
|
||||
llMessageLinked(LINK_SET,1,"stand","");
|
||||
|
||||
|
||||
state moving;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state riding
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
Physics();
|
||||
llWhisper(0,"Use the arrow keys to control the zombie");
|
||||
llSetStatus(STATUS_PHYSICS, TRUE); // get ready to move
|
||||
llStopLookAt();
|
||||
llRequestPermissions(agent, PERMISSION_TAKE_CONTROLS);
|
||||
}
|
||||
run_time_permissions(integer perm)
|
||||
{
|
||||
if (perm)
|
||||
{
|
||||
llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_DOWN | CONTROL_UP | CONTROL_RIGHT |
|
||||
CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE);
|
||||
llSetTimerEvent(.5);
|
||||
}
|
||||
}
|
||||
|
||||
timer()
|
||||
{
|
||||
if (llVecDist(curpos,llGetPos()) > 0.2)
|
||||
{
|
||||
curpos = llGetPos();
|
||||
if (counter++ %2 == 0)
|
||||
llMessageLinked(LINK_SET,1,"left",""); // left foot forward
|
||||
else
|
||||
llMessageLinked(LINK_SET,1,"right",""); // right foot forward
|
||||
}
|
||||
}
|
||||
|
||||
control(key id, integer level, integer edge)
|
||||
{
|
||||
// llOwnerSay((string) edge);
|
||||
integer reverse=1;
|
||||
vector angular_motor;
|
||||
|
||||
//get current speed
|
||||
vector vel = llGetVel();
|
||||
float speed = llVecMag(vel);
|
||||
|
||||
//car controls
|
||||
if(level & CONTROL_FWD)
|
||||
{
|
||||
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <forward_power,0,0> );
|
||||
reverse=1;
|
||||
}
|
||||
if(level & CONTROL_BACK)
|
||||
{
|
||||
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <reverse_power,0,0> );
|
||||
reverse = -1;
|
||||
}
|
||||
|
||||
if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT))
|
||||
{
|
||||
angular_motor.z -= speed / turning_ratio * reverse;
|
||||
}
|
||||
|
||||
if(level & (CONTROL_LEFT|CONTROL_ROT_LEFT))
|
||||
{
|
||||
angular_motor.z += speed / turning_ratio * reverse;
|
||||
}
|
||||
|
||||
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, angular_motor);
|
||||
|
||||
} //end control
|
||||
|
||||
link_message(integer sender,integer num,string str, key id)
|
||||
{
|
||||
if (num ==2)
|
||||
{
|
||||
if (str == "sit")
|
||||
{
|
||||
agent = id;
|
||||
state riding;
|
||||
}
|
||||
else
|
||||
{
|
||||
llSleep(.1);
|
||||
llReleaseControls();
|
||||
llMessageLinked(LINK_SET,1,"die","");
|
||||
llSleep(5);
|
||||
|
||||
state moving;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
on_rez(integer p)
|
||||
{
|
||||
llResetScript();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user