Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script resetting issue

Skye Tracer
Registered User
Join date: 17 Nov 2006
Posts: 10
05-02-2008 07:58
have a few vehicles and have had no issues with the scripts resetting upon rezzing them. I am builing my first vehicle and the scripts do not seem to reset completely. In fact, I can take out the sound files, reset the script and the sound files still play and I cannot get other sound files to play in the vehicle. Any ideas?
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
05-02-2008 09:01
Sound is a prim property, like hovertext. In your onrez event, you may want to use:

llStopSound();

Just for kicksies, here's a scrubber for all the prim properties:

CODE

default
{
state_entry()
{
llSetSitText( "" );
llSetTouchText( "" );
llParticleSystem( [ ] );
llSetText( "", ZERO_VECTOR, 1.0 );
llTargetOmega( ZERO_VECTOR, 0, 0 );
llSetCameraAtOffset( ZERO_VECTOR );
llSetCameraEyeOffset( ZERO_VECTOR );
llSitTarget( ZERO_VECTOR, ZERO_ROTATION );
llSetTextureAnim( FALSE , ALL_SIDES, 1, 1, 0, 0, 0.0 );
llStopSound();
llOwnerSay("This Prim is Clean... ");
llRemoveInventory( llGetScriptName() ); // vanish without a trace...
}
}
CODE
Skye Tracer
Registered User
Join date: 17 Nov 2006
Posts: 10
05-02-2008 09:19
What exactly does it do?
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
05-02-2008 09:34
It removes any properties scripts might have added to a prim or object, and then deletes itself.

Is sound really a prim property? I wasn't aware of that. But, that does jive with the OP's post!
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
05-02-2008 09:43
Lear's right. Prim properties are attributes that stick around in the prim even after the script that activated them is deleted (like particles and hovertext). They keep going until another LSL command is issued that deactivates them explicitly.

The scrubber script I gave you deactivates most of the prim properties that LSL can control, and then deletes itself. I use it as a quick reference if I forget the syntax to deactive a specific prim property; I don't usually use the whole thing.
.
Skye Tracer
Registered User
Join date: 17 Nov 2006
Posts: 10
05-02-2008 09:44
Cool. Thank-you, I'll give it a try. :)

I do have the llStopSound(); in there but the sound stops only when exiting the vehicle.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
05-02-2008 11:58
... and llSetTextureAnim() is REALLY sticky. It will persist even if you take it into your inventory and re-rez it. Hovertext and such will go away, but nothing short of calling a null llSetTextureAnim will stop an animated texture :)
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
05-02-2008 18:47
From: Johan Laurasia
... and llSetTextureAnim() is REALLY sticky. It will persist even if you take it into your inventory and re-rez it. Hovertext and such will go away, but nothing short of calling a null llSetTextureAnim will stop an animated texture :)


Good point that texture animation is a property that's missing from the script above.

In my experience, however, prim/object properties such as hovertext, sit targets, and particle systems do *not* go away when you take an object into your inventory and re-rez it. Many's the time I've used a set-text script that deletes itself immediately, and I have a lot of experience with sit targets.

However, shift-dragging an object to copy it will lose most or all of these object properties. Whether that applies to all of them, I couldn't say. It's easily tested.
Skye Tracer
Registered User
Join date: 17 Nov 2006
Posts: 10
05-02-2008 19:54
ok thanks. :)