Change font size
It is currently Wed Oct 23, 2019 11:33 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 4 posts ]
Author Message
 Post subject: Parachute working for opensim 0.9 not 0.8
PostPosted: Sat Sep 14, 2019 11:47 am 

Joined: Sat Sep 14, 2019 11:33 am
Posts: 1
// Author. Ricardo Sorciere
// here is my parachute script working in 0.9 Osgrid or any other grid using 0.9 not working on 0.8
// now I own my own social media network so I hardly have time to login
// my social media network https://www.chirpsocialnetwork.com/
// please do not sell this script ty.
//no need for a hud parachute detects ground etc.
// note lines with llSetLinkPrimitiveParams(are the link numbers of your parachute that you need to paste here so when not in use it hides //prims etc.
//llPushObject play with this numbers to get a better wind push function..so far working great.

float f_SlowDown = 0.5;
integer CHANNEL = 155;

displayChute(float alpha)
{
llSetLinkPrimitiveParams(12,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(13,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(14,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(15,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(16,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(17,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(18,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(19,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(21,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(22,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(23,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(24,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(25,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(26,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
llSetLinkPrimitiveParams(20,[PRIM_COLOR, ALL_SIDES,<1,1,1>, alpha ]);
}

integer calculateGroundDistance()
{
vector pos = llGetPos();
float ground = llGround(pos);
float distance = llRound(pos.z-ground);
if (distance <= 500)
{
if (distance >= 450)
{
state deployed;
}
}
return (integer)distance;
}

displayGroundDistance()
{
llSetText("Distance to Ground: " + (string)calculateGroundDistance(),<0,1,0>,1);
}



default
{
attach(key id)
{
if(id)
{
state attached;
}
}
}


state attached
{
state_entry()
{
displayChute(0);
llSetTimerEvent(1);
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
llPreloadSound( "parachute" );

}

attach(key id)
{
if(id==NULL_KEY)
{
state default;
}
}

timer()
{
if( (llGetAgentInfo(llGetOwner()) & AGENT_IN_AIR) &&
!(llGetAgentInfo(llGetOwner()) & AGENT_FLYING) )
{
state falling;
}
displayGroundDistance();
}
}

state falling
{
state_entry()
{
llSetTimerEvent(1);
}

timer()
{
integer dist = calculateGroundDistance();

if( (dist<500) && (dist>450) )
state deployed;
displayGroundDistance();
}

attach(key id)
{
if(id==NULL_KEY)
{
state default;
}
}
}

state deployed
{
state_entry()
{
llTriggerSound("parachute",1);
displayChute(1);
llSetTimerEvent(0.1);
llStopAnimation("falldown");
llStartAnimation("hover");
llSleep(f_SlowDown);
}

timer()
{
// on the ground
if ( !(llGetAgentInfo(llGetOwner()) & AGENT_IN_AIR) &&
!(llGetAgentInfo(llGetOwner()) & AGENT_FLYING) )
{
llStopAnimation("hover");
state attached;
}

// started flying
if( llGetAgentInfo(llGetOwner()) & AGENT_FLYING)
{
llStopAnimation("hover");
state attached;
}

vector v = llGetVel();
if( v.z < -7 )
{
llPushObject(llGetOwner(), <40,10,90>, ZERO_VECTOR, TRUE);
llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_DOWN | CONTROL_UP | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE);
llSleep(f_SlowDown);

}

displayGroundDistance();
}

attach(key id)
{
if(id==NULL_KEY)
{
llStopAnimation("hover");
state default;
}
}
}


Top
 Profile  
 
 Post subject: Re: Parachute working for opensim 0.9 not 0.8
PostPosted: Sat Sep 21, 2019 9:51 pm 
User avatar

Joined: Wed May 29, 2019 1:40 am
Posts: 30
many thanks for the script. Greetings from salzburg Tara. Can you make a video where I can see what I can do with the script? i have done it in a cube and it just shows me the distance. do i need several prim cubes? ...♥♥♥


Top
 Profile  
 
 Post subject: Re: Parachute working for opensim 0.9 not 0.8
PostPosted: Thu Oct 03, 2019 10:10 pm 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 240
Location: Belgium / Brussels
Apparently Mr Sorciere left on vacation :P

By doing some research on the web, I found the original parachute script by Jeff Heaton (Encog Dod in SL) quite easily.

You should be able to do this quite easily too ... :P

Looking a little bit more I also found a video ...

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
 Post subject: Re: Parachute working for opensim 0.9 not 0.8
PostPosted: Thu Oct 03, 2019 10:35 pm 
Furious Typer
User avatar

Joined: Fri Mar 26, 2010 12:11 pm
Posts: 240
Location: Belgium / Brussels
Reading the script of Jeff & Ricardo, I was amazed ... I found that the "distance" is not the distance below the parachute prim. Indeed, the vector in llGround is an offset not a position below.
To have the position below the parachute it would be necessary to use ZERO_VECTOR and not llGetPos.

You could eventually add a slight offset to offset the height of the parachute worn on the back of the avatar.
You could also possibly influence the orientation of the skydiver depending on the direction and strength of the wind.

PS: The parachute engages at a height between 450m and 500m. To quickly reach this height you can write in the chat "gth 500" and send.

_________________
Webmaster @ digitalconcepts.free.fr & digigrids.free.fr


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 4 posts ]


Who is online

Users browsing this forum: marshall genord and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net