Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Touch on/off for particle script?

Jincey Firefly
IC of Assize for Bubbles
Join date: 13 Jul 2004
Posts: 83
03-10-2005 21:29
I'd like to be able to touch an object and have it trigger the particle script inside on and off.

Is it even possible?
JustAnother Millhouse
Registered User
Join date: 26 Dec 2004
Posts: 31
03-10-2005 21:39
without compiling something to the effect of:
CODE


integer psystemrunning = FALSE;

default()
{
touch_start(int n)
{
if(!psystemrunning)
{
// start your psystem here
llParticleSystem([PSYS_PART_FLAGS, PSYS_PART_WIND_MASK | PSYS_PART_EMISSIVE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_START_COLOR, <1,0,0>]);
psystemrunning = TRUE;
}
else
{
llParticleSystem([])
// clear your psystem here
psystemrunning = FALSE;
}
}
}




Hope this helps

JA
Jincey Firefly
IC of Assize for Bubbles
Join date: 13 Jul 2004
Posts: 83
Thanks JA!
03-10-2005 21:42
I'm on my way to test it out right now!
Jincey Firefly
IC of Assize for Bubbles
Join date: 13 Jul 2004
Posts: 83
Syntax Error Returned (4, 16)
03-10-2005 21:49
I get an error for this line:
touch_start(int n)
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
03-10-2005 21:50
one lil thing....... it's default { not default() {

also you might want to put......

CODE
state_entry() {
psystemrunning = FALSE;
llParticleSystem([]);
}

.......inside default just to be tidy. :D
_____________________
Zuzi Martinez: if Jeska was Canadian would she be from Jeskatchewan? that question keeps me up at nite.
Jeska Linden: That is by far the weirdest question I've ever seen.
Jincey Firefly
IC of Assize for Bubbles
Join date: 13 Jul 2004
Posts: 83
Thank you both so much!
03-10-2005 22:07
I got it, and it works great! :D

In addition to Zuzi's excellent advice I changed:

else
{
llParticleSystem([])
// clear your psystem here
psystemrunning = FALSE;

To:

else
{
llParticleSystem([]);
// clear your psystem here
psystemrunning = FALSE;
JustAnother Millhouse
Registered User
Join date: 26 Dec 2004
Posts: 31
03-11-2005 14:43
From: Jincey Firefly
I get an error for this line:
touch_start(int n)

Sorry about that, didn't get a chance to login and actually bugtest that.