Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Stupid UUID Question

BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
09-29-2009 11:38
I know I am missing the simplest thing here. I am attempting to communicate an objects UUID code to another object when it is rezzed. They can not be linked. So far, it has not recognized the message as a usuable UUID. My basic coding is:

Key target = "1234567890";

listen( etc etc)

target = message;

I've also tried target = (Key) message;

Though it sees the new UUID and will say it, it does not change the initial variable from the "123456 etc etc", which would make it a functional UUID for the program. Is there a trick to convert it to a valid recognizable UUID?

And on a second note, is there a way for a script to read a UUID into memory by simply clicking an object? I'm looking for the objects UUID, not the avatar's.

Thanks for any help
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-29-2009 11:51
You haven't got a line like

if (message = "1234567890";)

in there by any chance? The single "=" in a comparison has caught me out plenty of times.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-29-2009 11:52
target = (key)message should do the job, so long as you actually write "key" and not "Key," as you did in your note. Just be sure that the sending script is actually sending it right, as in .....

llRegionSay(-9978,(string)llGetKey()); // Or whatever channel you're communicating on
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
09-29-2009 12:08
In the listen you can also do something like llParseString2List( message, [], [] )
Then llList2Key( list, index ) will give you the key.
BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
09-29-2009 12:58
Thanks guys for such a quick response.

EF: Not using a comparison (but I've messed that up a few times)
Rolig: I added an llOwnerSay(target) to the receiving prim and it looks good - but I will check that "key" spelling just in case.
Ron: I hadn't tried that one yet - I'll give it a shot

Thanks again :)
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-29-2009 13:16
BTW...... llOwnerSay(target) will work if target is declared as a key, but it's wiser to write llOwnerSay((string)target). LSL treats keys as a special case of string variables ..... sometimes. To avoid unpredictable results, though, it's usually a good idea to cast them explicitly.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
09-29-2009 19:26
Sorry guys - but I am still doing something wrong here

Code in receiving object:

list UUIDCode=[];

listen( integer channel, string name, key id, string mesg )
{

if ( llStringLength(mesg) == 36 ) // check for the UUID of chase ball
{
// target = (key)mesg;

UUIDCode = llParseString2List(mesg, [], []);
target = llList2Key(UUIDCode,0);
llOwnerSay(target);
llOwnerSay((string)target);
----------------------------------
Output in chat:
Laser Ball: 9036003b-9f7a-96d3-821c-f865f1ce0bd4
Laser Ball: 9036003b-9f7a-96d3-821c-f865f1ce0bd4
----------------------------------
Code in sending object:

listen( integer channel, string name, key id, string message )
{

if (message == "lasers";)
{
// llSay( -29, (string) llGetKey());

llSay( -29, (string) llGetKey());
llOwnerSay((string) llGetKey());
---------------------
Output in chat:
Laser Chase Target: 9036003b-9f7a-96d3-821c-f865f1ce0bd4
---------------------
But it did not set the new target :(

Oh - and i did try the simple
target = (key)mesg; (didn't work either)

PLEASE HELP!!!
haha
Nexii Malthus
[Cubitar]Mothership
Join date: 24 Apr 2006
Posts: 400
09-29-2009 19:50
Got any filtering on the llListen?
llListen( -29, "", "", "" );// Listen for anything on -29

Other than that, I'm rather confused what is going on :P
_____________________

Geometric Library, for all your 3D maths needs.
https://wiki.secondlife.com/wiki/Geometric

Creator of the Vertical Life Client
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-29-2009 20:20
Well, the best guess is that you're simply outside of normal chat range. That's why I suggested using llRegionSay instead of llSay. If the receiving object is in another sim, even llRegionSay won't work, so you'll have to use e-mail.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
ab Vanmoer
Registered User
Join date: 28 Nov 2006
Posts: 131
09-29-2009 20:21
Ok I think you have to be a little clearer as to what the problem is or what you expect.

From: BB Inglewood

Code in sending object:
Output in chat:
Laser Chase Target: 9036003b-9f7a-96d3-821c-f865f1ce0bd4

From: BB Inglewood

Code in receiving object:
Output in chat:
Laser Ball: 9036003b-9f7a-96d3-821c-f865f1ce0bd4
Laser Ball: 9036003b-9f7a-96d3-821c-f865f1ce0bd4

To me it looks as if the receiving object is getting the code that was sent by the sending object, is that not what you wanted?
BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
09-30-2009 09:29
Okay, let me see if I can take these one at a time. What I am attempting to do is target a ball with laser beams. The reason for the transfer of the UUID is because if a copy is rezzed inworld, the target ball changes it's UUID code.

It all works great if I manually put the UUID code in the target variable, but if I drop off one number to "9036003b-9f7a-96d3-821c-f865f1ce0bd", in order to check the communications coding, it gets confused and no longer targets.

The target ball is easily within 20 meters of the lasers, and not in seperate sims.

The listen command is: llListen( -29, "", NULL_KEY, "" );

I know the laser is hearing it okay - because the llOwnerSay commands I stuck in are telling me the correct UUID it has received - it is just not changing the actual target key of "9036003b-9f7a-96d3-821c-f865f1ce0bd" to the correct "9036003b-9f7a-96d3-821c-f865f1ce0bd4" with the target = (key)mesg; command, or anything else I have tried.

I'm kinda glad you guys are as confused as me, cause it seemed like it should be so simple. Thanks again for the help. :)
BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
09-30-2009 09:59
Oh - and I don't have a problem with posting the whole code once I get home - if you don't mind seeing duct tape and bailing wire scripting :) I'll just have to clean up the 1000 or so //comments :)
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-30-2009 12:24
From: BB Inglewood
It all works great if I manually put the UUID code in the target variable, but if I drop off one number to "9036003b-9f7a-96d3-821c-f865f1ce0bd", in order to check the communications coding, it gets confused and no longer targets.

I don't understand why you would want to drop off one number. That makes no sense to me at all. Why not send the whole UUID?
From: someone
I know the laser is hearing it okay - because the llOwnerSay commands I stuck in are telling me the correct UUID it has received - it is just not changing the actual target key of "9036003b-9f7a-96d3-821c-f865f1ce0bd" to the correct "9036003b-9f7a-96d3-821c-f865f1ce0bd4" with the target = (key)mesg; command, or anything else I have tried.

I'm still confused. What do you mean by "the actual target key?" Whose key is that? And how is it not the same thing as the "correct" key? This should be a very simple task. The target ball's script should have an event that looks like this....

CODE

on_rez(integer start_param)
{
llRegionSay(-29,(string)llGetKey());
}


and the laser device should have code in it that looks like this...

CODE

// As a declared global variable ...
key target;

// in start_entry
llListen(-29,"","","");

// and later on ...
listen(integer channel, string name, key id, string message)
{
target = (key)message;
}


That's it. .... The whole thing. I don't know why it doesn't work for you. All I can imagine is that somewhere else in your script there's something you're calling the "actual target key" and you are replacing the "correct" key with it, undoing the work of receiving the target ball's UUID.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-30-2009 12:51
are you calling the particle system again after changing the target? it won't know the new target unless you do, otherwise i don't see why it wouldn't work.

and if the ball will always have the same name, the listen could be:

llListen(-29,"Chase Ball","","";);

that way it only responds to something called "Chase Ball" on channel -29
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
09-30-2009 13:08
Ahhhh.... I am beginning to see the problem, but I don't have the faintest idea why you are creating it. I've been puzzling over this business of "drop off one number to '9036003b-9f7a-96d3-821c-f865f1ce0bd', in order to check the communications coding." I have absolutely no clue why you would do that, but I think it's messing up your script royally. I bet that if you clean that bit out of your script, it will work just fine. After all, this really is a very simple business ... target ball says its UUID as it's rezzed, laser device hears and saves it.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
09-30-2009 21:01
I'm sorry that dropped character thing throws ya - I only did that to test it with a fixed UUID code to see if it worked - and then dropped one digit to test that it could read it. I tried to do everything suggested and still does not work unless I hard code the UUID into the laser code manually. To complicate things a bit from your advices, I think I can only listen to one channel, so the UUID has to be interpreted on the same channel that the normal commands are sent (I think). The command "GiveUUID" and "lasers" are sent on channel -31 through a hud. Here are the codes for the rest. Sorry for the novice work.

Target Object:

integer lA = -1; // listen handler on channel /1

integer iSteps = 30;
// How many steps the door will open in, used to provide the
// illusion of sliding. Fewer steps means it opens faster,
// but more steps will make it "slide" smoother.

float vOffset = -0.25;
// Indicates how far the door will move with each step relative to the local axis.
// Multiply by iSteps to calculate the total distance the
// door will move.

integer axis = 3;
//which local axis to move on, if not 1, 2, or 3 it uses the x axis
//1 is the x axis (forward/backward)
//2 is the y axis (left/right)
//3 is the z axis (up/down)

vector vBase;
// Used to "un-stick" the door if something blocks it.
// Not sure if this is needed since 0.5.1, objects don't
// seem to block the door any more. Leaving it in just
// in case, though. I think attempting to edit the door
// while it's moving may make it stick. This will solve
// that problem as well.

float fOpenTime = 0.5;
// How long the door stays open

integer bMove = FALSE;
// Is the door moving?

integer bLock = FALSE;
// Is the door locked?

integer bVerbose = FALSE;
// Confirm when owner locks/unlocks the door.

integer vOpen = TRUE;
//Is the door open?

integer i;
string running = "off";

open()
{
llSetTimerEvent(fOpenTime);
if (running == "on";) {

if(vOpen == FALSE)
{

llSetAlpha(0.0, ALL_SIDES); // set entire prim 100% invisible.//
integer X;
vector global = llGetPos();
vector local = llRot2Fwd(llGetRot());
if(axis == 2)
local = llRot2Left(llGetRot());
if(axis == 3)
local = llRot2Up(llGetRot());
for(X = 0; X < iSteps; X++)
{
llSetPos(llGetPos() + local*vOffset);
}
llSetPos(global + vOffset*iSteps*local);

vOpen = TRUE;
}
else if(vOpen == TRUE)
{

integer X;
vector global = llGetPos();
vector local = llRot2Fwd(llGetRot());
if(axis == 2)
local = llRot2Left(llGetRot());
if(axis == 3)
local = llRot2Up(llGetRot());
for(X = 0; X < iSteps; X++)
{
llSetPos(llGetPos() - local*vOffset);
}
llSetPos(global - vOffset*iSteps*local);
vOpen = FALSE;
}

}

}


default
{
on_rez(integer start_param) {
llOwnerSay((string)llGetKey());
llRegionSay( -30, (string) llGetKey());

}
state_entry()
{
llListen( -30, "", "", "" );
}
listen( integer channel, string name, key id, string message )
{

if (message == "lasers";)
{
if (running == "off";) {
running = "on";
open();
} else {
running = "off";
open();
}
}
else if (message == "GiveUUID";) {
llSay(-30,(string)llGetKey());
llOwnerSay((string)llGetKey());
}
}

timer() {

open();

}
}
/End Code
---------------
Laser Object:

//// "Glow" PARTICLE TEMPLATE v1 - by Jopsy Pendragon - 4/8/2008
//// You are free to use this script as you please, so long as you include this line:
//** The original 'free' version of this script came from THE PARTICLE LABORATORY. **//

// SETUP: Drop one optional particle texture and this script into a prim.
// Particles should start automatically. (Reset) the script if you insert a
// particle texture later on. Add one or more CONTROLLER TEMPLATES to any
// prims in the linked object to control when particles turn ON and OFF.

// Customize the particle_parameter values below to create your unique
// particle effect and click SAVE. Values are explained along with their
// min/max and default values further down in this script.

list known_asset_keys=[ <1.0,1.0,1.0>, <1.0,0.5,0.0>, <0.0,0.5,1.0>, <0.5,1.0,0.0>, <1.0,0.0,0.5>, <0.0,1.0,0.5> ];

key target = "";
//key target;

string laseron = "off";

integer ADD_CONTENTS = FALSE; // set to false to ignore textures in contents.
integer RANDOMIZE = FALSE; // set to false to cycle through texture in order.
float UPDATE_INTERVAL = 0.25; // # of seconds to wait before changing particle textures
integer num = 0;

string CONTROLLER_ID = "B"; // See comments at end regarding CONTROLLERS.
integer nextobject = 2;

integer AUTO_START = FALSE; // Optionally FALSE only if using CONTROLLERS.

integer num_textures; // # of textures in contents
list known_textures; // names found of textures in contents
integer current_texture; // tracks current texture when in sequential(non-random) mode.
integer current_texture2;
list particle_parameters=[]; // stores your custom particle effect, defined below.
list UUIDCode=[];
list target_parameters=[]; // remembers targets found using TARGET TEMPLATE scripts.
list other_texture=[];

get_texture_names() {
integer i;
known_textures = known_asset_keys;

num_textures += llGetListLength( known_asset_keys );

if ( ! RANDOMIZE && current_texture > num_textures ) current_texture = num_textures;
if ( ! RANDOMIZE && current_texture2 > num_textures ) current_texture2 = num_textures;
}

list pick_texture1() {
if ( RANDOMIZE )
return( [ PSYS_PART_START_COLOR, llList2Vector( known_textures, (integer)llFrand(llGetListLength
(known_textures) ) ), PSYS_PART_END_COLOR, llList2Vector( known_textures, (integer)llFrand(llGetListLength
(known_textures) ) )]);

else {
if ( num_textures ) current_texture = ( current_texture + 1 ) % num_textures;
if ( num_textures ) current_texture2 = ( current_texture2 + 2 ) % num_textures;

return( [ PSYS_PART_START_COLOR, llList2Vector( known_textures, current_texture ), PSYS_PART_END_COLOR,
llList2Vector( known_textures, current_texture2 )]);

}
}


default {
changed(integer change_type ) {
if ( ADD_CONTENTS && (change_type & CHANGED_INVENTORY) ) get_texture_names();
}

state_entry() {

llListen( -30, "", "", "" );
get_texture_names();
particle_parameters = [ // start of particle settings
// Texture Parameters:
PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0),
// PSYS_PART_START_SCALE, <0.1, .3, FALSE>, PSYS_PART_END_SCALE, <.1, 0.3, FALSE>,

PSYS_PART_START_ALPHA, (float)1,
PSYS_PART_END_ALPHA, (float)1,

// Production Parameters:
// PSYS_SRC_BURST_PART_COUNT, (integer)10,
PSYS_SRC_BURST_RATE, (float) 0.150,
// PSYS_PART_MAX_AGE, (float)1.0,
PSYS_SRC_MAX_AGE,(float) 0.0,

// Placement Parameters:
PSYS_SRC_PATTERN, (integer)8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,

// Placement Parameters (for any non-DROP pattern):
// PSYS_SRC_BURST_SPEED_MIN, (float)2.0, PSYS_SRC_BURST_SPEED_MAX, (float)2.0,
// PSYS_SRC_BURST_RADIUS, 0.1,

// Placement Parameters (only for ANGLE & CONE patterns):
// PSYS_SRC_ANGLE_BEGIN, (float) 0.15*PI, PSYS_SRC_ANGLE_END, (float)0.03*PI,

// PSYS_SRC_OMEGA, <0,0,0>,

// After-Effect & Influence Parameters:
PSYS_SRC_ACCEL, <0.0,0.0, -0.1 >,

//PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNumber() + 1),

PSYS_SRC_TARGET_KEY, target,

PSYS_PART_FLAGS, (integer)( 0 // Texture Options:
| PSYS_PART_INTERP_COLOR_MASK
| PSYS_PART_INTERP_SCALE_MASK
| PSYS_PART_EMISSIVE_MASK
| PSYS_PART_FOLLOW_VELOCITY_MASK
// After-effect & Influence Options:
// | PSYS_PART_WIND_MASK
// | PSYS_PART_BOUNCE_MASK
// | PSYS_PART_FOLLOW_SRC_MASK
// // | PSYS_PART_TARGET_POS_MASK
| PSYS_PART_TARGET_LINEAR_MASK
)
//end of particle settings
];

if ( AUTO_START ) {

other_texture = [PSYS_PART_START_SCALE, <.1, 2, FALSE>, PSYS_PART_END_SCALE, <.1, 2.0, FALSE>, PSYS_SRC_BURST_PART_COUNT,
(integer)5, PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_BURST_SPEED_MIN, (float)1, PSYS_SRC_BURST_SPEED_MAX, (float)7,
PSYS_PART_MAX_AGE, (float)1.0, PSYS_SRC_ANGLE_BEGIN, (float) 0.000*PI, PSYS_SRC_ANGLE_END, (float) 0.001*PI ]; //LaserBeam

llParticleSystem( particle_parameters + pick_texture1() + other_texture);
llSetTimerEvent(1.5);
}
}

listen( integer channel, string name, key id, string mesg )
{

if ( llStringLength(mesg) == 36 ) // check for the UUID of chase ball
{
target = (key)mesg;

//UUIDCode = llParseString2List(mesg, [], []);
//target = llList2Key(UUIDCode,0);
llOwnerSay(target);

}
if ( mesg == "lasers" ) // Message says to turn particles on and off
{
if ( laseron == "on" )
{
llParticleSystem( [] );
llSetTimerEvent(0.0);
laseron = "off";

} else {

other_texture = [PSYS_PART_START_SCALE, <.1, 2, FALSE>,
PSYS_PART_END_SCALE, <.1, 2.0, FALSE>, PSYS_SRC_BURST_PART_COUNT, (integer)5,
PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_BURST_SPEED_MIN, (float)1,
PSYS_SRC_BURST_SPEED_MAX, (float)7, PSYS_PART_MAX_AGE, (float)1.0,
PSYS_SRC_ANGLE_BEGIN, (float) 0.000*PI,
PSYS_SRC_ANGLE_END, (float) 0.001*PI ]; //Laser Beam

llParticleSystem( particle_parameters + pick_texture1() + other_texture);
llSetTimerEvent(1.5);
laseron = "on";
}

} else { // bad instruction number
// do nothing.

}
}

timer() {

llParticleSystem( particle_parameters + target_parameters + pick_texture1() + other_texture );

}
}

//== END ========
---------------------------
I guess I should have re-executed the AUTO_RUN feature to at least knock out that variable for testing. Just for clarification, the on_rez state did not work, so I added the additional command to simply send the UUID on command. I did not know if the on_rez executes on a simple script reset.

I agree with you this should be very simple, but for some reason is not :(

I'm missing something, and I'm beginning to feel like such a dipstick.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-30-2009 21:27
please post the code with php tags, it makes it much easier to read, otherwise, it looks like you are getting the new target, but not doing anything with it. cause the only time you're assigning the target to the particle parameters is in the state_entry, after that you're only re-using was was set, so simply changing the target key won't work, you will need to update the parameters with the new target

this should work, just moved some stuff around and added an update and on/off check for when you get the new uuid

CODE

//// "Glow" PARTICLE TEMPLATE v1 - by Jopsy Pendragon - 4/8/2008
//// You are free to use this script as you please, so long as you include this line:
//** The original 'free' version of this script came from THE PARTICLE LABORATORY. **//

// SETUP: Drop one optional particle texture and this script into a prim.
// Particles should start automatically. (Reset) the script if you insert a
// particle texture later on. Add one or more CONTROLLER TEMPLATES to any
// prims in the linked object to control when particles turn ON and OFF.

// Customize the particle_parameter values below to create your unique
// particle effect and click SAVE. Values are explained along with their
// min/max and default values further down in this script.

list known_asset_keys=[ <1.0,1.0,1.0>, <1.0,0.5,0.0>, <0.0,0.5,1.0>, <0.5,1.0,0.0>, <1.0,0.0,0.5>, <0.0,1.0,0.5> ];

key target = "";
//key target;

string laseron = "off";



integer ADD_CONTENTS = FALSE; // set to false to ignore textures in contents.
integer RANDOMIZE = FALSE; // set to false to cycle through texture in order.
float UPDATE_INTERVAL = 0.25; // # of seconds to wait before changing particle textures
integer num = 0;

string CONTROLLER_ID = "B"; // See comments at end regarding CONTROLLERS.
integer nextobject = 2;

integer AUTO_START = FALSE; // Optionally FALSE only if using CONTROLLERS.

integer num_textures; // # of textures in contents
list known_textures; // names found of textures in contents
integer current_texture; // tracks current texture when in sequential(non-random) mode.
integer current_texture2;
list particle_parameters=[]; // stores your custom particle effect, defined below.
list UUIDCode=[];
list target_parameters=[]; // remembers targets found using TARGET TEMPLATE scripts.
list other_texture=[];

updateparticles()
{
particle_parameters = [ // start of particle settings
// Texture Parameters:
PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0),
// PSYS_PART_START_SCALE, <0.1, .3, FALSE>, PSYS_PART_END_SCALE, <.1, 0.3, FALSE>,



PSYS_PART_START_ALPHA, (float)1,
PSYS_PART_END_ALPHA, (float)1,

// Production Parameters:
// PSYS_SRC_BURST_PART_COUNT, (integer)10,
PSYS_SRC_BURST_RATE, (float) 0.150,
// PSYS_PART_MAX_AGE, (float)1.0,
PSYS_SRC_MAX_AGE,(float) 0.0,

// Placement Parameters:
PSYS_SRC_PATTERN, (integer)8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,

// Placement Parameters (for any non-DROP pattern):
// PSYS_SRC_BURST_SPEED_MIN, (float)2.0, PSYS_SRC_BURST_SPEED_MAX, (float)2.0,
// PSYS_SRC_BURST_RADIUS, 0.1,


// Placement Parameters (only for ANGLE & CONE patterns):
// PSYS_SRC_ANGLE_BEGIN, (float) 0.15*PI, PSYS_SRC_ANGLE_END, (float)0.03*PI,

// PSYS_SRC_OMEGA, <0,0,0>,

// After-Effect & Influence Parameters:
PSYS_SRC_ACCEL, <0.0,0.0, -0.1 >,

//PSYS_SRC_TARGET_KEY, llGetLinkKey(llGetLinkNumber() + 1),


PSYS_SRC_TARGET_KEY, target,

PSYS_PART_FLAGS, (integer)( 0 // Texture Options:
| PSYS_PART_INTERP_COLOR_MASK
| PSYS_PART_INTERP_SCALE_MASK
| PSYS_PART_EMISSIVE_MASK
| PSYS_PART_FOLLOW_VELOCITY_MASK
// After-effect & Influence Options:
// | PSYS_PART_WIND_MASK
// | PSYS_PART_BOUNCE_MASK
// | PSYS_PART_FOLLOW_SRC_MASK
// // | PSYS_PART_TARGET_POS_MASK
| PSYS_PART_TARGET_LINEAR_MASK
)
//end of particle settings
];
}

get_texture_names() {
integer i;
known_textures = known_asset_keys;

num_textures += llGetListLength( known_asset_keys );

if ( ! RANDOMIZE && current_texture > num_textures ) current_texture = num_textures;
if ( ! RANDOMIZE && current_texture2 > num_textures ) current_texture2 = num_textures;
}

list pick_texture1() {
if ( RANDOMIZE )
return( [ PSYS_PART_START_COLOR, llList2Vector( known_textures, (integer)llFrand(llGetListLength
(known_textures) ) ), PSYS_PART_END_COLOR, llList2Vector( known_textures, (integer)llFrand(llGetListLength
(known_textures) ) )]);

else {
if ( num_textures ) current_texture = ( current_texture + 1 ) % num_textures;
if ( num_textures ) current_texture2 = ( current_texture2 + 2 ) % num_textures;

return( [ PSYS_PART_START_COLOR, llList2Vector( known_textures, current_texture ), PSYS_PART_END_COLOR,
llList2Vector( known_textures, current_texture2 )]);

}
}



default {
changed(integer change_type ) {
if ( ADD_CONTENTS && (change_type & CHANGED_INVENTORY) ) get_texture_names();
}

state_entry() {

llListen( -30, "", "", "" );

get_texture_names();

updateparticles();

if ( AUTO_START ) {


other_texture = [PSYS_PART_START_SCALE, <.1, 2, FALSE>, PSYS_PART_END_SCALE, <.1, 2.0, FALSE>, PSYS_SRC_BURST_PART_COUNT,
(integer)5, PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_BURST_SPEED_MIN, (float)1, PSYS_SRC_BURST_SPEED_MAX, (float)7,
PSYS_PART_MAX_AGE, (float)1.0, PSYS_SRC_ANGLE_BEGIN, (float) 0.000*PI, PSYS_SRC_ANGLE_END, (float) 0.001*PI ]; //LaserBeam

llParticleSystem( particle_parameters + pick_texture1() + other_texture);
llSetTimerEvent(1.5);
}

}

listen( integer channel, string name, key id, string mesg )
{

if ( llStringLength(mesg) == 36 ) // check for the UUID of chase ball
{
target = (key)mesg;
//UUIDCode = llParseString2List(mesg, [], []);
//target = llList2Key(UUIDCode,0);
llOwnerSay(target);
updateparticles();
if(laseron == "on" )
{
llParticleSystem( particle_parameters + pick_texture1() + other_texture);
llSetTimerEvent(1.5);
}
}

if ( mesg == "lasers" ) // Message says to turn particles on and off
{

if ( laseron == "on" )
{
llParticleSystem( [] );
llSetTimerEvent(0.0);
laseron = "off";

} else {

other_texture = [PSYS_PART_START_SCALE, <.1, 2, FALSE>,
PSYS_PART_END_SCALE, <.1, 2.0, FALSE>, PSYS_SRC_BURST_PART_COUNT, (integer)5,
PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_BURST_SPEED_MIN, (float)1,
PSYS_SRC_BURST_SPEED_MAX, (float)7, PSYS_PART_MAX_AGE, (float)1.0,
PSYS_SRC_ANGLE_BEGIN, (float) 0.000*PI,
PSYS_SRC_ANGLE_END, (float) 0.001*PI ]; //Laser Beam

llParticleSystem( particle_parameters + pick_texture1() + other_texture);
llSetTimerEvent(1.5);
laseron = "on";
}


} else { // bad instruction number
// do nothing.

}
}

timer() {

llParticleSystem( particle_parameters + target_parameters + pick_texture1() + other_texture );

}

}
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
10-01-2009 05:43
Thanks so much Ruthven, I will try it. Does the php tag serve another function other then to block out the code, like keep it straight or something?

I see what you mean about not doing anything with the updated target. I'm guessing I could have added the new target variable into the other_texture list and gotten the same update right? Thanks again so much you guys.
BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
10-01-2009 17:38
That did it :) I just knew I was missing something
Thanks everyone for the suggestions - they were all very good tips - you guys are the greatest

And now that I have you all buttered up - haha

Do you know of a way to get an object and pick up the names and UUID codes of everything within say 10m of it?
BB Inglewood
Registered User
Join date: 18 Jun 2008
Posts: 19
10-01-2009 18:11
hmmmm - another glass of wine - another epiphany - Sensor?