Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

specific uuid addressing

Beigeman Teardrop
Registered User
Join date: 13 Aug 2008
Posts: 7
09-03-2008 07:02
Hi All

I am using the following script.

vector offset = < 0, 0, 1>; //1 meter behind and 1 meter above owner's center.

default
{
state_entry()
{
llSetStatus(STATUS_PHYSICS | STATUS_PHANTOM, TRUE);
// Little pause to allow server to make potentially large linked object physical.
//llSleep(0.1);
// Look for owner within 20 metres in 360 degree arc every 1 seconds.
llSensorRepeat("Beigeman Teardrop", llGetOwner(), AGENT, 20.0, PI,0.1);
llTargetOmega(<0,1,0>,PI,0.3);

}
sensor(integer total_number)
{ // Owner detected...
// Get position and rotation
vector pos = llDetectedPos(0);
rotation rot = llDetectedRot(0);
// Offset back one metre in X and up one metre in Z based on world coordinates.
// use whatever offset you want.
vector worldOffset = offset;
// Offset relative to owner needs a quaternion.
//vector avOffset = offset * rot;

pos += worldOffset; // use the one you want, world or relative to AV.

llMoveToTarget(pos,0.1);
}
}

I would like to hardcode the UUID for the object/avatar i want my prims to follow

Is this possible?
How do i find UUID's

Cheers
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
09-03-2008 08:15
Sure it's possible. Here is your follower script without sensor.

key Owner;
vector Offset = <0.0, 1.0, 1.0>

default
{
state_entry()
{
Owner = llGetOwner(); // Here is your own UUID
llSetStatus(STATUS_PHYSICS | STATUS_PHANTOM, TRUE);
llSetTimerEvent(0.3);
}

timer()
{
list tempo = llGetObjectDetails(Owner, [OBJECT_POS, OBJECT_ROT]);
llMoveToTarget(llList2Vector(tempo, 0) + (Offset * llList2Rot(tempo, 1)), 0.1);
}
}
Beigeman Teardrop
Registered User
Join date: 13 Aug 2008
Posts: 7
09-03-2008 09:03
Excellent, thankyou for the reply.

I am still unsure as to using the UUID figures.
in your script you use Owner = llGetOwner

which i guess puts the prim's owner's UUID into the variable Owner.

If i wanted it to follow a prim who's movement was automated then would i use

Owner = *****UUID****

and if that is so how would i obtain the prims UUID inorder to 'hardcode' it into the script



I hope i am approaching this the right way I am very new to all this
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-03-2008 09:37
http://wiki.secondlife.com/wiki/LlGetKey

the problem with that is, each time you rez an object, it's uuid changes, so it might be helpfull to rezz the follower from the object it's following and using the rez params to tell it to listen to a specific channel. after rezzing the follower, the followed object would then say it's key on the specified channel, the follower would "hear" that key, and use it in the target field
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-03-2008 09:43
If you know the name of the object being followed, you could do a sensor on it. In the sensor() event, just use llDetectedKey to get the key/UUID..
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
09-03-2008 09:48
From: Beigeman Teardrop

If i wanted it to follow a prim who's movement was automated then would i use

Owner = *****UUID****

and if that is so how would i obtain the prims UUID inorder to 'hardcode' it into the script
Put his in the prim you want the UUID for and it will tell you:

default
{
state_entry()
{
llSay( PUBLIC_CHANNEL, (string)llGetKey());
}
}
_____________________
From Studio Dora
Beigeman Teardrop
Registered User
Join date: 13 Aug 2008
Posts: 7
09-03-2008 10:02
Hi Kaluura

I tried to use the script you posted (copied and pasted it) but i get a syntax error message (3,0)

can't work out why as the line is blank

what did i do wrong?
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
09-03-2008 10:22
There's no semicolon after the vector literal:

CODE

vector Offset = <0.0, 1.0, 1.0> // <- Here
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
09-03-2008 11:11
From: Ruthven Willenov
http://wiki.secondlife.com/wiki/LlGetKey

the problem with that is, each time you rez an object, it's uuid changes, so it might be helpfull to rezz the follower from the object it's following and using the rez params to tell it to listen to a specific channel. after rezzing the follower, the followed object would then say it's key on the specified channel, the follower would "hear" that key, and use it in the target field


Another idea is to have the follower rez the object to be followed, then you can get the key from the object_rez event.
Beigeman Teardrop
Registered User
Join date: 13 Aug 2008
Posts: 7
09-03-2008 11:58
I haven't got as far as rezing objects yet, i would like to learn how to do it.

For example i would like to have something that rezzes a prim knows that it still exists and when it no longer exists rez another.

say for example:

A pedastal rezzes a bot (i guess you can rezz an object you have already created or do you have to rez and model the object on the fly?) the bot is then free to move around the sim (and maybe cross into other sims) engaging people in polite conversation. If it traversed a no script zone or something that switches it of then the pedastal will re-rez it at base.

This is by no means meant for griefing but would be used for an education provision purpose.

I understand there is a lot to do here with movement, not acting in a rude fashion when approaching sensed avatars, path finding if the bot is physical (wouldn't want to enter a building like a ghost) amongst a thousand other hurdles.

What i am currently working on is a logo to replace the avatar (invisiprims, and tiny anim to hide original avatar + multiple prim logo as follow object, which is great if someone is stearing the avatar but as i said eventually i would like the logo to follow a semi-autonomous bot that can draw conversational responses from an external database.

Would anyone like to throw some input into this or direct to good sources for me to learn from.
Beigeman Teardrop
Registered User
Join date: 13 Aug 2008
Posts: 7
09-04-2008 03:14
Hi Kaluura

Okay

I tried the script once again with a semicolon after the vector variable but still it doesn't want to work, the prim drops like a deadweight straight to the ground and then doesn't move.

what am i doing wrong?
Shyan Graves
Registered User
Join date: 10 Feb 2007
Posts: 52
09-04-2008 06:19
Hi,

I would say you have to remove the STATUS_PHYSICS from this line:

From: someone
llSetStatus(STATUS_PHYSICS | STATUS_PHANTOM, TRUE);


because physical objects tent to fall when they are in the air! Newtons law!;)
I could be wrong but I would give it a try :)

Regards,
Shyan