Jump to content

Need help with a flight detection script


Caiym
 Share

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

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

Recommended Posts

I am an utter scripting noob, but found this http://forums-archive.secondlife.com/15/89/26143/1.html

It seems that the problem i'm running into is that SL code was changed a couple of years back, as I was told.

 

Does anyone know of a version of that which would work now, or know how to fix it to work?

I'm trying to make a set of wings that appear and animate during flight, but vanish when flight is ended.

 

Thank you in advance!

Link to comment
Share on other sites

That script will still work. You probably did not understand how to use it.

Putting a script into every prim was necessary then but today it's a stupid idea and maybe you will get tarred and feathered for that. :D

You need only the main script, just  a little change needed.

 

// Agent Flying Detection//// This is the main script.  Place one copy of it in the attachment in question,// usually the root prim.//// Cross Lament's messy code follows.integer isFlying = FALSE ;default{    state_entry()    {        llSetTimerEvent( 2 ) ;      // Polling rate, check every couple of seconds    }        timer()    {    	integer flystatus = llGetAgentInfo( llGetOwner() ) ;    	    	// if the agent is flying, and the status holder says they're not...        if( ( flystatus & AGENT_FLYING ) && !isFlying  )        {        	isFlying = TRUE ;            	llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES);        }                // if the agent is NOT flying, and the status holder says they are...        else if( !( flystatus & AGENT_FLYING ) && isFlying  )        {        	isFlying = FALSE ;            	llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES);        }    }}

 

  • Like 1
Link to comment
Share on other sites

Ok I got it working, thank you so much. Tiny issue still in terms of animated wings. I think its a script conflict that just wont work with the ones I'm using.

On the ground they are invisible if I disable the flapping animation, but in the air I get like 4 sets of wings, (each part of the flapping animation) visible all at the same time.

If I enable the flapping animation they are visible flapping flying and not flying.

I think I just need a different pair of wings, but will this script work on other animated ones?

Link to comment
Share on other sites

You have 4 pairs of wings and the animation script makes them visible and invisible as needed.

So the solution is simple. Don't make them visible! The animation script will do that for you.

You only make them invisible on landing.

Take the line out of the script that makes them visible and leave the line that makes them invisible untouched.

  • Like 1
Link to comment
Share on other sites

Thank you for bearing with my noob self. But that line isn't the problem in this case, since with the animation toggled on, they are still visible on the ground. The script to make them not visible does not work if the animation is on. It only works if the animation is off.

 

If animation is toggled off, I have nothing on the ground as I want, and now nothing in the air either, with the make visible line taken out.

 

With animation toggled on I have normal flapping wings both in and out of the air regardless, with the make visible line in or out..

The animation script is no modify so I can't see what it's doing.

Link to comment
Share on other sites

I see.

If you cant get along with the animation script you need to replace it. How complicated that is depends on the way the wings are build. it's surely more complicated than the flight detection.

Using other wings can lead to the same problems - you will not know until you tried it.

You could ask the creator if the animation script can be changed. But many builders can't script and will hire a scripter so things can become more complicated.

The flight detection script could halt the animation script b4 it makes the wings invisible. But need to think about how to activate it again when needed.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3467 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...