Jump to content

Linking items without breaking the link order


Sean Azambuja
 Share

You are about to reply to a thread that has been inactive for 2232 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am trying to link a sailboat with a small rubber inflatable boat using a linkset script  https://marketplace.secondlife.com/p/Nikkis-ReLink/7285637?page=1# 

Everything works great until it says,   •Wait before you get the Permissions Request and accept it."

Please tell me where i can "you get the Permissions Request and accept it.

Where do i "accept permission request"??? I am in SL viewer btw

 

 

Let's go, Step by Step:
        
    • Rez your Object (A) where you want to add Objects without breaking the Link Order.
    
    • Rightclick your Object, navigate through the Piemenu and choose "Stop all scripts."
    
    • Rez the Objects (B) you want add to the Linkset.
     
    • Be sure your object A and object(s) B are not physical enabled atm :-)
    
    • Add to any object B you want to add the ReLink (PhysicsShape: ...) Scripts. (Only in the root prim)
        - If you have a Mesh and want not collide with, use PhysicsShape: None
        - If you have a Mesh and want collide with is, use PhysicsShape: Convex
        - If you don't have a Mesh use PhysicsShape: Prim
        
        I highly recommend to not mix Prim with None/Convex. In that case you should
        set any "Prim" to Convex or None.
        
    • Repeat the last two steps with any Object you want to add.
    
    • Move your new Objects B into position (Can be done later too)
    
    • Drop the ReLink (Master) into Object A
    
    • Wait before you get the Permissions Request and accept it.?????????????? 
    
    • The Link will be breaked and relinked in Order, this Process can take up to some minutes.
    
        After this process is done, all ReLink scripts are removed.
    
    • Rightclick your Object, navigate through the Piemenu and choose "Reset scripts."
        
        This step is optional, in fact that the link order is not changed, scripts will work properly
        after the linking state when setting them on running state again. But some scripts does
        initialization things on resetting what depends on the number of Objects in the Linkset,
        so i recommend, to reset the script's always.
    
    • Rightclick your Object, navigate through the Piemenu and choose "Run scripts."
    
    • Test your Thingy, to be sure all works fine.
    
    • Take a copy :-)

Link to comment
Share on other sites

The permissions request is a dialog menu that pops up in your screen, just like the PERMISSIONS_TRIGGER_ANIMATION request that you must have seen.

I'm not familiar with the scripts to which you refer, but the instructions suggest that what "ReLink (Master)" script calls llRequestPermissions(llGetOwner(),PERMISSION_CREATE_LINK) either in state_entry() or (possibly) in the listen event after pinging the ReLink (PhysicsShape: ...) scripts in the target objects.  

Anyway, wherever it calls it, that's what generates the request dialog.   

So, things to check would be are you on a parcel where you can run scripts and do you own the objects (i.e. they're not group owned).   Also, of course,  are sure you put the ReLink (PhysicsShape: ...) scripts in the target objects (that's the sort of thing I forget to do).   

If none of those work, I think you will have to ask the script's creator for some help.  Or ask here for help  writing your own script to do this -- it's not too difficult.

  • Like 4
Link to comment
Share on other sites

I am not sure what you do there...

I link with the building tools and it works fine with me when I add new stuff to each other. I even added AV-Sitter scripts for furniture items into my boat. I see some possible problems in what you are up to: two conflicting vehicle scripts and the combined physical meshes could exceed vehicle maximum.

Does order need to be preserved? You can test this very simply: Link a cube to your boat and take it for a ride... if it works don't use the complicated script ;)

Link to comment
Share on other sites

30 minutes ago, Fionalein said:

Does order need to be preserved?

It shouldn't matter if any other scripts the object contains that call functions like llSetLinkPrimitiveParams* have been written properly, so they check target links by name or description, and take the link numbers from those, rather than having the link numbers hard-coded in the scripts.   But a surprising number of people don't know how to/don't bother to do that.

  • Like 1
Link to comment
Share on other sites

And in the changed event, too, of course.

In case people are wondering what we're talking about, if I need to identify particular prims in a build I create global variables with meaningful names, and then loop through the linkset in the state_entry, on_rez and changed events, checking the link numbers.   That way I can forget about link numbers completely, and know that  no matter how many times I relink the build, the script always knows that iButton1 is the link number of the prim with "Button1" as its description field.

Something like this:

integer iButton1;
integer iButton2;
integer iButton3;

string strButton1 = "Button1";
string strButton2 = "Button2";
string strButton3 = "Button3";

findPrims(){
    integer max = llGetNumberOfPrims() +1;
    integer counter = 1;
    do{
        string str = llList2String(llGetLinkPrimitiveParams(counter, [PRIM_DESC]),0);//read the link description
        if(strButton1 == str){//if it's "Button1"
            iButton1 = str; //assign that link number to iButton1
        }
        else if(strButton2 == str){
            iButton2 = str;
        }
        else if(strButton3 == str){
            iButton3 = str;
        }
    }
    while(++counter < max);
}

default{
    state_entry() {
        findPrims();
    }

    on_rez(integer start_param) {
        findPrims();
    }

    changed(integer change) {
        if(change & CHANGED_LINK){
            findPrims();
        }
    }
}

 

  • Thanks 3
Link to comment
Share on other sites

10 hours ago, Sean Azambuja said:

I am trying to link a sailboat with a small rubber inflatable boat using a linkset script  https://marketplace.secondlife.com/p/Nikkis-ReLink/7285637?page=1# 

Everything works great until it says,   •Wait before you get the Permissions Request and accept it."

Please tell me where i can "you get the Permissions Request and accept it.

Where do i "accept permission request"??? I am in SL viewer btw

-SNIP-

3

You know that little box in the top-right of your screen that appears when someone wants to hug you can you have to say YES. Or when you buy something and it says you've spent xxL$ and you click OK? That's what you will see: the same little box asking permissions. Just say YES and you're good to go.

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Innula Zenovka said:

And in the changed event, too, of course.

Well if it changes, otherwise I'd just rely on people relinking stuff to remember restarting scripts =^.^= (if you intend to sell it that's a good point though)

Link to comment
Share on other sites

Just now, Fionalein said:

Well if it changes, otherwise I'd just rely on people relinking stuff to remember restarting scripts

Maybe it's just me, but I never cease to be amazed at what, particularly when I'm tired, I can forget to do and how I sometimes overlook the most obvious things and then spend hours looking for the error that's staring me in the face.

Personally, I find it safest to try to build in as many safeguards against my own oversights as I can.    

 

  • Like 3
Link to comment
Share on other sites

I am familiar with the "relink" script the OP speaks of.

Though here's the "manual" way to do it and it works for me 95% of the time:

  • Edit the linkset, unlink the root prim. 
  • Position the add-on to where you want it linked to.
  • Select, in this order: Add-on, Linkset, Root Prim
  • Link.

This *usually* keeps all link numbers of the linkset in their proper order.

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

4 hours ago, Alyona Su said:

I am familiar with the "relink" script the OP speaks of.

Though here's the "manual" way to do it and it works for me 95% of the time:

  • Edit the linkset, unlink the root prim. 
  • Position the add-on to where you want it linked to.
  • Select, in this order: Add-on, Linkset, Root Prim
  • Link.

This *usually* keeps all link numbers of the linkset in their proper order.

Good advice.  That's always the way I link objects.  As a scripter, I have learned how easy it is to write a script that almost does things right, but not always.  I trust my own manual skills more than I trust someone else's script to do something as important as this. 

  • Like 4
Link to comment
Share on other sites

On 4/10/2018 at 7:41 PM, Alyona Su said:

I am familiar with the "relink" script the OP speaks of.

Though here's the "manual" way to do it and it works for me 95% of the time:

  • Edit the linkset, unlink the root prim. 
  • Position the add-on to where you want it linked to.
  • Select, in this order: Add-on, Linkset, Root Prim
  • Link.

This *usually* keeps all link numbers of the linkset in their proper order.

Why does the root need to be unlinked?

Link to comment
Share on other sites

1 minute ago, Wulfie Reanimator said:

Why does the root need to be unlinked?

It doesn't necessarily.  However, to guarantee that all of the links are numbered in a predictable order, you might as well unlink the whole mess and relink everything carefully.  That way there are no surprises and you can be sure that the root really is the root.  As Innula and I have said many times, the best way to refer to links in a LSL script is to refer by link name rather than by number.  That way, the actual order of linking doesn't make much difference -- except for the root.  I know from sad experience that I can mess up absentmindedly and identify the wrong link as the root unless I force myself to relink every single thing.  If you're more confident than I am, take shortcuts.  B|

  • Like 2
Link to comment
Share on other sites

2 hours ago, Rolig Loon said:

It doesn't necessarily.  However, to guarantee that all of the links are numbered in a predictable order, you might as well unlink the whole mess and relink everything carefully.  That way there are no surprises and you can be sure that the root really is the root.  As Innula and I have said many times, the best way to refer to links in a LSL script is to refer by link name rather than by number.  That way, the actual order of linking doesn't make much difference -- except for the root.  I know from sad experience that I can mess up absentmindedly and identify the wrong link as the root unless I force myself to relink every single thing.  If you're more confident than I am, take shortcuts.  B|

Re-linking the entire set would make more sense than unlinking just the root alone. I've never experienced the root prim getting changed without the builder making a mistake in selecting the wrong thing in the wrong order. Even then, I don't remember ever experiencing the links changing order aside from the Build window, which is just a visual bug and scripts still report the correct order.

No real harm doing that routine though. Whatever works!

Edited by Wulfie Reanimator
Link to comment
Share on other sites

4 hours ago, Wulfie Reanimator said:

I don't remember ever experiencing the links changing order aside from the Build window, which is just a visual bug and scripts still report the correct order.

If you link up some prims, and then link another one as a child prim, the prim you've just rezzed rather counter-intuitively becomes link number 2, and all the other children get renumbered to accommodate this.   I suppose this is because the new prim is the prim to have been selected.

It's too late for me to go in tonight but if I remember I'll test Alyona's method tomorrow, though I don't at the moment understand how it would work.    If anyone else wants to test it before I get round to it, this is the script I would use

default {
    state_entry() {
        integer max = llGetNumberOfPrims() + 1;
        integer counter = 1;
        do{
            llSetLinkPrimitiveParamsFast(counter, [PRIM_TEXT,"Link "+(string)counter+"\n",<1.0,1.0,1.0>,1.0]);
        }
        while (++counter < max);          
    }

    changed(integer change) {
        if(change & CHANGED_LINK){
            llResetScript();
        }
    }
}

 

Link to comment
Share on other sites

20 minutes ago, Innula Zenovka said:

If you link up some prims, and then link another one as a child prim, the prim you've just rezzed rather counter-intuitively becomes link number 2, and all the other children get renumbered to accommodate this.   I suppose this is because the new prim is the prim to have been selected.

That used to bother me a lot, until finally I started doing the same as others, unlinking and relinking everything.

Real pain in the editor window though, when you have a lot of itsy bits that have to be in proper order. I really like the above ideas for dealing with that, though, naming the prims and calling them by name.

For a long time I would just put a script in that told the link number of each prim in the linkset as it was clicked, and then I had to make sure to call the right link numbers in the main script, but your way is better.

Edited by Berksey
  • Like 1
Link to comment
Share on other sites

8 hours ago, Berksey said:

Real pain in the editor window though, when you have a lot of itsy bits that have to be in proper order.

2

This.

Real example: I have me a nice sailboat = 115 objects (prims/mesh) - lots of tiny bits like lights and gauges, etc. AND: I am not the creator (but it is modify). So now I want to add something to my boat. By unlinking the root prim the rest remain intact. Now by selecting the items in that order and relinking - the original stuff should maintain the same link order with the add-on being just that: added-on. :)

  • Thanks 1
Link to comment
Share on other sites

@Alyona Su  I can't get your method to work. 

First I rezzed three boxes, red, green and blue.   I selected blue first, then green, then red.   I then linked them and dropped in my script (see post above) to display the link numbers.  The result, as expected, was:5acf59edc0863_LinkDemo1.thumb.PNG.5c84d95d55316ace0fed56106fdcb055.PNG

Then I unlinked the root, the red box, and dropped my script in the new, two prim,  linkset.   The results, as expected, were 5acf5a5a521be_LinkDemo2.PNG.0a7acb7b1a3f2bb44380bbb1120c3e19.PNG

Then I linked a fourth, white, box to the green and blue ones.  This caused the link numbering to be reordered, as expected, so the white box became link number 2 and blue dropped to number 3.

5acf5b2ce730e_LinkDemo3.thumb.PNG.ee699b6ae5a28b8954d54f0d08237633.PNG

Then, as the final step, I selected first the linkset comprising the green, blue and white boxes, and linked them to the red box, so the red one was the root again.   This was the result:

5acf5b3fce26e_LinkDemo4.thumb.PNG.4670577203aaaf0815219c02517f100a.PNG

Link 3 was now the white box (had been the blue box originally) and link 4 was the blue one (link 3 in the original set).

What have I done wrong?  (This is why Rolig and I keep on about having scripts read link names or descriptions to identify the link number -- that way you don't need to worry about this sort of thing).

 

Edited by Innula Zenovka
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Alyona Su said:

This.

Real example: I have me a nice sailboat = 115 objects (prims/mesh) - lots of tiny bits like lights and gauges, etc. AND: I am not the creator (but it is modify). So now I want to add something to my boat. By unlinking the root prim the rest remain intact. Now by selecting the items in that order and relinking - the original stuff should maintain the same link order with the add-on being just that: added-on. :)

Does this mean select old root last when linking or ?

Link to comment
Share on other sites

4 hours ago, Love Zhaoying said:

Does this mean select old root last when linking or ?

Yes, In my example of adding say a hood ornament to a car:

Rez the car, rez the ornament - position the ornament where you want it.

Edit the car, unlink the root - you should now have the ornament, linkset and old root.

Select ornament, then linkset, then (old root - so it becomes root again) - link.

**********

Now for everyone experimenting, I *did* say it doesn't always work. It has worked about 95% of the time for myself - but I also don't do this every day and part of that may also be in how the scripter scripted the original linkset. LOL.

@Innula Zenovka to which I concur with the method you describe. I am not a high-end scripter, though I can manage some ambitious projects. I have known about how linkeset numbers can change when adding to an existing linkset, etc. I've already tried to name all parts for the reason you describe (whether I'll need that or not). Mostly because I just find the name "Object" annoying hahaha!

EDIT to add: I didn't realize you have posted a step-by step, I may be misremembering the order of selection (SL is always such an adventure, right?): after unlinking the root, try it the other way around - select linkset, then add-on object, then root before linking. I admit it's been a couple months since I did this last.

Edited by Alyona Su
Link to comment
Share on other sites

@Alyona Su

19 minutes ago, Alyona Su said:

try it the other way around - select linkset, then add-on object, then root before linking. I admit it's been a couple months since I did this last.

Nope. That doesn't work for me, either.  

Starting with the original set-up (link 1: red; link 2: green; link 3: blue), this what I have after unlinking the root, selecting the remaining linkset and the selecting the new link (link 1: white; link 2: green; link 3: blue)

5acfa2f49b353_LinkDemo2A.thumb.PNG.9bb8b6915dc788d7c5963f8d541024aa.PNG

and this is what I have when I relink it to the original root (link 1: red; link 2: white;  link 3: green;  link 4: blue)

5acfa32cf29bb_LinkDemo3A.thumb.PNG.0e1fc7969de779c220f3f0c71ea0c2f4.PNG

I don't mean to press you on this, but I get nervous about things I can't replicate, particularly when they go against what I know of how SL link ordering works.   

Are you sure that, in the large and complex linksets you're describing, it's not simply that any re-ordering of the links that does take place doesn't cause any links to be renumbered that are affected by scripts?  I mean, have you checked what the link-numbering is after you've finished relinking your boat (no reason why you should), or do you simply mean that nothing is broken after the relinking? 

Link to comment
Share on other sites

53 minutes ago, Innula Zenovka said:

@Alyona Su

I don't mean to press you on this, but I get nervous about things I can't replicate, particularly when they go against what I know of how SL link ordering works.   

Are you sure that, in the large and complex linksets you're describing, it's not simply that any re-ordering of the links that does take place doesn't cause any links to be renumbered that are affected by scripts?  I mean, have you checked what the link-numbering is after you've finished relinking your boat (no reason why you should), or do you simply mean that nothing is broken after the relinking? 

1

No, no - it's fine; press me!  :0

I will look for the original instructions notecard I have when I am in world next - a creator sent it out a while ago when they gave their customers an add-on gift. And ever since I learned that 'trick" it's usually worked for me with other stuff even from other creators. I'll be sure to post an update when I dig it up! Because I will be first to admit OMG I R RONG! :) 

UPDATE: I found the notecard where I learned this from. Apparently I missed a step hahaha. here it is (with proper credit, of course)

+++++

Quote

BY: icecold.skytower (Conrad Aluveaux Reyener)

Linking in SL is a mess, you link something to something, and oh no it broke. Because all the Link Numbers have changed! This notecard explains the few steps how to link things together without breaking the order of link numbers in the original object.

It is useful to stop the scripts from running in selection while messing around with the links.
Right click your vehicle, click edit. (to make things easier, move your vehicle so you can see all of it)
Now with the vehicle selected, on your viewer's main menu bar: 
Build -> Scripts -> Set scripts to not running

Now onto the steps!

1. Unlink the root/main prim of the object. (you might need to disable camera constraints in the advanced menu of your viewer to find the root prim. Unlock the advanced menu in: Me -> Preferences -> Advanced tab)
2. Select the stuff you want to add 
3. Select the object you want to link this to (The one you unlinked the root prim of)
4. Select the root prim of the object you unlinked earlier
5. Link them together!
Done!

Now your item has been linked nice and tidy, with preserving the original link numbers
You can turn the scripts back on
Build -> Scripts -> Set scripts to running

 

As I've said - it doesn't always work - and it will surely depend on how the scripter worked their scripts. Perhaps it could be they used the same method you do with object names, rather than relying on numbers, I don't know as these instructions for hacking something you own, but not the creator of. 

Edited by Alyona Su
  • Thanks 2
Link to comment
Share on other sites

Thanks.  I've just tested that with my test object and scripts, and I can confirm it works for me.   Now I can see how it works.   This way the new item is the first item selected during the creation of the new linkset.

However, I would still really strongly advise scripters against relying on people knowing/remembering to follow all those steps if they relink an object, and on customers bothering to read notecards, especially the notecards are not in their first language.   Identifying link numbers by reference to link names or descriptions is far safer and more reliable.

 

  • Like 2
Link to comment
Share on other sites

1 hour ago, Innula Zenovka said:

However, I would still really strongly advise scripters against relying on people knowing/remembering to follow all those steps if they relink an object, and on customers bothering to read notecards, especially the notecards are not in their first language.   Identifying link numbers by reference to link names or descriptions is far safer and more reliable.

 

 

Oh YES!  Hahaha.

I think this started this way:

  • an OP was asking about the Relinker script permissions and how to say yes to them (a commercial linker/relinker script that sells for like 350L$.
  • Others mentioned they'd never heard of the script, others said what it was, others balked at the very idea.
  • That's when I said, OH, but you can do this manually!

And as is status quo I didn't even get it right hahaha!

HOWEVER: Now it is here for posterity and also as a little something the pro-scripters and builders, such as yourself, will now know. Right? :)

Say "YES!" so I can feel good about being able to share something that is, at least, semi-useful. :)

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2232 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...