Jump to content

pausing script in child prim from a script in root prim ...is it possible??


NawaliaTrea
 Share

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

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

Recommended Posts

Hi there.. again..

so i am stuck again ;D... i want to ask you all if it is possible to pause a script that is  placed in child prim from a script in the root prim. so the situation is i am working on a smoking script. using a modifiable cigarette from MP. i added a script in the root prim for animation and alpha setting ( the cig is a static cig that jjust stay on your lips and blow smokes like a train lol) so what i want to do is to pause the smoke emitting for the duration when the cig on the lips is in alpha ( the smoke emitter script is in the flame prim child #3) is it possible to do that from the script i am working on in the root prim?

Thank you soo much for any of your help

Link to comment
Share on other sites

Yes.  That's what link messages are for.  A scripted object cannot listen to itself (to avoid getting into some nasty psychological feedback loops that happen whenever we start listening to the voices in our heads) , but it can send itself one-way messages.. You use llMessageLinked to send a message and you use a link_message event to receive it.  Take a good look at both in the LSL wiki.  The general form of llMessageLinked is

llMessageLinked (integer iTO, integer iCode, string message, key Id),

where iTO is the link number of the prim that is supposed to receive the message, iCode is a variable that you might use to send numerical information, message is a variable for sending literal information, and id can be used to send a key.  The same variables are "heard" in the receiving link_message event.  The only thing to be careful of is that you can make a script listen to itself in the special case where iTO == LINK_THIS or LINK_SET.  That can either be a great help or a nasty surprise, depending on whether you planned to do it or not.

To answer your specific question, your root prim script can send a message (possibly as something as simple as switching iCode from 1 to 0) that tells the script in the child prim to start (or stop) blowing smoke.

Edited by Rolig Loon
  • Thanks 1
Link to comment
Share on other sites

Just in case you read my posts really fast, please note that I almost always make typos and frequently discover them immediately after I hit the Submit button.  Almost any of my posts turns out to be edited, simply because I am a klutz.  :S

  • Like 1
Link to comment
Share on other sites

This may be a bit trickier. Is the smoke-emitting script also modifiable?

If so, it may be easier to simply transplant the particle system parameters from that script to the one you're working on in the root prim, using llLinkParticleSystem() to have the effect come and go on the target #3 prim.

If the smoke-emitting script is not modifiable, things get messy. Just stopping a particle script isn't enough to make the particles stop so you'd need to do that with a particle system having an empty parameter list. Ordinarily I'd say to do that with a llLinkParticleSystem() call from root, but there's another problem here: you need to get the particles started again, and if that script isn't modifiable, you'll presumably need llResetOtherScript() called from a script within the same link as that particle script. So then if you add that script-resetting-script you can talk to it with the link messages Rollig describes.

  • Like 1
Link to comment
Share on other sites

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