Ayane Philly Posted November 6, 2018 Share Posted November 6, 2018 (edited) How could i make a script into an object that has linked prims and when it rezz start showing prim by prim like a sequence and at the end all the prims are visible Edited November 6, 2018 by Ayane Philly Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted November 6, 2018 Share Posted November 6, 2018 (edited) In the state_entry event.. 1. Get the number of prims in the linkset with llGetNumberOfPrims. 2. Start a loop that repeats for each prim. 3. During each loop, use llSetLinkAlpha to make a prim visible. Also make sure that the object is invisible before you rez it. Edited November 6, 2018 by Wulfie Reanimator 1 Link to comment Share on other sites More sharing options...
Ayane Philly Posted November 6, 2018 Author Share Posted November 6, 2018 3 minutes ago, Wulfie Reanimator said: In the state_entry event.. 1. Get thw number of prims in the linkset with llGetNumberOfPrims. 2. Start a loop that repeats for each prim. 3. During each loop, use llSetLinkAlpha to make a prim visible. a loop? Link to comment Share on other sites More sharing options...
Rolig Loon Posted November 6, 2018 Share Posted November 6, 2018 Yes, a loop, as in .... timer() { iCount = (++iCount)%(llGetNumberOfPrims() + 1); // Assuming that iCount is a global integer variable if (iCount == 0) { llSetLinkAlpha(LINK_SET, 0.0,ALL_SIDES); } else { llSetLinkAlpha(iCount,1.0,ALL_SIDES); } } 1 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted November 6, 2018 Share Posted November 6, 2018 Three ways of doing loops (generally it's a matter of personal preference which people use): http://wiki.secondlife.com/wiki/Do_while http://wiki.secondlife.com/wiki/For http://wiki.secondlife.com/wiki/While Also, this might be helpful (shame the formatting is shot and we can't get in to edit it): http://wiki.secondlife.com/wiki/User:Kireji_Haiku/How_to_deal_with_lists_in_LSL Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted November 7, 2018 Share Posted November 7, 2018 (edited) 6 hours ago, Innula Zenovka said: Also, this might be helpful (shame the formatting is shot and we can't get in to edit it): http://wiki.secondlife.com/wiki/User:Kireji_Haiku/How_to_deal_with_lists_in_LSL Also some of the examples are not efficient when they call llGetListLength() via for loop condition input instead of assigning it to a local prior and referencing it for condition input every increment instead. Using it as an initializer is fine of course. Some will probably just argue preference there too, though. Edited November 7, 2018 by Lucia Nightfire 2 Link to comment Share on other sites More sharing options...
Xiija Posted November 7, 2018 Share Posted November 7, 2018 an example you can test with... integer count = 1; integer prims; default { state_entry() { } on_rez(integer param) { llSetLinkAlpha(LINK_SET, 0.0,ALL_SIDES); prims = llGetNumberOfPrims(); llSetTimerEvent( 0.5); } timer() { llSetLinkAlpha(count, 1.0,ALL_SIDES); count++; if( count == prims) { llSetTimerEvent( 0.0 ); } llSetTimerEvent(2.0 ); } } Link to comment Share on other sites More sharing options...
Innula Zenovka Posted November 8, 2018 Share Posted November 8, 2018 (edited) The timer event looks wrong to me, since I think that the way it's written, as soon as you turn the timer event off, you turn it straight back on again. Since the timer event will continue to fire until you turn it off, there's no need to keep calling llSetTimerEvent in the timer, so I'd simply say timer() { llSetLinkAlpha(count, 1.0,ALL_SIDES); if( ++count == prims) { llSetTimerEvent( 0.0 ); } } Edited November 8, 2018 by Innula Zenovka 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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