Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Making copies of targeting particle emitters

Jonar Boa
Registered User
Join date: 3 Mar 2007
Posts: 9
09-23-2007 03:45
Hello

I built an object with some particle effects. Works perfect. When i take a copy of the objects, to rezz it in another place, all emitters with a target dont work anymore. I target with object names, not keys (not linked).


string targetname = "Laser1";

default {

state_entry() {
llParticleSystem( [ ] ); // no target, make sure particles are off!
llSensor( targetname, "", PASSIVE, 10.0, TWO_PI );

}

touch_start(integer n) {
llSensor( targetname, "", PASSIVE, 10.0, TWO_PI );
}

sensor(integer number_of_matches) {
llParticleSystem( [
PSYS_PART_FLAGS, 354,
PSYS_SRC_PATTERN, 8,
PSYS_PART_START_ALPHA, 1.00,
PSYS_PART_END_ALPHA, 0.00,
PSYS_PART_START_COLOR, <1.00,1.00,0.00>,
PSYS_PART_END_COLOR, <1.00,1.00,0.00>,
PSYS_PART_START_SCALE, <0.10,0.52,0.00>,
PSYS_PART_END_SCALE, <0.10,10.00,0.00>,
PSYS_PART_MAX_AGE, 3.50,
PSYS_SRC_MAX_AGE, 0.00,
PSYS_SRC_ACCEL, <0.00,0.00,0.00>,
PSYS_SRC_ANGLE_BEGIN, 2.55,
PSYS_SRC_ANGLE_END, 2.62,
PSYS_SRC_BURST_PART_COUNT, 5,
PSYS_SRC_BURST_RADIUS, 2.75,
PSYS_SRC_BURST_RATE, 0.10,
PSYS_SRC_BURST_SPEED_MIN, 4.30,
PSYS_SRC_BURST_SPEED_MAX, 4.30,
PSYS_SRC_OMEGA, <0.00,0.00,0.00>,
PSYS_SRC_TEXTURE, "fe9ecdac-e879-d852-4e8f-03fdcd7b442b",
PSYS_SRC_TARGET_KEY, llDetectedKey(0) ]);
}

no_sensor() {
// do nothing
}

on_rez(integer n) { llResetScript(); }
}


I used a template from Jopsy's great Paricle Lab.

Id be really glad for a hint .

Thanks
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
09-23-2007 05:41
It worked for me... both from inventory, and shift-copy.

Are you sure the new location has scripts enabled for you?
Jonar Boa
Registered User
Join date: 3 Mar 2007
Posts: 9
09-24-2007 00:19
Tks for the reply

It seems to be a kind of timing problem.

My object has 9 prims, and every prim has such a script in it.

I rezzed it twice, close together. The 2nd one immediately targeted the 1st already rezzed one.

My solution was, recopy each script after rezzing.

Worked perfect.