Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Particle Target help

Rhaven Marx
Registered User
Join date: 15 Apr 2006
Posts: 6
04-20-2006 08:44
I have a particle system that is acting weird - I have the key of what I want to target, but whenever I execute the script, it targets me instead.

the system:
llParticleSystem( [
PSYS_PART_START_SCALE, <0.04,0.04,0.0>,
PSYS_PART_END_SCALE, <2.0,2.0,0.0>,
PSYS_PART_START_COLOR, <0.1,0.1,0.1>,
PSYS_PART_END_COLOR, <0.5,0.5,1.0>,
PSYS_PART_START_ALPHA, 1.0,
PSYS_SRC_TEXTURE, "f8e2c2f0-7d5e-bb9a-68d0-7a3e87984784",
PSYS_PART_END_ALPHA, 0.0,
PSYS_SRC_BURST_PART_COUNT, 1,
PSYS_SRC_BURST_RATE, 0.1,
PSYS_PART_MAX_AGE, 2.0,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_SRC_ACCEL, <0.0,0.0,-0.5>,
PSYS_SRC_BURST_SPEED_MIN, 1.5,
PSYS_SRC_BURST_SPEED_MAX, 1.7,
PSYS_SRC_ANGLE_BEGIN, 0.1,
PSYS_SRC_TARGET_KEY, targetkey,
PSYS_PART_FLAGS, ( PSYS_PART_EMISSIVE_MASK | PSYS_PART_WIND_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK ) ] );


The targeting code:
integer i;
llSay(0, "Detected " + (string)total_number + " active scripted objects";);
for (i = 0; i < total_number; i++)
{
llSay(0, "Detected " + llDetectedName(i) + ", Key: " + (string)llDetectedKey(i));
if ( llSubStringIndex(llToLower(llDetectedName(i)), targetname) != -1)
{
llSay(0, "Hello " + llDetectedName(i) + ", You've been targeted. Your key is " + (string)llDetectedKey(i));
targetkey = llDetectedKey(i);

vector pos = llDetectedPos(i);
rotation rot = llDetectedRot(i);
vector fwd = <0,0,0>;
fwd *= 0.0;
llRezObject("Crosshair P1", pos, fwd, rot, 1);
llRezObject("Crosshair P2", pos, fwd, rot, 1);
}
}



And of course, targetkey is defined as a global. Any ideas as to why this is happening?
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
04-20-2006 08:55
Well, you need to re-run the llParticleSystem whenever targetkey changes, it won't automatically update.
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
04-20-2006 08:57
Try adding

PSYS_PART_TARGET_POS_MASK or
PSYS_PART_TARGET_LINEAR_MASK

to tell it to follow the target.

(Thats what i would do)
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
04-20-2006 09:01
From: Adriana Caligari
Try adding

PSYS_PART_TARGET_POS_MASK or
PSYS_PART_TARGET_LINEAR_MASK

to tell it to follow the target.

(Thats what i would do)

*slaps forehead*

oh yeah, um, missed that
Rhaven Marx
Registered User
Join date: 15 Apr 2006
Posts: 6
04-20-2006 18:48
Ah, thanks - that solved the problem :-)