Jump to content

Copy script to children


EnCore Mayne
 Share

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

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

Recommended Posts

i'm trying to distribute a script placed in the root of a primset to all of the child prims. trying a script i found on the wiki gives me this error: "Task ~Prim~ trying to illegally load script onto task ~Other_Prim~!" that "caveat", from llRemoteLoadScriptPin(), indicates the pin doesn't match.

integer Pin=3141;
string copycontents;//script name to distribute

	state_entry()
	    {
            llOwnerSay("Script installed, sending to child prims");
            integer primcount;
            for (primcount = 2; primcount <= llGetNumberOfPrims(); primcount++)
            {
                llSetRemoteScriptAccessPin(Pin);
                llRemoteLoadScriptPin( llGetLinkKey(primcount), "copycontents", Pin, TRUE, 1 );                 
            }
            llOwnerSay("Done");             
        }

while the script i found didn't have the llSetRemoteScriptAccessPin() function in it, in my bumbling attempts to make the script work i thought i'd throw it in. without having it results in the same errors.

any hints why this fails?

 

Link to comment
Share on other sites

The script access PIN must be set in every recipient prim, not in the sender. So it's necessary to first manually "groom" all the recipients with a script that sets that PIN as a property of the prim, and then those PIN-setting scripts can be deleted.

Edited by Qie Niangao
  • Thanks 1
Link to comment
Share on other sites

thanks Qie, just learned this myself. i was wondering how a pin could be set on an empty prim.

integer pin = 3141;
default
{
    state_entry()
    {
        llSetRemoteScriptAccessPin(pin);
    }
}

now all i need is a script to distribute the set pin script to all the prims of the set. 😀

Link to comment
Share on other sites

All prims in a linkset have UUIDs, and just like you can send inventory items to an avatar, you can send inventory items to prims.

llGiveInventory( key destination, string inventory );

This is useful when you don't need the script to run when it arrives in the target prim.

 

BTW, may I ask why you need to distribute a script to each prim in a linkset? Can't you use llSetLinkPrimitiveParamsFast/llGetPrimitiveParams/llGetLinkName, perhaps with llDetectedLinkNumber to achieve the same thing using a single script?

Link to comment
Share on other sites

Maybe they all need to emit sounds. ;)

Just for completeness: After distributing the llSetRemoteScriptAccessPin script with llGiveInventory(), the next step is to select then object and then Build / Scripts / "Recompile Scripts (Mono)" to get all the scripts running.

  • Like 1
Link to comment
Share on other sites

3 hours ago, Fritigern Gothly said:

BTW, may I ask why you need to distribute a script to each prim in a linkset? Can't you use llSetLinkPrimitiveParamsFast/llGetPrimitiveParams/llGetLinkName, perhaps with llDetectedLinkNumber to achieve the same thing using a single script?

you may ask, but if i tell you, i have to kill you. just so you know....

here's the story. i developed a fancy script that processes the contents of a prim i manually fill with a bunch of various items (landmarks, textures, objects, etc.). basically, it's a designer's DEMO folder with too much extraneous nonsense the designer has to put in to serve a wider audience. most of the stuff they routinely include in their demos i already have or don't use or want. i'm only interested in keeping the Maitreya specific designs so everything else is tossed. once the contents' list is redefined to include only my requested items, it copies all the listed items to a uniquely named folder in my inventory then deletes the inworld prim/box.

i normally put this fancy processing script in each of the demo boxes manually but i got to thinking how could i automate it since the last Event haul resulted in getting over 50 demo folders. hence the enquiry here.

there. now where should i send my assassins?😀

  • Like 2
Link to comment
Share on other sites

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