Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Flight Enhancement

Zindorf Yossarian
Master of Disaster
Join date: 9 Mar 2004
Posts: 160
04-19-2005 18:02
Could somebody give the the basic jist of a flight enhancement script? I havn't been able to find an example script, and am wondering how they work. Just enough information on the functions required and the way they are used to get me started on making my own flight enhancement would be appreciated.
_____________________
Badass Ninja Penguin: Killing stuff it doesn't like since sometime in May 2004.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-19-2005 18:06
Mine uses:

http://secondlife.com/badgeo/wakka.php?wakka=llSetForce
http://secondlife.com/badgeo/wakka.php?wakka=llRequestPermissions
http://secondlife.com/badgeo/wakka.php?wakka=llTakeControls
http://secondlife.com/badgeo/wakka.php?wakka=llGetRot

Since llGetRot on an attachment returns the rotation of the avatar... and llSetForce also functions on the avatar, the result is nice speed enhancement.
_____________________
---
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
04-20-2005 09:30
Here's one.

Siro's description:
CODE
It combines a script that reflects objects on collision with an anti push script 
and a flight script. Basically I found all three features in one script a benefit.
It doesn't use a traditional 'rez a prim' shield because those are fairly useless
except for people wishing to recreate historical type weapons. But in that case
you shouldn't be using a shield anyway.
This will stop people from pushing you, reflect away bullets (which hinders following
bullets), and give basic flight abilities (allowing you to fly above the
normal flight limit).

If you're looking for cool special effects or something with offensive capabilities
or special features, sorry this isn't it. This will protect you from the most standard
basic griefing and intimidation. Next time someone pulls out a watermellon
shooter or something equally stupid, you can just activate the script and
laugh it off rather than responding in kind.
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
04-20-2005 23:24
Here's a more updates but still work in progress version.

I should warn you that I may have gotten things wrong, like the rotational impulses, but hey, it's free. Enjoy.

CODE

//Anti-Grief Script, a compilation of many scripts with slight modifications by Siro Mfume
float speed;
key owner;
integer armed = FALSE;
key nameRequest;
key onlineRequest;
key objectowner;
string name;
string presentInSimTestName;
integer handle;
key oldobjectowner;
default{
state_entry() {
llListenRemove(handle);
owner=llGetOwner();
handle = llListen(5,"",owner,"");
}

collision_start(integer detected) {
if (llDetectedType(0) && (SCRIPTED|ACTIVE)) {
//if(armed){
//oldobjectowner = objectowner;
//objectowner = llDetectedOwner(0);
//presentInSimTestName = llKey2Name(objectowner);
// if(presentInSimTestName != llKey2Name(owner)) {
// if(objectowner!=oldobjectowner) {
// llWhisper(0,"you collided with/were collided with " + presentInSimTestName+"'s object.");
// }

// }
// }
if(armed) {
vector vel = llDetectedVel(0);
vel = -vel;
llPushObject(llDetectedKey(0),vel * 5, ZERO_VECTOR, FALSE);
}

}
}

on_rez(integer start_param) {
llResetScript();
}
run_time_permissions(integer perm) {
if(perm & (PERMISSION_TAKE_CONTROLS)) {
llTakeControls(CONTROL_FWD|
CONTROL_BACK|
CONTROL_RIGHT|
CONTROL_LEFT|
CONTROL_ROT_RIGHT|
CONTROL_ROT_LEFT|
CONTROL_UP|
CONTROL_DOWN,
TRUE, TRUE);
// set timer to periodically check the time since the last control input
//llSetTimerEvent(.1);
}
}

// called any time a user moves. release the damping if the avatar is locked. reset the time since last movement.
control(key id, integer level, integer edge) {
if(level & CONTROL_FWD) {
if(level & CONTROL_ROT_RIGHT){
if(level & CONTROL_UP){
llStopMoveToTarget();
llApplyImpulse(<speed,0,speed>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,-(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,-(speed*.001)>, TRUE);
}
}
else if(level & CONTROL_DOWN){
llStopMoveToTarget();
llApplyImpulse(<speed,0,-speed>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,-(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,-(speed*.001)>, TRUE);
}
}
else{
llStopMoveToTarget();
llApplyImpulse(<speed,0,0>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,-(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,-(speed*.001)>, TRUE);
}
}
}
else if(level & CONTROL_ROT_LEFT){
if(level & CONTROL_UP){
llStopMoveToTarget();
llApplyImpulse(<speed,0,speed>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,(speed*.001)>, TRUE);
}
}
else if(level & CONTROL_DOWN){
llStopMoveToTarget();
llApplyImpulse(<speed,0,-speed>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,(speed*.001)>, TRUE);
}
}
else{
llStopMoveToTarget();
llApplyImpulse(<speed,0,0>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,(speed*.001)>, TRUE);
}
}
}
else if(level & CONTROL_UP){
llStopMoveToTarget();
llApplyImpulse(<speed, 0,speed>, TRUE);
// llPushObject(llGetOwner(), <speed,0,speed>, ZERO_VECTOR, TRUE);
}
else if(level & CONTROL_DOWN){
llStopMoveToTarget();
llApplyImpulse(<speed, 0,-speed>, TRUE);
// llPushObject(llGetOwner(), <speed,0,-speed>, ZERO_VECTOR, TRUE);
}
else{
llStopMoveToTarget();
llApplyImpulse(<speed, 0,0>, TRUE);
// llPushObject(llGetOwner(), <speed,0,0>, ZERO_VECTOR, TRUE);
}
}
else if(level & CONTROL_BACK) {
if(level & CONTROL_DOWN){
if(level & CONTROL_ROT_LEFT){
llStopMoveToTarget();
llApplyImpulse(<-speed,0,-speed>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,(speed*.001)>, TRUE);
}
}
else if (level & CONTROL_ROT_RIGHT){
llStopMoveToTarget();
llApplyImpulse(<-speed,0,-speed>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,-(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,-(speed*.001)>, TRUE);
}
}
else{
llStopMoveToTarget();
llApplyImpulse(<-speed, 0,-speed>, TRUE);
// llPushObject(llGetOwner(), <-speed,0,-speed>, ZERO_VECTOR, TRUE);
}
}
else if(level & CONTROL_UP){
if(level & CONTROL_ROT_LEFT){
llStopMoveToTarget();
llApplyImpulse(<-speed,0,speed>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,(speed*.001)>, TRUE);
}
}
else if(level & CONTROL_ROT_RIGHT){
llStopMoveToTarget();
llApplyImpulse(<-speed,0,speed>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,-(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,-(speed*.001)>, TRUE);
}
}
else{
llStopMoveToTarget();
llApplyImpulse(<-speed, 0,speed>, TRUE);
// llPushObject(llGetOwner(), <-speed,0,speed>, ZERO_VECTOR, TRUE);
}
}
else if(level & CONTROL_ROT_LEFT){
llStopMoveToTarget();
llApplyImpulse(<-speed,0,0>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,(speed*.001)>, TRUE);
}
}
else if(level & CONTROL_ROT_RIGHT){
llStopMoveToTarget();
llApplyImpulse(<-speed,0,0>, TRUE);
if(speed>20){
llApplyRotationalImpulse(<0,0,-(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,-(speed*.001)>, TRUE);
}
}
else{
llStopMoveToTarget();
llApplyImpulse(<-speed, 0,0>, TRUE);
// llPushObject(llGetOwner(), <-speed,0,0>, ZERO_VECTOR, TRUE);
}
}
else if(level & CONTROL_UP) {
llStopMoveToTarget();
llApplyImpulse(<0,0,speed>, TRUE);
// llPushObject(llGetOwner(), <0,0,speed>, ZERO_VECTOR, TRUE);
}
else if(level & CONTROL_DOWN){
llStopMoveToTarget();
llApplyImpulse(<0,0,-speed>, TRUE);
// llPushObject(llGetOwner(), <0,0,-speed>, ZERO_VECTOR, TRUE);
}
else if(level & CONTROL_LEFT) {
llStopMoveToTarget();
llApplyImpulse(<0,speed,0>, TRUE);
// llPushObject(llGetOwner(), <0,speed,0>, ZERO_VECTOR, TRUE);
}
else if(level & CONTROL_RIGHT){
llStopMoveToTarget();
llApplyImpulse(<0,-speed,0>, TRUE);
// llPushObject(llGetOwner(), <0,-speed,0>, ZERO_VECTOR, TRUE);
}
else if(level & CONTROL_ROT_RIGHT){
llStopMoveToTarget();
if(speed>20){
llApplyRotationalImpulse(<0,0,-(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,-(speed*.001)>, TRUE);
}
}
else if(level & CONTROL_ROT_LEFT) {
llStopMoveToTarget();
if(speed>20){
llApplyRotationalImpulse(<0,0,(.1)>, TRUE);
}
else{
llApplyRotationalImpulse(<0,0,(speed*.001)>, TRUE);
}
}
else{
llMoveToTarget(llGetPos(), 0.1);
}
}
listen(integer channel, string name, key id, string message) {
if(message=="arm") {
armed = TRUE;
}
if(message=="disarm") {
armed = FALSE;
}
if(message=="stop"){
armed = FALSE;
llSetTimerEvent(0.0);
llReleaseControls();
llStopMoveToTarget();
llWhisper(0,"deactivated");
}
if(message=="start"){
armed = TRUE;
llWhisper(0,"activated");
speed=2;
if(owner){
llRequestPermissions(owner, PERMISSION_TAKE_CONTROLS);
}
}
if (message=="walk"){
speed=2;
llWhisper(0, "walking speed");
}
if (message=="trot"){
speed=10;
llWhisper(0, "jogging speed");
}
if (message=="sprint"){
speed=20;
llWhisper(0, "flat out run");
}
if (message=="plaid"){
speed=10000;
llWhisper(0, "Ludicris Speed.");
}
}
}
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
05-13-2005 08:06
There's another one here called AzFlight.
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa