Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llCreateLink appears not to work

Jay Karlfeldt
Happy Scripter
Join date: 4 Nov 2005
Posts: 51
08-19-2007 03:13
I have two object which approach each other touch and then one receives the UUID of the other and performs the llCreateLink Function. But it never links, I have checked the UUID and it is correct. I do not want to rezz a new object which is what most posts on llCreateLink seem to do, I simply have the UUID of an object and I wish to link them when they are in close contact. Anyone any ideas?

llCreateLink( llList2Key(data,1), TRUE);

The list contains the UUID in index 1, I have checked that by showing it in chat.
Altern8 McMillan
Registered User
Join date: 27 Mar 2007
Posts: 36
08-19-2007 03:40
Are both objects owned by you?
Are both objects modify?
Is permission triggered?
What's the objects dimensions?
Are they maybe too far away from each other?

greetz

A8
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
08-19-2007 08:31
Try this:

llCreateLink((key)llList2String(data,1), TRUE);

Sometimes list to key or rotation won't work properly, while list to string then converting to key or rotation does... guess it's just another bug...
Hg Beeks
llGetElement(80);
Join date: 13 Apr 2006
Posts: 134
08-19-2007 11:55
The prim doing the linking requires
llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);
to allow it to add prims to itself.
Jay Karlfeldt
Happy Scripter
Join date: 4 Nov 2005
Posts: 51
Problem still there
08-19-2007 13:10
Tried all of the above suggestions and checks before I came to ask, but thank you for your help. Program terminates by design after 10 seconds doing nothing else in the meantime. Anybody anymore ideas?
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
08-19-2007 15:58
From: Jay Karlfeldt
Tried all of the above suggestions and checks before I came to ask, but thank you for your help. Program terminates by design after 10 seconds doing nothing else in the meantime. Anybody anymore ideas?


Do a request permissions, and move the create link call to the permissions event.

I know it works, because I've done it.

I had to write something like this to rescue an object of mine that I'd accidentally moved underground.

IM me in game if you want the sample. Or I'll try to copy it from in game and post it here later.
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
08-19-2007 16:39
Here's the script I used to rescue a lost object. Since it was a one-shot deal, I used sensor to get the key, and then just hardcoded the key into the function.

Obviously I could have improved the script to make it much cleaner to use, but it was just a quick and dirty script.

default
{
state_entry()
{
llSay(0, "Hello, Avatar!";);
}

touch_start(integer total_number)
{
llSay(0, "Touched.";);
llSensor("Object", NULL_KEY, ACTIVE|PASSIVE|SCRIPTED, 20, TWO_PI);
llOwnerSay("owner key = " + (string)llGetOwner());
}

sensor(integer num_detected)
{
key id;
integer i;
for (i = 0; i<num_detected; i++)
{
id = llDetectedKey(i);
llOwnerSay("object name = " + llKey2Name(id) + "| " + (string)id + "| " + (string)llDetectedOwner(i));
}
llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS );
}

run_time_permissions(integer perm)
{
llCreateLink("ff89d60d-efe6-0d67-c5c0-0448a3ca4795", 0);
}
}
Jay Karlfeldt
Happy Scripter
Join date: 4 Nov 2005
Posts: 51
Tried again with simple script
08-19-2007 19:59
I tried the Create Link, if I use the actual string in the llCreateLink it works and performs the link.
However this simple pair of scripts refuse to work
Sphere containing the following script, inside cube

default
{
touch_start(integer total_number)
{
llSay(-123, (string) llGetKey());
llSay(0,(string)llGetKey());
}
}

Cube contains the following script

default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_CHANGE_LINKS );
}
run_time_permissions(integer perm)
{
llListen(-123, "", NULL_KEY,"";);
}
listen( integer channel, string name, key id, string message )
{
llSay(0,message);
llCreateLink( (key) message, TRUE);
llSay(0,"Past Change";);
llSetTimerEvent(10);
}
changed(integer change) { // something changed
llSay(0,"Entering Changed";);
if (change & CHANGED_LINK)
{
llSay(0,"Change_link";);
llOwnerSay("Linked";);
}
else llSay(0,"Not Change_Link";);
}
timer()
{
//llRemoveInventory(llGetScriptName());
}
}

Output
Sphere: 8e0d45ee-be8a-31bd-74a4-6894db04f302
Cube: 8e0d45ee-be8a-31bd-74a4-6894db04f302
Cube: Past Change

That's it no Create Link no change link to sphere.
Both are modify, owned by me.
Anybody got any ideas why llCreateLink does not work?
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
08-20-2007 11:33
hmm. Can you try having it get the permissions and printing it to the owner in the listen event, just before the create link?

integer perms = llGetPermissions();
if (perms & PERMISSION_CHANGE_LINKS)
llOwnerSay("permission exists to link";)
else
llOwnerSay("permission does not exist to link";)