Jump to content

Insert a scripted item into a prim


Treat Rothschild
 Share

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

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

Recommended Posts

I'm not sure exactly what you're asking, but llRezAtRoot will rez the object you want.  You can't change the script in that object (except in the sense that you can pass it information ... I just mean that you can't change the script itself), but you could have several versions of the scripted object available in your rezzer and then rez only the specific version that the user requests.

Link to comment
Share on other sites

I guess I should explain better.  I have an object, a panel, that when touched, I want to rez another object.  No troubles in doing that.  The problem lies in that I have 100 panels to update, the object to rez is a new object and I want to put the master object, if you will, in each panel.

Link to comment
Share on other sites

Sorry, I'm still being dense. So...

Panel A contains Object B.  Touch it and B rezzes.  Got that part.

There are 100 panels like A, right?  And you want to replace B with object C in each of them?

If that's the task, I can't think of an easy way to do it unless the script in each of the 100 panels was written with updating in mind.  If you were planning ahead, you could prepare for that task, for example, by telling each script to listen for a key command on a private channel and then

if (msg == "Kill_B")

{

    llRemoveInventory(INVENTORY_OBJECT,0);

}

then delay a decent period and send each panel A a new Object C.  That's just a matter of knowing the UUID of each panel and using llGiveInventory.  If you don't have a script like that in panel A to start, though, it's not going to be possible.

Link to comment
Share on other sites

So, something like this.  In the master (sending) prim...

 

 

integer gChan;integer gLisn;list gUUIDs;integer KILL = TRUE;default{    state_entry()    {        gChan = (integer)("0xF" + llGetSubString(llGetOwner(),0,6));        gLisn = llListen(gChan,"","","");        gUUIDs = [];    }        changed (integer change)    {        if(change & CHANGED_INVENTORY)        {            llResetScript();        }    }    touch_start(integer total_number)    {        llRegionSay(gChan, "Identify");    }        listen(integer channel, string name, key id, string msg)    {        gUUIDs += [msg];  //Store the UUIDs        llSetTimerEvent(15.0);    }        timer()    {        if (KILL) //The first time the timer triggers, signal panels to remove inventory        {            llRegionSay(gChan,"Update");            KILL = FALSE;        }        else  //The second time, send new inventory        {            integer len = llGetListLength(gUUIDs);            while(--len)            {                llGiveInventory((key)llList2String(gUUIDs,len), llGetInventoryName(INVENTORY_OBJECT,0));            }            llSetTimerEvent(0.0);            llListenRemove(gLisn);        }    }}

 

 

 And in each of the remote panels A (in the same sim, in this case)....

 

integer gChan;default{    state_entry()    {        gChan = (integer)("0xF" + llGetSubString(llGetOwner(), 0,6));        llListen(gChan,"","","");    }    listen(integer channel, string name, key id, string msg)    {        if (msg == "Identify")        {            llSleep(llFrand(5.0)); //delay a random amount so that all panels aren't yelling at once            llRegionSay(gChan,(string)llGetKey());  // report your own UUID        }        else if (msg == "Update")        {            llRemoveInventory(llGetInventoryName(INVENTORY_OBJECT,0));        }    }        touch_start(integer num)    {        llRezAtRoot(llGetInventoryName(INVENTORY_OBJECT,0),llGetPos() + <2.0,0.0,0.0>*llGetRot(),ZERO_VECTOR,ZERO_ROTATION,1);    }}

 You put a new object in the master prim and touch it.  It calls out to the remote panels A and gets their UUIDs.  The UUIDs stagger in over a 5 second period and load into a list. A short while after the last panel reports in, a timer tells all panels to remove the object in their inventory. After another decent delay, the master prim sends each panel A a copy of the new object.   Or something like that. 

 

 

Link to comment
Share on other sites

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