Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sending On Rez message

InuYasha Meiji
Half Demon
Join date: 14 Mar 2005
Posts: 127
02-18-2006 21:11
I need to know what to do to make an object send out a message when rezzed and then again once it is taken back or deleted. I looked up "on rez" but the wiki didn't tell me anything. Can someone help me with this??

-Inu
Padraig Stygian
The thin mick
Join date: 15 Aug 2004
Posts: 111
02-19-2006 00:14
You can use the on_rez handler to have the object say something when it's put out, but there is no handler for deletion.

"The state_exit handler is not called when an object is being deleted; all callbacks, handlers, sounds, etc, will be cleaned up automatically." State

CODE

on rez()
{
llSay(0, "I've been rezzed!");
}
_____________________
(You): Aww! My pants won't rez! Does this texture look okay on me?

Incidental Radio :: Because nothing is by design
Now featuring Torley-tastic technomusic!
InuYasha Meiji
Half Demon
Join date: 14 Mar 2005
Posts: 127
Realization.
02-19-2006 00:34
From: Padraig Stygian
You can use the on_rez handler to have the object say something when it's put out, but there is no handler for deletion.

"The state_exit handler is not called when an object is being deleted; all callbacks, handlers, sounds, etc, will be cleaned up automatically." State

CODE

on rez()
{
llSay(0, "I've been rezzed!");
}



ok, I goofed again. UI now realize why I didn't find anything in my search. I typed "on rez" in the search, and not "on_rez". I founs it just before you wrote to me. Thanks for you time. Well you also saved me from a long search of something that don't exist.

Thanks, Inu.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
02-19-2006 00:40
In the on_rez event you put llSay(), llEmail() or whatever for the first part.

There isn't a "de rez" event - you can't, AFAIK, send a message when being taken back, deleted or similar. change or attach, depending on context, can show when a seat is vacated or an item unattached if that's any good?

Alternatively you could broadcast your message every now and again (how often depends on how much you like causing lag, how timing critical things are etc.) and thus detect the absence of message as an indicator of death.
InuYasha Meiji
Half Demon
Join date: 14 Mar 2005
Posts: 127
Found a way around my problem.
02-19-2006 08:10
From: Eloise Pasteur
In the on_rez event you put llSay(), llEmail() or whatever for the first part.

There isn't a "de rez" event - you can't, AFAIK, send a message when being taken back, deleted or similar. change or attach, depending on context, can show when a seat is vacated or an item unattached if that's any good?

Alternatively you could broadcast your message every now and again (how often depends on how much you like causing lag, how timing critical things are etc.) and thus detect the absence of message as an indicator of death.


Well one thing I wanted to use this for was as a way to make a sword get placed in to and out of its sheath. I don't like causing lag so I didn't want a constant use of listen or say commands to constantly ckeck for the sword. I do use one listen on a weird channel.

I have a sheath with a sword in it. The sword handle listens on a channel for the word sheath and unsheathe to tell it to become visible or invisible.

Now when you wear the sword, only on rez it tells the sheath to unsheathe, therefor turning the handle in the sheath invisible. To remove the sword from your hand and return the handle in the sheath I wear a ring on the right hand. The ring has an on_rez command thay uses llSay to tell the sheath to sheath or make the handle visible again.


This way there isn't a constant say command, or a constant checking. And now to sheath and unsheathe my sword doesn't take wearing two items from inventory, and it is a smooth change from having the sword in my hand and putting it back. Now all I need to do is make the animation of pulling it out, and putting it back,

Thank you all for your help and suggestions along the way.

-InuYasha Meiji