Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

passing a name to a newly rezzed object

Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
08-02-2007 14:33
If a script rezzes a transport that is intended to only take a given recipient, is there an easy way to pass their name or key to? Right now my solution is to use chat to broadcast the information on a shared channel, but the timing of this feels quite clumsy, ie:

1. rez object
2. get rez event
3. delay arbitrarily or wait for a msg from object (safer, incase of sim lag)
4. llSay intended start parameter to object, who should now be listening and hear

If its an integer I can pass it in the rez, but this solution for a string seems quite cumbersome.

Does anybody know a faster and more reliable way of doing this?
Ravanne Sullivan
Pole Dancer Extraordinair
Join date: 10 Dec 2005
Posts: 674
08-02-2007 14:39
You could also have the rezzed object request the information, that way you are sure it is rezzed and listening.
_____________________
Ravanne's Dance Poles and Animations

Available at my Superstore and Showroom on Insula de Somni
http://slurl.com/secondlife/Insula de Somni/94/194/27/
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-02-2007 14:41
That's the most reliable way to do it. Otherwise, you have to hash their name and/or key to an integer to pass in the single integer param, and the transport object would have to hash it the same way and compare before it would function. Might take a little more script time, and there is always an astronomically small chance that your hash function would return the same value for two or more different people, but it is unlikely.

So, basically, you're doing it pretty much the way most everyone does it.
Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
08-02-2007 14:49
Yep, listening for a message from the rezzed object is best. (I'm assuming you're saying the object_rez event is unreliable, because naturally I'd recommend using that first.) You really don't want to rely on fixed timers because sims will cut back on script processing when things get hairy, increasing the time between events.

EDIT: It's unfortunate you can only pass an integer on rez. If you could pass a string, the rezzed object could convert that to a key or an integer or whatever.
_____________________
Desperation Isle Estates: Great prices, great neighbors, great service!
http://desperationisle.blogspot.com/

New Desperation Isle: The prettiest BDSM Playground and Fetish Mall in SL!
http://desperationisle.com/

Desperation Isle Productions: Skyboxes for lots (and budgets) of all sizes!
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
08-02-2007 15:12
Well I'm glad I'm not the only one!

Ah well, it works so I guess I'll leave it as is for now.

Thanks for the input thusfar.
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
08-02-2007 15:22
From: Wildefire Walcott
Yep, listening for a message from the rezzed object is best. (I'm assuming you're saying the object_rez event is unreliable, because naturally I'd recommend using that first.) You really don't want to rely on fixed timers because sims will cut back on script processing when things get hairy, increasing the time between events.

EDIT: It's unfortunate you can only pass an integer on rez. If you could pass a string, the rezzed object could convert that to a key or an integer or whatever.


I'm not saying object_rez is unreliable, just to me its too undeterministic. Does that mean the object has been created and scripts are beginning or have yet to begin running, does it mean its run through the state entry functions and has become idle.. ie does it mean it is actually going to be ready and listening, or is there a chance of a missed message.

Thats why listening for a callback seems the safest.. its just also the most painful (and sometimes slow) way to tell an object 'your name is frank' when it is a relatively trivial part of the overall functionality of the system, in my opinion.
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
08-02-2007 15:46
Vote for https://jira.secondlife.com/browse/VWR-1488

From: someone
Here is llRezObject now: llRezObject(string inventory, vector pos, vector vel, rotation rot, integer param)

the param is an integer, it would be 1000x more useful as a string, for example:

use param as a UUID of a texture, so that the rezzed object could use that texture (i.e. a customer can drop a texture in the rezzer, and it will send the UUID of that texture to the rezzed object)

use param as a stringified vector and have the rezzed object convert that string back into a real vector (i.e. this rezzed object is moving HERE)

i'm sure there could many more helpful examples
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
08-03-2007 04:28
I recently started using llRezObject on a project and I used a different approach that worked well for me: in the object_rez event I send the rezzed object a notecard with some info. Ofcourse, since you can't create notecards on the fly, it may not be usefull for everything. But in a lot of cases where you want to texture the rezzed object, drop a texture into it's content and use the changed event to detect and use it.

Lyn
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
08-03-2007 10:33
I've been working on a hud for some things, and one of the features I've included is a teleporter to take you to specific areas (the compatable ship you have preselected on it). To avoid people sitting on it prematurely before it's received it's response to the request for a destination, I just have it 100% alpha, and then when it's ready it goes back to normal visibility and announces it's ready to energize.

Looks pretty seamless as regionsay is pretty fast most of the time, and even with the object id authentication to avoid crosstalk between your other compatable ships, it usually only takes it about 2 seconds max to appear. Most people think it's short enough that it just rez'd when it appears rather than having sat there and had a little conversation prior.