Jump to content

Car demolition


BlueAllien
 Share

You are about to reply to a thread that has been inactive for 542 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello, I'm new to LsL and need some advice. I wrote a script that can break any vehicle when the value of the counter in the script reaches the value 0. The script works great with zero lag, but in the end the vehicle comes apart, but the parts don't fly around like they should. Here is a piece of code.

____________________________________

{

llPlaySound (pGameOverSoundSCR, 1.0);
llSetStatus(STATUS_PHYSICS, TRUE);
llBreakAllLinks();
llPushObject(llDetectedKey(0),<0,0,100>, <0,0,100>, TRUE); // This line is not working
llSetStatus(STATUS_PHYSICS, FALSE);

// START PARTICLE for Health <= 0

llParticleSystem(
[

____________________________________

Please tell me how I can send car parts into space or a little closer, LoL. Thank you very much.

Link to comment
Share on other sites

After you separate the car into multiple links, it is no longer "1 object" anymore.  At that point, the script should only operate on the object that it is in.

Just my thought..

Edited to add: Unless the parts are still all touching at that point, maybe a push would act on the other parts.

Anyway, I bet someone else has a better answer!

Edited by Love Zhaoying
Link to comment
Share on other sites

There are specific limitations as to where and upon what llPushObject is effective: https://wiki.secondlife.com/wiki/LlPushObject#Caveats.

The llDetected* functions only work in events where there is something to detect, like touch* or collision*, etc. In these events the parameter is an integer telling you how many items were detected. You must then loop (for example) llDetectedKey(n) with the values of n running from 0 to the parameter - 1 (indexes rather than ordinals).

Perhaps you could have the script make a list of the keys of the components of the object when it's rezzed and at explosion time loop through that list applying a push to each individual severed part. (I think unlinked objects keep the same key they had when they were part of a linkset.)

Perhaps you could have an invisible object suddenly increase it's size at explosion time, pushing all the individual components away.

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 542 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...