Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

FinalFlight 2.2

Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
07-26-2003 04:18
This ought to get everyone started. it is variable speed, so all you have to do to make yourself faster is say "speed,<number>". So a call would look like this, "speed,5000". There are issues with crossing sim boundaries if you are going to fast, as in sometimes the sims lose track of you, at which point you will have to relog. The base speed multiplier is set to 10000, which will make you reasonable quick. Personally, unless i am in a hurry i travel with it at around 1000. Have fun :D, and feel free to post any questions(espcially since it isn;t commented)
CODE

float speed=10000;

default
{
attach(key on)
{
if (on != NULL_KEY)
{
llListen(0,"",llGetOwner(),"");
integer perm = llGetPermissions();
if (perm != (PERMISSION_TAKE_CONTROLS))
{
llRequestPermissions(on, PERMISSION_TAKE_CONTROLS);
}
else
{
llTakeControls(CONTROL_FWD , TRUE, TRUE);
}
}
}

listen(integer channel, string name, key id, string m)
{
list test = llCSV2List(m);
if(llGetListLength(test)==2&&llList2String(test,0)=="speed")
speed=llList2Float(test,1);
}

run_time_permissions(integer perm)
{
if (perm)
{
llTakeControls(CONTROL_FWD, TRUE, TRUE);
}
}

control(key owner, integer level, integer edge)
{
if (!(level & CONTROL_FWD) || !(llGetAgentInfo(llGetOwner())&AGENT_FLYING))
{
llSetForce(<0,0,0>, FALSE);
}
else
{
vector fwd= llRot2Fwd(llGetRot());
fwd = llVecNorm(fwd);
fwd *= speed;
llSetForce(fwd, FALSE);
}
}
}

The script this was origianlly based on was written by cory linden, it was modified by me back in november to be variable speed with one of the settings being plaid(heh so if you have that script, you might want to update it with thisone). This is the final version of the single direction movment amplification script that i produced. If you want, i have multi-directional movement amplification scripts as well on the hoverboards i sell, L$400 at my little booth in Nexus Prime (make sure you touch the information cube to see what)
_____________________
i've got nothing. ;)
Jack Skallagrimson
バナナの電話!
Join date: 17 Jul 2003
Posts: 63
08-02-2003 10:13
i've tried this many times, it hast worked, does it attach or go into a machine?
_____________________
hi
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
08-02-2003 23:08
it goes onto an object you attach... did you try upping the speed?
_____________________
i've got nothing. ;)
Millie Thompson
Resident Moderator
Join date: 18 Dec 2002
Posts: 364
08-03-2003 16:38
What about a script for an actual vheicle? While the FF2.2 script has me thinking of my next project I need something to power a vheicle for flight.
Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
08-18-2003 01:40
From: someone
Originally posted by Millie Thompson
What about a script for an actual vheicle? While the FF2.2 script has me thinking of my next project I need something to power a vheicle for flight.

I believe Bosuzoku will script your object for L$600.
Chance Small
Linden PITA
Join date: 30 Jul 2003
Posts: 170
08-29-2003 10:21
I just tried this script, works good, except typing "speed #" doesn't seem to change the speed, also while fressing W or Up-Arrow, it does not turn very well.

Purhapse you can take a look at these and let me know?
Arpie Perkins
Junior Member
Join date: 21 Jul 2003
Posts: 7
Flight Script explanations and improvement
08-30-2003 16:52
Note that this script only affects FORWARD movement. Up, down and sideways are not affected.

Also, the system freaking out when crossing sim boundaries is a total PITA.

Also, read above, you need to say "SPEED,<number>". You need the comma in ther otherwise it doesn't work.

I have tweaked this script, added comments, prevented the boundary problem and it works quite nicely. Adding up/down/left/right shouln't be a problem, but I haven't felt it's necessary.

I'll be good and here's the boundary problem solver:

CODE

vector position = llGetPos();
vector delta = fwd * BORDER_BUFFER;
position += delta;
if (position.x <= 0 || position.x >= 255 ||
position.y <= 0 || position.y >= 255)
{
fwd *= 20;
llSetForce(fwd, FALSE);
}
else
{
fwd *= SPEED; // multiplies the fwd speed
llSetForce(fwd, FALSE); // applies force to accelerate
}



I'll leave the placement of this as an exercise for the reader. If you're not into programming, contact me in game and we can work soemthing out. ;-)