Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llMessageLinked or llListen for rezed object?

Bond Harrington
Kills Threads At 500yds
Join date: 15 May 2005
Posts: 198
07-04-2005 11:50
For the sake of not contributing to lag, I would like to know if communication to from an Object to an object it just rezed is possible, and if llMessageLinked can be used (I'd like it to, but I'm not optimistic) or if I have to resort to llListen for it.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
07-04-2005 12:02
Just open a quick listener and use llListenRemove to close it when the communication is done.

No fuss, no muss.
_____________________
---
Vortex Saito
Quintzee Creator
Join date: 10 Sep 2004
Posts: 73
07-04-2005 12:03
It depends, if your objects are linked you can better use llMessageLinked, if they or not you have to use llListen, but better use a different channel then channel 0

For object to object listens I normally use negative channels. An Advantage to it, you can't use them in chat.
_____________________
I don't care I am a lemming, I am NOT going !!!!

secondlife://puea/54/15
Bond Harrington
Kills Threads At 500yds
Join date: 15 May 2005
Posts: 198
07-04-2005 13:23
Thx, I figured I might end up using a listen for this. I'll keep in mind the llListenRemove.

Now, I've got a related question: the reason why I want to do this is for the owner to say something to the base object that rezz the rezed object, but also imparts a parameter to it, like say, a time-to-die for the rez object. Is this possible (I'd like the owner's chat to say, "/rezobject 13", and the rezed object will die in 13 sec), or do I have to script it to specific times (say 10s, 20s, 30s).
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-04-2005 14:49
From: Bond Harrington
Now, I've got a related question: the reason why I want to do this is for the owner to say something to the base object that rezz the rezed object, but also imparts a parameter to it, like say, a time-to-die for the rez object. Is this possible (I'd like the owner's chat to say, "/rezobject 13", and the rezed object will die in 13 sec), or do I have to script it to specific times (say 10s, 20s, 30s).
Well, I'm not sure how much data you need to get, but the integer parameter in llRezObject sends an integer value to the new object. You can get it in the new object's on_rez event, or anywhere in your script with llGetStartParameter.

If all you want to communicate is the countdown for a timer, you could do it quite easily with this, without any need for listeners or anything. If you have extra data, and as long as it's a preset list, you can stick the numbers in there. Say, have the number "111012" where "111" is the code for doing one of several presets, and "012" is the timer interval. Just typecast the integer to a string, and divide it up accordingly. (Also note that if you need a listener anyway, you can keep both a random listener channel (if you need to prevent listeners in multiple objects from going off) and the timer interval data in one integer.)

What are you wanting to communicate to the new object? How many different things does it do?
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Heather Claveau
Living a SL a 3rd time
Join date: 29 Jun 2005
Posts: 4
07-04-2005 14:51
You can go either way and still come up with a nice result - its all up to you. Yet, it is easier and quicker to write a script that looks for specific hard coded presets. Though it's not that difficult to make it a more dynamic script. Again, its all up to you.
Bond Harrington
Kills Threads At 500yds
Join date: 15 May 2005
Posts: 198
07-05-2005 05:19
From: Catherine Omega
Well, I'm not sure how much data you need to get, but the integer parameter in llRezObject sends an integer value to the new object. You can get it in the new object's on_rez event, or anywhere in your script with llGetStartParameter.

If all you want to communicate is the countdown for a timer, you could do it quite easily with this, without any need for listeners or anything. If you have extra data, and as long as it's a preset list, you can stick the numbers in there. Say, have the number "111012" where "111" is the code for doing one of several presets, and "012" is the timer interval. Just typecast the integer to a string, and divide it up accordingly. (Also note that if you need a listener anyway, you can keep both a random listener channel (if you need to prevent listeners in multiple objects from going off) and the timer interval data in one integer.)

What are you wanting to communicate to the new object? How many different things does it do?


No, I really just need to communicate a user-defined lifetime for a time-to-die event for the rezed object. I didn't know you could use the parameter that way. Thanks.

I might follow Heather's advice and make the entire thing specific. I don't think I can make it accurate enough with the timer limitations: what I need is for 0.1 sec intervals, if necessary, and I don't think I can do that, but it's still doable with 1sec intervals.
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
07-05-2005 09:25
If you need to pass a float # via the start parameter, simply divide it by 10 in the rez'd object.

E.G.

If you want it to die in 5.3 seconds.....

Pass 53 to the rez'd object, have the rez'd object divide by 10...llSetTimerEvent(5.3);
Timer()
{die;}
_____________________
----------------------------------------------------------
--The mind's eye is limited only by its focus--