This commit is contained in:
Fred Beckhusen
2015-08-07 15:34:30 -05:00
parent ce47ec2f3e
commit fde850293c
8080 changed files with 0 additions and 2443112 deletions

View File

@@ -1,6 +0,0 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|03 Sep 2013 17:14:00 -0000
vti_extenderversion:SR|12.0.0.0
vti_cacheddtm:TX|03 Sep 2013 17:14:00 -0000
vti_filesize:IR|109
vti_backlinkinfo:VX|

View File

@@ -1,3 +0,0 @@
<Solution name="mooFerd">
<Project name="mooFerd" path="mooFerd\mooFerd.prj" active="true"/>
</Solution>

View File

@@ -1,288 +0,0 @@
// :CATEGORY:Animal
// :NAME:mooFerd
// :AUTHOR:Ferd Frederix
// :CREATED:2013-09-06
// :EDITED:2013-09-18 15:38:57
// :ID:520
// :NUM:704
// :REV:1
// :WORLD:Second Life
// :DESCRIPTION:
// a mooving cow script
// :CODE:
// ______ _ ______ _ _
// | ___| | | | ___| | | (_)
// | |_ ___ _ __ __| | | |_ _ __ ___ __| | ___ _ __ ___ __
// | _/ _ \ '__/ _` | | _| '__/ _ \/ _` |/ _ \ '__| \ \/ /
// | || __/ | | (_| | | | | | | __/ (_| | __/ | | |> <
// \_| \___|_| \__,_| \_| |_| \___|\__,_|\___|_| |_/_/\_\
//
// fred@mitsi.com
//
// author Ferd Frederix Copyright 2009
//
//
float difficulty = 7.0; // higher = more difficult
string q1;
string q2;
string q3;
string q4;
////////////////////////////////////////////
// Follow Me Script
//
// Written by Xylor Baysklef
// Adapted and added by Garth Fairlight
// More mods by Ferd Frederix
////////////////////////////////////////////
/////////////// CONSTANTS ///////////////////
string FWD_DIRECTION = "-y";
vector POSITION_OFFSET = <0.0, 0.0, 0.0>; // Local coords
float SCAN_REFRESH = 1.0;
float MOVETO_INCREMENT = 6.0;
///////////// END CONSTANTS /////////////////
float LastPositionX = 0;
float LastPositionY = 0;
///////////// GLOBAL VARIABLES ///////////////
rotation gFwdRot;
float gTau;
float gMass;
integer count;
/////////// END GLOBAL VARIABLES /////////////
key AviKey;
integer blows = 0;
Tell (string story) {
integer ind=llSubStringIndex (story, " ");
if (ind>-1) {
string oldname=llGetObjectName ();
llSetObjectName (llGetSubString (story, 0, ind-1));
llWhisper(0,"/me "+llGetSubString (story, ind+1, -1));
llSetObjectName (oldname);
} else {
llWhisper( 0,story);
}
}
StartScanning()
{
llSensorRepeat("", "", AGENT, 40.0, PI, SCAN_REFRESH);
}
// Move to a position far away from the current one.
MoveTo(vector target)
{
vector Pos = llGetPos();
while (llVecDist(Pos, target) > MOVETO_INCREMENT)
{
Pos += llVecNorm(target - Pos) * MOVETO_INCREMENT;
llSetPos(Pos);
}
llSetPos(target);
}
rotation GetFwdRot()
{
// Special case... 180 degrees gives a math error
if (FWD_DIRECTION == "-x")
{
return llAxisAngle2Rot(<0, 0, 1>, PI);
}
string Direction = llGetSubString(FWD_DIRECTION, 0, 0);
string Axis = llToLower(llGetSubString(FWD_DIRECTION, 1, 1));
vector Fwd;
if (Axis == "x")
Fwd = <1, 0, 0>;
else if (Axis == "y")
Fwd = <0, 1, 0>;
else
Fwd = <0, 0, 1>;
if (Direction == "-")
Fwd *= -1;
return llRotBetween(Fwd, <1, 0, 0>);
}
rotation GetRotation(rotation rot)
{
vector Fwd;
Fwd = llRot2Fwd(rot);
float Angle = llAtan2( Fwd.y, Fwd.x );
return gFwdRot * llAxisAngle2Rot(<0, 0, 1>, Angle);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * The real start of the universe.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
default
{
state_entry()
{
llSetStatus(STATUS_PHYSICS, TRUE);
q1 = llGetInventoryName(INVENTORY_SOUND,0);
q2 = llGetInventoryName(INVENTORY_SOUND,1);
q3 = llGetInventoryName(INVENTORY_SOUND,2);
q4 = llGetInventoryName(INVENTORY_SOUND,3);
difficulty = llFrand(6.0) + 3; // from 3 to 8.99999
llSetStatus(STATUS_PHANTOM, TRUE);
gFwdRot = GetFwdRot();
gMass = llGetMass();
gTau = llFrand(5.0) + 5;
//if (debug) llOwnerSay("tau:" + (string) gTau);
llMoveToTarget(llGetPos(), gTau);
AviKey = llGetOwner();
llCollisionFilter( "", "", TRUE);
llVolumeDetect(TRUE);
StartScanning();
}
collision_start(integer total_number)
{
llSleep(1.0);
}
sensor(integer num_detected)
{
integer avi ;
integer i;
avi = -1;
for (; i< num_detected; i++)
{
string Avatar = llDetectedName(i);
//llOwnerSay(Avatar);
if ( Avatar == llGetObjectDesc())
{
avi = i;
llSetStatus(STATUS_PHYSICS, TRUE);
}
}
if (avi < 0)
return;
// vector LastPos;
rotation TargetRot;
vector Pos = llDetectedPos(avi);
rotation Rot = llDetectedRot(avi);
vector size = llGetAgentSize(llDetectedKey(avi));
TargetRot = llEuler2Rot( <0, 0, 0> * DEG_TO_RAD) * GetRotation(Rot);
float offsety = -llFrand(2.0)+1;
float dist = llVecDist(Pos,llGetPos());
//llOwnerSay("Pos = " + (string) dist);
if (dist < 1.3)
{
llPlaySound(q1,1.0);
llSleep(10.0);
}
POSITION_OFFSET = <offsety,0.0, (-size.z / 2) + 1.0>;
vector Offset = POSITION_OFFSET * Rot;
Pos += Offset;
float newrand = llFrand(5.0) + 2;
llRotLookAt(TargetRot, 2.0, 0.2);
llMoveToTarget(Pos, newrand);
if (Pos.y != LastPositionY)
{
LastPositionY = Pos.y;
float r = llFrand(20);
if ( r < 1 ) {llPlaySound(q1, 1); }
if (r > 1 && r < 2 ) {llPlaySound(q2, 1); }
if (r > 2 && r < 3 ) {llPlaySound(q3, 1); }
if (r > 3 && r < 4 ) {llPlaySound(q4, 1); }
}
LastPositionX = Pos.x;
if (Pos.x != LastPositionX)
{
LastPositionX = Pos.x;
float r = llFrand(20);
if ( r < 1 ) {llPlaySound(q1, 1); }
if (r > 1 && r < 2 ) {llPlaySound(q2, 1); }
if (r > 2 && r < 3 ) {llPlaySound(q3, 1); }
if (r > 3 && r < 4 ) {llPlaySound(q4, 1); }
}
count=0;
}
no_sensor()
{
count += 1;
if(count > 120)
{
llPlaySound(q1,1);
count = 0;
}
llSleep(1.0);
}
touch_start(integer num)
{
integer choice = (integer)llFrand(difficulty);
if(choice == 1)
{
Tell("You hurt the " + llGetObjectName());
llPlaySound(q2,1);
blows++;
}
else if(choice == 3)
{
Tell("You whacked a huge blow to the" + llGetObjectName());
llPlaySound(q3,1);
blows++;
blows++;
}
else
{
Tell("You miss the "+ llGetObjectName());
}
if (blows > difficulty)
{
Tell("You killed the " + llGetObjectName());
llPlaySound(q3,1);
llSleep(1);
llDie();
}
}
on_rez(integer p)
{
llResetScript();
}
}

View File

@@ -1,7 +0,0 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|08 Sep 2013 03:49:03 -0000
vti_extenderversion:SR|12.0.0.6211
vti_backlinkinfo:VX|
vti_author:SR|alien\\fred
vti_modifiedby:SR|alien\\fred
vti_timecreated:TR|18 Sep 2013 20:38:57 -0000

View File

@@ -1,6 +0,0 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|03 Sep 2013 17:14:00 -0000
vti_extenderversion:SR|12.0.0.0
vti_cacheddtm:TX|03 Sep 2013 17:14:00 -0000
vti_filesize:IR|264
vti_backlinkinfo:VX|

View File

@@ -1,6 +0,0 @@
<Project name="mooFerd" guid="144d920d-ebae-45b6-8875-214a7b3b65e2">
<Object name="Animal" guid="0d275a46-116e-4f85-ab61-251d7107d829" active="true">
<Script name="Script.lsl" guid="1d8b7fe7-0a0b-4773-b422-667dd6a635a4">
</Script>
</Object>
</Project>