New Stuff

This commit is contained in:
Fred Beckhusen
2020-09-29 12:27:50 -05:00
parent 9bf2d6a1c4
commit 68a6f7f2cb
13 changed files with 912 additions and 10 deletions

View File

@@ -0,0 +1,41 @@
float delay = 0.1;
integer m_STEPS = 16;
motionTo(vector dest,rotation rot) {
integer i;
vector currentpos = llGetPos();
vector step = (dest - currentpos) / m_STEPS;
for (i = 1;i <= m_STEPS; i++)
{
if (i == (m_STEPS / 2))
{
llSetRot(rot);
}
llSetPos(currentpos + (step * i));
}
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/2);
}
default {
state_entry() {
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/2);
}
changed(integer what) {
if (what & CHANGED_REGION_START){
llResetScript();
}
}
sensor(integer n) {
motionTo(llDetectedPos(0) +(llRot2Fwd(llDetectedRot(0)) / 10),llDetectedRot(0));
}
no_sensor()
{
llSetTimerEvent(10);
}
timer() {
llSensor("Track",NULL_KEY,ACTIVE | PASSIVE,10,PI/2);
llSetTimerEvent(0);
}
}