llGetLinkNumber Problems
|
|
Hunter Trommler
Ecbatana Owner
Join date: 21 Dec 2007
Posts: 85
|
04-05-2009 20:52
I am working on a new product for my store (Atticus Tech) and I'm running into problems with llGetLinkNumber =/
Basically, I am using llSetObjectDesc((string)llGetLinkNumber()), to as is pretty obvious, set the link objects description to its link number (im doing this, as even though the whole product will be appx. 50 prims, i am gonna use only one script...other than XYText =/) So basically, its working on the parent prim, but not any of the child prims...which is really weird, I've never ran into this before...any who. Is anyone else running into this problem, and can anyone suggest any problems with what i am doing (even though its worked before...) or any suggestions on how to fix this...cause really, my whole plan relies on this working LOL
_____________________
Why do people always put so much effort into life, when in the end no one makes it out alive?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-05-2009 21:35
define 'not working'. is it giving an error message, is it adding incorrect data to the description, is it failing silently?
you said it's going into the child prims... so I assume you're checking the edit linked prims box, selecting the prim you want, and dropping your script to change the description of that prim onto the contents page?
there's a lot I could assume in different way... a more specific action/reaction description of the problem might help.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
04-05-2009 21:36
To the best of my knowledge, a script in the parent prim can't change the name or description of child prims.
Am I misunderstanding what you're trying to do?
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|
|
Hunter Trommler
Ecbatana Owner
Join date: 21 Dec 2007
Posts: 85
|
04-05-2009 21:49
From: Void Singer define 'not working'. is it giving an error message, is it adding incorrect data to the description, is it failing silently?
you said it's going into the child prims... so I assume you're checking the edit linked prims box, selecting the prim you want, and dropping your script to change the description of that prim onto the contents page?
there's a lot I could assume in different way... a more specific action/reaction description of the problem might help. Its just silently failing, i stuck a llSay in thar, and it keeps passing 1 to me, but thats wrong, as its a child prim, and yes, im editing linked parts, and putting in teh script in contents  Sorry for not explaining it better D=
_____________________
Why do people always put so much effort into life, when in the end no one makes it out alive?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
|
|
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
|
04-05-2009 22:07
Are you dragging the script onto the prim? if you are will only appear in the root prim. You have to edit linked parts select the prim and drop it into the content tab of the build window. or... make a script to copy the script to every prim using llGiveInventory. then select the entire link set use the Recompile scripts in selection. you have to do this because the script will be set to not running when it is transfered to another prim and set scripts to running will not work. note if you run this script more than once you will have multiple copies of the same script in every prim. //name of script to copy to other prims string script_to_send = "link number";
default { touch_start(integer num) { integer total_prims = llGetNumberOfPrims(); while(total_prims) { key link_key = llGetLinkKey(total_prims); llGiveInventory(link_key, script_to_send); --total_prims; } llOwnerSay("update done"); } }
|
|
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
|
04-06-2009 03:51
Rather than set the scripts to running by recompiling them, I would suggest giving the script to the linkset as suggested, then taking the build back into your inventory, rezzing it again, and setting scripts in selection to running from the tools menu. I don't really understand why this should be but, at least in my experience, if you've got more than a few prims, using Recompile Scripts is quite likely to miss a couple of the scripts while re-rezzing the object and Setting Scripts to Running works every time. It might be that I've got impatient and prematurely assumed the process was over when I've used the Recompile technique, since that can take quite a while to complete.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-06-2009 10:07
From: Hunter Trommler Its just silently failing, i stuck a llSay in thar, and it keeps passing 1 to me, but thats wrong, as its a child prim, and yes, im editing linked parts, and putting in teh script in contents  Sorry for not explaining it better D= if get link number is returning one, then the script is somehow ending up in the root I'd think. or is the description for the child prim changing to 1? if not it's just repeatedly setting the root prim (which would look like a silent failure since nothing changed) if gearsawe's or inulla's suggested methods don't work, try unlinking the whole thing and adding the scripts as not running before relinking the whole thing, then set scripts in selection to running.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|