Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

speed commands issue

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
11-07-2007 15:01
im having a slight problem with my one aircraft, it not a huge one just a system that dosent wont to work as i planned.

when i reach 35 speed the wings will deploy and when i get to a speed between 35-60 speed it will say another command for the wings and when i get over those speeds it will send yet another command to wings, i cant figure out how to only deploy between 2 diffrent speeds, the way i had it before it would keep opening and closeing constantly can anyone help?

speed <35
speed 35-60
speed >60

only am able to get speed <35 and >35 working right


CODE

integer a;
default
{
state_entry()
{
llSetTimerEvent(0.2);
}
timer()
{
integer speed = (integer)(
llVecMag(llGetVel()) * 1.94384449 + 0.5);
if (a == 1)
{
if (speed < 35)
{
llWhisper(0,"wings out");
llMessageLinked(LINK_SET, 0, "wing_open", NULL_KEY);
a = 0;
}
}
else if (speed > 35)
{
llWhisper(0,"wings in");
llMessageLinked(LINK_SET, 0, "wing_closed", NULL_KEY);
a = 1;
}
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-07-2007 15:53
Don't know what a is doing but you could always add it back in:

CODE


default
{
state_entry()
{
llSetTimerEvent(0.2);
}
timer()
{
integer speed = (integer)(
llVecMag(llGetVel()) * 1.94384449 + 0.5);
if (speed < 35)
{
llWhisper(0,"wings out");
llMessageLinked(LINK_SET, 0, "wing_open", NULL_KEY);
}
else if (speed >= 35 && speed <= 60)
{
llWhisper(0,"wings in");
llMessageLinked(LINK_SET, 0, "wing_closed", NULL_KEY);
}
else if (speed > 60)
{
llWhisper(0,"wings other");
}
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
11-07-2007 17:03
yep that what i was looking for, wosent sure if the && stuff would work with this

EDIT:
it barly works now, it is very unresponcive