Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

how to call another function from a linked prims

Patrick Wunderland
Registered User
Join date: 9 Nov 2006
Posts: 2
12-11-2006 14:25
guess i habe a complex object consisting of three prims:

(1) a lampshape
(2) a lampbase
(3) and between a stack which connects the lampshape and the lampbase

if i understood it well i have 4 prim-inventories ?

one for each primitive and for the "main-Object" which links all three prims togehter.

if my lampe ist touched the "main"-script with the touch-event is called. How to call from this "upper" object the scripts in the prim-inventories for prim (1) to (3) ????

how can help me?

thx and regards,

patrick
Ultralite Soleil
Registered User
Join date: 31 Aug 2006
Posts: 108
12-11-2006 14:38
Best solution is to use llMessageLinked

http://www.lslwiki.com/lslwiki/wakka.php?wakka=llMessageLinked
Zaphod Kotobide
zOMGWTFPME!
Join date: 19 Oct 2006
Posts: 2,087
12-11-2006 17:16
Essentially, if I understand what you're saying, you in effect want to call a function in one script from another script. This cannot be done, unfortunately, as there is no global context that extends beyond an individual script.

So you can do what the prior poster suggested, and use llMessageLinked().. this would require some sort of API work however, and can be a bit daunting to those uninitiated in scripting/programming.

Another option, if all you really want is a touch event anywhere on your multi prim object to invoke a particular function, locate that function in the root/parent prim of the linkset, and have a look at llPassTouches.

http://www.lslwiki.com/lslwiki/wakka.php?wakka=llPassTouches

Whether or not you actually need to use this function depends on how you code your project. There's good information there that I think will answer your question, at least if I understood it correctly.

zk