Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sending a variable to a linked prim.

Zlinks Karu
Design & Build Services
Join date: 9 Oct 2008
Posts: 12
03-26-2009 19:03
I have this script that sets up a random variable based off of the root prims key:

listenChannel = ( -1 * (integer)("0x"+llGetSubString((string)llGetLinkKey(LINK_ROOT),-5,-1)) )

I am using this to set the listening channel for an object. If I put this in one of the link sets other prims, it works fine until I take the object into inventory and then rez it back. Then it breaks and the settings that are in that linked prim stop working, but the main script still works fine.

Any suggestions?
_____________________
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
03-26-2009 19:07
i assume you're putting that in the state entry? object keys change each time they're rezzed. the state entry is only run once when the script is compiled, or reset, or when switching between states, so if you aren't doing any of that, then it won't check for the new key. if it's possible you should have the script reset on rez
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Zlinks Karu
Design & Build Services
Join date: 9 Oct 2008
Posts: 12
03-26-2009 19:10
That makes sense. I'll try that and see if that fixes it. Thank you.
_____________________
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
03-26-2009 19:24
Or if you dont whant to loose another variable , just do again the part where you get the variable needed in the on_rez part, not all again with reset script.
_____________________


RAW terrain files - terraform your SIM!!
http://www.wishland.info/
PD:the wiki its your friend ;)
http://wiki.secondlife.com/wiki/LSL_Portal
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
03-26-2009 19:33
From: Papalopulus Kobolowski
Or if you dont what to loose another variable , just do again the part where you get the variable needed in the on_rez part, not all again with reset script.

that too, lol, forgot to mention that
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Zlinks Karu
Design & Build Services
Join date: 9 Oct 2008
Posts: 12
03-26-2009 21:20
Thanks so much. I got it to work perfectly. I did set it to reset the entire script only because after you said that I realized that another part of the script reads who the owner is and that could run into a similar problem.
_____________________