Jump to content

vibration script help


Lolita Erin
 Share

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

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

Recommended Posts

Thats not only a matter of scripting.

The server "tick" is 45 frames. That means in theory your script can process 45 events per second. Will the server give it enough cpu time to do that? Thats unprobable, even on an empty sim.

But you can make the prim change it's position pretty fast. But will the server update your viewer every time the position changes? Nope.

So 15 moves per seconds are possible if the server has enough time for your script and the avatars around. (by my observations) But of course you can try what goes for you and what not.

For the move itself you need to use a script function without a delay. Only llSetLinkPrimitiveParamsFast qualifies for that. It will change the prim position immediately. You just will not see it immediately - you will see it when the server has done the updates, send them to you and your computer has drawn a new frame.

If you have usecd llSetPos that's a big fail. It's way too slow for that.

Link to comment
Share on other sites

this is an example of SLPPF and a fast timer...

script is made for an unlinked object .. rez a box and drop it in,

and see if it is fast enuff?  the movement is very small, mebbe that will help?

 

integer k;integer flip = 1;list params;vector pos;integer link = 0;default{    state_entry()    { params = llGetLinkPrimitiveParams(link, [PRIM_POSITION]);     pos = llList2Vector(params,0);           }    touch_start(integer total_number)    {  if( k = !k)       llSetTimerEvent(0.02);       else        llSetTimerEvent(0.0);           }    timer()    {        llSetLinkPrimitiveParamsFast(LINK_THIS,        [PRIM_POSITION, pos + ( (flip = -flip) * <0.02, 0.0, 0.0> )]   );           }}

 

Link to comment
Share on other sites

Not really a script suggestion, but perhaps setting the object surface texture during the vibration lapse with a motion-blurred version of the “static” one might increase the realism of the effect.

Link to comment
Share on other sites


[...] any way i can make a vibration script realistic
and not laggie
?
[emphasis mine]

Moving any object at a vibration-like frequency is inherently laggy. It's bad news for the sim because it's being tasked with updating the position very often, but much, much worse news for viewer network lag. When you get one of these buzzing, turn on Develop / Show Info / Show Updates to Objects (Ctrl+Alt+Shift+U) to see what I mean. That also means the vibration will be subject to interruptions when other stuff competes for bandwidth.

Ideally, you'd want to make the vibration something the viewer can do all by itself, without needing to get updates from the sim. Without knowing a lot more about the application, I don't have any great suggestions for finding such a trick, unless maybe you can get away with blinking successive frames of texture animation instead of actually moving the object back and forth. (For example, a much different kind of vibration, that of a speaker cone, is done with lag-free PING_PONG | SCALE texture animation, but that's not the objective here.)

  • Like 1
Link to comment
Share on other sites

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