Multipel Instances of a script in an object
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
12-31-2004 13:32
High , I am trying to figure out if there is any way to crate copies of a script as they are needed. I tried doing llGiveInventory ( llGetKey ( ), "script name" ); That seems to do nothing at all. Not even an error message. Or what ever it's doing it's not detectable.
So is it possible, and if so how?
|
Evil Fool
"==" != "="
Join date: 30 Jul 2004
Posts: 110
|
12-31-2004 13:35
that would require llAllowInventoryDrop(TRUE);
you could try somethign with
llRemoteLoadScriptPin and llSetRemoteScriptAccessPin
|
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
|
12-31-2004 13:55
Kurt, you might try having the root script give itself to a linked prim. That linked prim should receive a new script (with new key). Have it detect the change in its inventory and pass the script back to the root prim from it's inventory. In theory, this should create a copy of the original scrip in the root prim's inventory (both with different keys).
You may also have to ensure the root script has "copy" and/or transfer permissions.
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
12-31-2004 14:30
Well to send a copy through give, the script has to have a different name. and I haven't figured out a way for a script to change it's own name or another scripts name. I could make copies of the object, link them together. BUt that end up being limited to the number of primitive in a link set.
Allow drop doesn't appear to effect give. Least when I own both of the objects, and they are linked in a link set.
|
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
|
12-31-2004 14:35
Kurt, can you explain _why_ are you trying to do this? Two copies of the same script in the same prim will simply do the same thing. So, why even bother? Maybe there is a single script alternative.
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
12-31-2004 14:42
No it is a case where each instance has to be a separate script. If it was at all possible to program this in one script. I would, but I know anuff about other areas of sls to know the one script version is impossible. Because this script deals with permissions. And because I can't , the project has an added level of complexity. I guess I could just make a bunch of copies by hand. But it would severely limit the script. Witch would mean I would have to make it even more complex. And ultimately make the project worthless in the sense that the script could crash.
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
12-31-2004 15:40
Kurt, if there is absolutely no alternative to what you are doing, I suggest, instead of trying to programmatically duplicate the script, rez an object with the script in it. You should then have the rezzed object(s) communicate with the original object via object chat. This allows you to rez as many scripts as you desire.
Of course, this puts yet another constraint on your project: prim limits. How many instances of the script are you planning on having?
Have you considered using XMLRPC or Email to offload the storage to an external source? ==Chris
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
12-31-2004 15:59
Yep, I usually try to tack one problem at a time. Detecting if the object can rez, how many prim are left, talking on a non secure channel. And it just bother me to think I would have to rez a copy for each user. it's a script why should it be linked to rezing a doop object.
I looked into remote pin. I"m amazed at how easy it is to use. But it has the same limitation. If the script is there. It won't make a duplicate. Unless it has a different name.
|
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
|
01-04-2005 14:29
this actually might be possible, I shall experiment  . Thanks for the thought food btw.
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
01-04-2005 15:27
A lindon said some thing simular, but he wouldn't elaborate. I've yet to figure out how.
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
01-04-2005 23:39
*sigh* having *identical* copies of a script in an object won't work out the way you want. When i say identical i mean they have the same GUID. The simulator virtual machine array doesn't work well with running scripts with the same GUID in the same object; it treats them as a single script. Linked messages only go to the first copy of the script. I would assume the same with listens. llGetScriptName returns the name of the first script. Essentially you can't have multiple copies of a script running without first forcing them to have different GUID's. I'm willing to bet if you tried to delete one of these scripts by name it would delete the first in the series and not the correct one.
The problem with llGetScriptName has been around since I joined; so i would assume this is a well known problem to LL.
I found all this out while building an auto mirroring database. I wanted to avoid having to tweak 5 identical scripts.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
01-04-2005 23:55
really ? weird when I copy them by hand I haven't had a problem.
|
Pete Fats
Geek
Join date: 18 Apr 2003
Posts: 648
|
01-05-2005 00:03
Kurt, while I adore whatever you are trying to do in SL, can you please mix in spell check?
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
01-05-2005 00:40
there were only 10 word miss spelled. O.o or an average of 2 word per post. and I do use a spell check for most of my posts. I know for some people, who are natrually gifted with perfect grammer and spelling it can be baffling as to why some one canot know how to spell fraze like amphibious vehicle. But for some one who has to put allot of work into thier spelling, and get not nealry as many rewards. Who natraully are not as 'gifted' as you, they go through that strugle every time they type. The strugle you read in their words are as real, at least you don't have to deal with that every time you write. ^.^
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
01-05-2005 00:49
*yawn* can we avoid talking about spelling and get back to scripting?
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
01-05-2005 01:54
yes sir! scripts a spell check. jk so ya .. multi scripts.. off topic. but is it posible to move a script between primtives , and mane tane it's permistions, and running state. By script ..
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
01-05-2005 06:17
can't rename the script via script so you can't cause more then one copy to exist by script. Anyway that is probably a good thing, considering that every linked message would need to be parsed by every script.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
|
01-06-2005 12:59
well, uploading a script via llRemoteLoadScriptPin causes it to overwrite a script in the object if it has the same name. so no, you'd have to have multiple copies of the script in the sender to send multiple copies to the reciever, defeating the whole purpose. also llRemoteLoadScriptPin seems to have a built in delay of about 3 seconds :  igh::
|