• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-768
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: kelly linden
Reporter: BamBam Sachertorte
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

(HAVOK4) llCreateLink(target, TRUE) inserts child prim in wrong place in linkset

Created: 04/Oct/07 10:41 AM   Updated: 21/Dec/07 12:21 PM
Return to search
Component/s: Physics
Affects Version/s: Havok4 Beta
Fix Version/s: Havok4 Beta

Issue Links:
Relates
 

Linden Lab Issue ID: DEV-4296


 Description  « Hide
When an object calls llCreateLink to link another prim to the object as a child prim the child prim is added to the end of the linkset. The previous behavior was that the child prim was inserted at link number 2 and all of the other child prims were moved to ther next higher link number.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Strife Onizuka added a comment - 05/Oct/07 09:09 PM
The wiki page for llCreateLink is incomplete in it's description of the workings of the function.

BamBam Sachertorte added a comment - 05/Oct/07 10:24 PM
In the absence of a formal definition, the existing implementation defines the function. The wiki page should document what the main grid does. What else can we do? Shall I update the llCreateLink page on the wiki?

Ryozu Kojima added a comment - 06/Oct/07 02:28 AM
No arguments here. One of the stated goals of the Havok4 beta is to identify behavior that is different from the main grid (Whether that behavior is documented as intended or not,) to avoid breaking existing content.

This repro's a little complicated, but here goes.

1) Create 3 prims, Name the prims "RootPrim", "FirstChild", and "NewChild" exactly as shown, without quotation marks. (Otherwise, scripts will fail =P)

2) In the prim "RootPrim" copy and paste the following as a new script and grant permission to change links when the script asks to do so.
/////
default
{
state_entry()

{ llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS); llListen(0, "NewChild", NULL_KEY, "linkme"); }

changed(integer change)
{
if (change & CHANGED_LINK)
{ llOwnerSay((string)llGetLinkNumber()); }
}
listen(integer channgel, string name, key id, string msg)
{
if (llGetPermissions() & PERMISSION_CHANGE_LINKS)
{ llCreateLink(id, TRUE); }
}
}
////

3) Copy and paste the following script as a new script in the "FirstChild" prim.
///
default
{
changed(integer change)
{
if (change & CHANGED_LINK)
{ llOwnerSay((string)llGetLinkNumber()); } }
}
}
////

4) Link the "FirstChild" the "RootPrim" with "RootPrim" as the root.
[2:10] RootPrim: 1
[2:10] FirstChild: 2

5) Copy and paste the following as a new script into "NewChild"
///
default
{
changed(integer change)
{
if (change & CHANGED_LINK)

{ llOwnerSay((string)llGetLinkNumber()); }

}
touch_start(integer total_number)

{ llSay(0, "linkme"); }

}
///

6) Click "NewChild"
Observed:
[2:25] NewChild: linkme
[2:25] NewChild: 3
[2:25] RootPrim: 1
Expected
[2:25] NewChild: linkme
[2:25] NewChild: 2
[2:25] RootPrim: 1

At least, I THINK that's how it used to work.....


BamBam Sachertorte added a comment - 06/Oct/07 09:11 AM
Thank you Ryozu for the excellent reproduction example. Now I see how to post bugs.

I Tried your setup on the main grid and the results were:
[9:07] NewChild: linkme
[9:07] FirstChild: 3
[9:07] NewChild: 2
[9:07] RootPrim: 1

So new child prims are definitely inserted at link position 2 on the main grid.


kelly linden added a comment - 23/Oct/07 11:48 AM
This is somewhat difficult to fix and I think the old way is less intuitive than the new.

Basically what you have is 1 link set: 1-2-3 which you are linking another object to: 4. In havok4 we link the entire first set (1-2-3) with the other piece to create (1-2-3)-4. In havok1 the original link set is 'broken', the link order of all pieces changes relative to each other and the new piece is inserted into the middle of the link order.

So, while I understand 'this is the way it works currently', I'm wondering how important it is to maintain that behavior? Does anyone have examples of content broken by this change? Given the fact that it changes all the link numbers I could only imagine that objects using llCreateLink must do some link number detection on change or similar.


BamBam Sachertorte added a comment - 23/Oct/07 12:30 PM
I discovered this bug while trying to figure out why my content was broken under havok4. I make flowers that rez the petals, link them to the flower body, and then manipulate the petals or send messages to scripts in particular child prims. So all my content assumes that the link order of the child prims is the reverse of the rez order.

If it were just me then I would rather keep the new behavior and fix my content. The existing behavior is better than the havok1 behavior and none of the content that I have already sold will be affected. But I'm sure that there is other content that also depends on the link order after llCreateLink.


BamBam Sachertorte added a comment - 23/Oct/07 12:48 PM
To answer your question more directly, Kelly: although the havok1 behavior is strange, it is also very predictable. It is possible to create content that depends on link order after calling llCreateLink without doing any link number testing. I have done so with lots of content and that content is all broken on the beta grid.

kelly linden added a comment - 23/Oct/07 05:49 PM
Fixed internally, should have the right link order next havok4 beta update.

This actually effects ALL link order operations, not just llCreateLink.

Repro to test on Agni and future havok4 beta updates (no big scripts required!)

Repro:
1. Create a box and put the following script on it
default
{
changed(integer c)

{ llSetText((string)llGetLinkNumber(),<1,1,0>,1); }

}
2. Shift drag to make 4 copies of this box in a line (so there are 5 boxes total).

  • These boxes will be called: [a]-[b]-[c]-[d]-[e]
    3. Shift select [c]-[d]-[e] (in left to right order so [e] is root) and link them.
    4. Shift select [a]-[b] (in left to right order so [b] is root) and link them.
    5. Select the [a]-[b] link set, then shift click the [c]-[d]-[e] link set and link them
  • Verify the link order (as displayed above the boxes) is: 32541 (crazy, I know)

Torley Linden added a comment - 21/Dec/07 12:21 PM
========-
Fixed in Havok4 Beta – for news & updates on the Official Linden Blog, see:

» http://blog.secondlife.com/category/beta-test-grid/
========-