Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Targeting Particle Problem

Davis Woolley
Registered User
Join date: 26 Dec 2006
Posts: 23
03-27-2008 09:24
For some reason, I can't get my smoke to hit its target. I may have a contradictory script that is causing problems, but if so, I can't find it. Here is a copy of my script, the key listed is the key for the object that I am trying to target. I am still a basic scripter, so any kind of input will be helpful. Thanks in advance.

particlesys()
{
llParticleSystem([
PSYS_PART_FLAGS, PSYS_PART_EMISSIVE_MASK|PSYS_PART_INTERP_COLOR_MASK|PSYS_PART_TARGET_POS_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_PART_START_COLOR, <0.40000, 0.70000, 0.00000>,
PSYS_PART_END_COLOR, <0.20000, 0.60000, 0.30000>,
PSYS_PART_START_ALPHA, 1.000000,
PSYS_PART_END_ALPHA, 0.000000,
PSYS_PART_START_SCALE, <1.00000, 1.00000, 0.00000>,
PSYS_PART_MAX_AGE, 6.000000,
PSYS_SRC_ACCEL, <-1.00000, 0.00000, 1.00000>,
PSYS_SRC_ANGLE_BEGIN, .500000,
PSYS_SRC_ANGLE_END, 0.000000,
PSYS_SRC_BURST_PART_COUNT, 10,
PSYS_SRC_BURST_RATE, .000000,
PSYS_SRC_BURST_SPEED_MIN, 1.000000,
PSYS_SRC_BURST_SPEED_MAX, 2.000000,
PSYS_SRC_OMEGA, <0.00000, 0.00000, 0.00000>,
PSYS_SRC_TARGET_KEY, "ce57bccc-1827-a374-615c-6615f8349426"
]);
}

default
{
state_entry()
{
particlesys();
} }
Azwaldo Villota
Registered User
Join date: 10 Feb 2007
Posts: 7
cast string as variable type: key
03-28-2008 05:42
You are providing the PSYS_SRC_TARGET_KEY flag with a string, instead of a key. Try casting the string you have entered for the target as a key, early in the fxn's script:

key targ = "ce57bccc-1827-a374-615c-6615f8349426";

...then, use the key-type variable reference with the PSYS fxn:

PSYS_SRC_TARGET_KEY, targ

So, you would have this:

particlesys()
{
key targ = "1da92694-c8ab-ddcf-98ff-1ccea9978e88";
llParticleSystem([
PSYS_PART_FLAGS, PSYS_PART_EMISSIVE_MASK|PSYS_PART_INTERP_COLOR_MASK|PSYS_PART_TARGET_POS_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_PART_START_COLOR, <0.40000, 0.70000, 0.00000>,
PSYS_PART_END_COLOR, <0.20000, 0.60000, 0.30000>,
PSYS_PART_START_ALPHA, 1.000000,
PSYS_PART_END_ALPHA, 0.000000,
PSYS_PART_START_SCALE, <1.00000, 1.00000, 0.00000>,
PSYS_PART_MAX_AGE, 6.000000,
PSYS_SRC_ACCEL, <-1.00000, 0.00000, 1.00000>,
PSYS_SRC_ANGLE_BEGIN, .500000,
PSYS_SRC_ANGLE_END, 0.000000,
PSYS_SRC_BURST_PART_COUNT, 10,
PSYS_SRC_BURST_RATE, .000000,
PSYS_SRC_BURST_SPEED_MIN, 1.000000,
PSYS_SRC_BURST_SPEED_MAX, 2.000000,
PSYS_SRC_OMEGA, <0.00000, 0.00000, 0.00000>,
PSYS_SRC_TARGET_KEY, targ
]);
}

default
{
state_entry()
{
particlesys();
} }