Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Butterfly wings flapping script needed

Lucie Doolittle
Registered User
Join date: 19 Nov 2005
Posts: 69
09-26-2007 14:13
I have been looking for a script to make butterflies or bird wings flap. I have tried a few of them that was posted on the forums and it didnt work. if anyone has a working script that they will share or has one for sale please let me know.
Thanks
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
09-26-2007 18:13
how big are your butterflies? if they are small (butterfly sized) then using alpha flickering would probably be easiest.

3 prims, one flat, 2 angled + 1 flat butterfly texture

split the textutexture for the angled parts (horizontal repeats 2, horizontal offset .25 or -.25)

this script in the flat prim
CODE

integer gBooSwap = TRUE;

default{
state_entry(){
llSetTimerEvent( 0.1 );
}

timer(){
llSetLinkAlpha( LINK_THIS, (float)gBooSwap, ALL_SIDES );
llSetLinkAlpha( LINK_ALL_OTHERS, (float)gBooSwap, ALL_SIDES );
gBooSwap = !gBooSwap;
}
}


if you're looking for something a bit different, IM me inworld, and I'll be happy to help (I think that works, I made it off the top of my head, untested)
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
Brief explanation...
09-27-2007 09:38
Something like that script should work. Basically, the idea is to give your bird 4 wings, or even 6 wings. Then, every 1/10 of a second, make 4 of them invisible (transparent) and the other 2 visible. This is much cleaner and easier than acutally moving the wings.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
09-27-2007 11:30
using timer also makes the script a good indicator of time dialation within the sim... if they aren't flapping, time dilation (or local 3d card lag) just went up alot =)
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
09-28-2007 02:28
also, could make them both into doors (effectively) that move based on time instead of touch, and have them 'open' in opposite directions, same speed, etc.

door meaning the 'rotate aroud a pole/hinge' kind
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
09-28-2007 03:09
llSetLinkAlpha, delay = 0.0
llSetLinkPrimitiveParams, delay= 0.2
llSetRot, delay = 0.2

for fast rates, and small objects, alpha is the champ, for larger stuff.... large alpha pieces may get in the way, and you can probably slow down anyways, llSet LinkPrimitiveParams is prolly better, with rotated/cut prims sot you can make one LINK_ALL_OTHERS call