Jump to content

starting a script from inside another script


Christina Halpin
 Share

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

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

Recommended Posts

Is there any way for a script inside my object to turn on another script inside the same object? I need llStartScript(scriptname), but they don't have that.

 

(It gets the script from another machine, but it can't be running inside the machine, that would drive me mad. So I can get the machine to give my my object something, and a script knows it was given something. Now I am stuck on the turning-on part.)

Link to comment
Share on other sites

Giving the script using llGiveInventory isn't going to work.   If you do it that way, you'll need to re-rez the receiver object, or at least re-compile the script you've given, before setting the new script to running.

I think the way to do it is 

  • Set a PIN for both the giver and receiever objects using llSetRemoteScriptAccessPin
  • Place the script you want to give inside the giver object, set to not running.
  • Give it to the receiver object,  using llRemoteLoadScriptPin, with the fourth parameter set to TRUE.   
That will set the script to running for you, when it's given to the receiver.
  • Like 1
Link to comment
Share on other sites

Another way to do it is to set two states in the script you want to start (script 2) from another script (script 1). The first state is default which does nothing except for waiting for a linked message from script 1. When received it goes to operations state where it actually does things. Script 2 may or may not acknowledge the starting msg. If synchronization between scrips 1 and 2 is required it should acknowledge and this technique works the best. If no sync is needed llSetScriptState() is preferable.

Link to comment
Share on other sites

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