Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

on_rez problem

Andy Enfield
Hippo Technologies CEO
Join date: 22 Nov 2005
Posts: 79
12-20-2005 15:26
Hi,

I'm trying to do what I believe is simple in LSL; cause a custom sound effect to play when an avatar arrives after teleporting. I've made a little attachment to be worn and put the following into it:
CODE
default
{
on_rez(integer start_param)
{
llTriggerSound("transporter", 1.0);
}
}
The script fires nicely when first attached, but then does absolutely nothing else after any teleporting. I'm probably missing something really obvious, so any help would be much appreciated.

Thanks.

Andy
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
12-20-2005 15:35
From the Wiki page for llTriggerSound:

From: someone
Triggers sound at task's current position. This sound eminates from that position no matter if task moves.


Try llPlaySound instead.
Andy Enfield
Hippo Technologies CEO
Join date: 22 Nov 2005
Posts: 79
12-20-2005 15:39
Hi Ziggy,

Thanks, I tried your suggestion, but to no avail. In fact nothing seems to fire in my on_rez event after a teleport; I tried testing it with llSay, changing the attachments color etc etc. It seems to my eye that on_rez is simply *not* firing after a teleport.

Thanks for your swift reply. It's a mystery :-(

Andy
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
12-20-2005 15:49
That's weird, I thought on_rez was supposed to trigger on teleport. And I'm pretty sure I have attachments that do that. Have you tried taking out the llTriggerSound call and leaving just the llSay in there? Maybe something else is going wrong, and your script is stuck playing the sound, and so doesn't get to process the new on_rez event?

Also, make sure you're not teleporting to a parcel which has scripts disabled.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
12-20-2005 15:51
make sure you're doing cross-sim teleporting. The new short range teleports don't detach and re-attach everything.
Andy Enfield
Hippo Technologies CEO
Join date: 22 Nov 2005
Posts: 79
12-20-2005 16:09
The cross-sim tip was very helpful, cheers. That was part of it. I also needed to throw an llSleep() in there to allow things time. Not sure why, the Wiki didn't mention that (although may have missed it).

Many thanks!

Andy