Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Changes to llDetectedKey() ?

Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-01-2005 12:28
Yesterday this code snippet worked, as did the whole package:

CODE

sensor(integer number) //Get the key of the target
{
victim=llDetectedKey(0);
particlesOn(); //Send the fog after them
llMessageLinked(LINK_THIS, 0, vicName, victim); //hand it on to the victim controller
}


Today the second script complains that the it can't request permissions from the supplied key. If I get it to say the key I get a null key response...

Any ideas if something's changed? Anyone else noticed it?

I know the wiki says it only grabs keys for objects, but yesterday it worked just fine, today, nothing.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
07-01-2005 13:05
If you're getting a permissions error, it's not comming from that bit of script. Nothing there that would require permissions.
_____________________
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-01-2005 13:11
Um, yes sorry. This piece if meant to be passing the key of the detected person to something else that asks for permissions.

The problem is here - it is returning a null key where yesterday it returned a valid key for the target. Hence the title of the post...
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
07-01-2005 13:37
Your going to have to make a test case (a complete script) that demonstrates this bug, currently it's to hard to figure out exactly what is going on.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-01-2005 14:47
This isn't the other one, that is something that I've written for someone else.

This one is what made me notice it:

CODE

integer effectFlags;
integer running=TRUE;

// Interpolate between startColor and endColor
integer colorInterpolation;
// Starting color for each particle
vector startColor;
// Ending color for each particle
vector endColor;
// Starting Transparency for each particle (1.0 is solid)
float startAlpha;
// Ending Transparency for each particle (0.0 is invisible)
float endAlpha;
// Enables Absolute color (true) ambient lighting (false)
integer glowEffect;
// Interpolate between startSize and endSize
integer sizeInterpolation;
// Starting size of each particle
vector startSize;
// Ending size of each particle
vector endSize;
// Turns particles to face their movement direction
integer followVelocity;
// Texture the particles will use ("" for default)
string texture;
// Lifetime of one particle (seconds)
float particleLife;
// Lifetime of the system 0.0 for no time out (seconds)
float SystemLife;
// Number of seconds between particle emissions
float emissionRate;
// Number of particles to releast on each emission
integer partPerEmission;
// The radius used to spawn angular particle patterns
float radius;
// Inside angle for angular particle patterns
float innerAngle;
// Outside angle for angular particle patterns
float outerAngle;
// Rotational potential of the inner/outer angle
vector omega;
// The minimum speed a particle will be moving on creation
float minSpeed;
// The maximum speed a particle will be moving on creation
float maxSpeed;
// Global acceleration applied to all particles
vector acceleration;
// If true, particles will be blown by the current wind
integer windEffect;
// if true, particles 'bounce' off of the object's Z height
integer bounceEffect;
// If true, particles spawn at the container object center
integer followSource;
// If true, particles will move to expire at the target
integer followTarget = FALSE;
// Desired target for the particles (any valid object/av key)
// target Needs to be set at runtime
key target;
integer pattern;
setParticles()
{

// The following block of if statements is used to construct the mask
if (colorInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_COLOR_MASK;
if (sizeInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_SCALE_MASK;
if (windEffect) effectFlags = effectFlags|PSYS_PART_WIND_MASK;
if (bounceEffect) effectFlags = effectFlags|PSYS_PART_BOUNCE_MASK;
if (followSource) effectFlags = effectFlags|PSYS_PART_FOLLOW_SRC_MASK;
if (followVelocity) effectFlags = effectFlags|PSYS_PART_FOLLOW_VELOCITY_MASK;
if (target!="") effectFlags = effectFlags|PSYS_PART_TARGET_POS_MASK;
if (glowEffect) effectFlags = effectFlags|PSYS_PART_EMISSIVE_MASK;
llParticleSystem([
PSYS_PART_FLAGS, effectFlags,
PSYS_SRC_PATTERN, pattern,
PSYS_PART_START_COLOR, startColor,
PSYS_PART_END_COLOR, endColor,
PSYS_PART_START_ALPHA, startAlpha,
PSYS_PART_END_ALPHA, endAlpha,
PSYS_PART_START_SCALE, startSize,
PSYS_PART_END_SCALE, endSize,
PSYS_PART_MAX_AGE, particleLife,
PSYS_SRC_ACCEL, acceleration,
PSYS_SRC_TEXTURE, texture,
PSYS_SRC_BURST_RATE, emissionRate,
PSYS_SRC_INNERANGLE, innerAngle,
PSYS_SRC_OUTERANGLE, outerAngle,
PSYS_SRC_BURST_PART_COUNT, partPerEmission,
PSYS_SRC_BURST_RADIUS, radius,
PSYS_SRC_BURST_SPEED_MIN, minSpeed,
PSYS_SRC_BURST_SPEED_MAX, maxSpeed,
PSYS_SRC_MAX_AGE, SystemLife,
PSYS_SRC_TARGET_KEY, target,
PSYS_SRC_OMEGA, omega ]);
}
// - Edit the values here to change the effect

ParticleFallsEffect()
{
//Color
colorInterpolation = FALSE;
startColor = <1.0, 1.0, 1.0>;
endColor = <0.5, 0.5, 0.8>;
startAlpha = .9;
endAlpha = 0.8;
glowEffect = TRUE;
//Size & Shape
sizeInterpolation = TRUE;
startSize = <0.2, 0.2, 0.0>;
endSize = <0.5, 0.5, 0.0>;
followVelocity = FALSE;
texture = "5e47a0dc-97bf-44e0-8b40-de06718cee9d";
//Timing
particleLife = 10;
SystemLife = 0.0;
emissionRate = 0.01;
partPerEmission = 10;
//Emission Pattern
radius = 1.0;
innerAngle = 1.0;
outerAngle = 0.0;
omega = <0.0, 0.0, 0.2>;
pattern = PSYS_SRC_PATTERN_EXPLODE;
// Drop parcles at the container objects' center
// PSYS_SRC_PATTERN_DROP;
// Burst pattern originating at objects' center
// PSYS_SRC_PATTERN_EXPLODE;
// Use 2D angle between innerAngle and outerAngle
// PSYS_SRC_PATTERN_ANGLE;
// Use 3D cone spread between innerAngle and outerAngle
// PSYS_SRC_PATTERN_ANGLE_CONE;
//Movement
minSpeed = 0.0;
maxSpeed = 0.1;
acceleration = <0.0, 0.0, 0.0>;
windEffect = FALSE;
bounceEffect = FALSE;
followSource = TRUE;
target = "";
// llGetKey() targets this script's container object
// llGetOwner() targets the owner of this script
//Particle Call
setParticles();
}

default
{
state_entry()
{
running=TRUE;
llSensorRepeat(llGetObjectDesc(), "", AGENT, 5, PI, 10);
}
sensor(integer number)
{
llSensorRemove();
target=llDetectedKey(0);
llSetTimerEvent(10.0);
ParticleFallsEffect();
}
timer()
{
llParticleSystem([]);
}
}

I think it should make the particles follow the target, but it doesn't. llOwnerSay((string)target); gives a string of zeroes wherever you put it.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
07-01-2005 15:14
I belive the llSensorRemove() may be blasting the llDetected*() info. Try using an llSensor() instead to do a one-shot peek.
_____________________
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
07-01-2005 15:56
Also "llSensorRepeat(llGetObjectDesc(), "", AGENT, 5, PI, 10);" will return a null key unless the object is named exactly as the person you are searching for appears, I think.
_____________________
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-01-2005 16:13
The sensor event fires OK, because I get the particles if the right person goes near the object.

I'll try the llSensorRemove though thanks, and report back.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
07-01-2005 16:25
From: Cid Jacobs
Also "llSensorRepeat(llGetObjectDesc(), "", AGENT, 5, PI, 10);" will return a null key unless the object is named exactly as the person you are searching for appears, I think.

I think that it fires the no_sensor() event, or does nothing if that event's not there. :p
_____________________
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
07-01-2005 16:31
From: Jillian Callahan
I think that it fires the no_sensor() event, or does nothing if that event's not there. :p

Well it does but if you are still usin the detected key i think it returns a null string. So i skipped a step in my explination but meh :p .
_____________________
Masakazu Kojima
ケロ
Join date: 23 Apr 2004
Posts: 232
07-01-2005 16:45
From: Eloise Pasteur
This isn't the other one, that is something that I've written for someone else.

This one is what made me notice it:

CODE
ParticleFallsEffect()
{
// ...
target = "";
//Particle Call
setParticles();
}
Pretty sure this is what's causing your problem.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-01-2005 17:45
The shifting of the sensor remove at least allows me to find the key and say it, so thanks Jillian.
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
07-01-2005 17:46
Oh good!

Next, Masakazu's post points out something important :D
_____________________