Jump to content

Moving Linked Prim


2toe Bigboots
 Share

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

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

Recommended Posts

Wondering if i can somehow move a prime linked to another with out unlinking it or changing its link number at least.

Example:  Say i have 5 linked Prim

linked order_001.png

I want to click one or click drag one to change its position with out unlinking or chaning link number if possible...

 

linked order_002.png

Not even close to sher were to start with this.... im doing some digging but is this even possible ?

 

Link to comment
Share on other sites

Heres what ive got so far works in lsl editor but you know how that is it loves theorys lol

should give you 10 sec to move after touch then relink but its not relinking i must be wrong someware in telling it what ti link to.

 

key relink;default{	state_entry()	{		llRequestPermissions(llGetOwner(),PERMISSION_CHANGE_LINKS);		relink = llGetLinkKey(llGetLinkNumber());	}	touch_start(integer total_number)	{		llGetPermissions();		llBreakLink(llGetLinkNumber());		llSetTimerEvent(10.0);	}	timer()	{		llGetPermissions();		llCreateLink(relink,TRUE);		llSetTimerEvent(0);	}}

 

Link to comment
Share on other sites

lol cute but im looking to write a script so i can move with my mouse. and it will keep its link number.

 

key relink;relinkR(){    llGetPermissions();    llCreateLink(relink,TRUE); <~~~ changing to true makes root change to False makes not root    llSetTimerEvent(0);}MoveB(){    llGetPermissions();    llBreakLink(llGetLinkNumber());    llSetTimerEvent(10.0);}default{    state_entry()    {        llRequestPermissions(llGetOwner(),PERMISSION_CHANGE_LINKS);        relink = llGetLinkKey(2);    }    touch_start(integer total_number)    {        MoveB();    }    timer()    {        relinkR();    }}

 

Link to comment
Share on other sites

Please learn once and remember always that llRequestPermissions() regardless what permission you're requesting, is meaningless without processing run_time_permissions event. This is true even if a permission is supposed to be granted automatically. Even more so in case of PERMISSION_CHANGE_LINKS because this permision is NOT granted automatically.

Your llGetPermissions() does not do anything at all, it is an idle code line. Read the function's description in the wiki and figure out why as a home work :)

Link to comment
Share on other sites

Alright. I did not succeed in making it work with the root and I find it still too slow altho I managed to make it very minimalist... but it works!

 

integer GrabbedLink;vector CurrentPos;default{    state_entry()    {    }    touch_start(integer numb)    {        GrabbedLink = llDetectedLinkNumber(0);        GrabbedLink *= (GrabbedLink != 1); // Ignore the root.        // Equivalent to: if (GrabbedLink == 1) { GrabbedLink = 0; }        // Working on link number 0 silently fails in linksets.        CurrentPos = llDetectedTouchPos(0);    }        touch(integer num)    {        vector new_pos = llDetectedTouchPos(0);        if (new_pos) // != ZERO_VECTOR then held cursor is (still) within the prim area.        {            // Let's move... or not. We don't check for speed reasons.            CurrentPos = llList2Vector(llGetLinkPrimitiveParams(GrabbedLink, [PRIM_POS_LOCAL]), 0) + (new_pos - CurrentPos);            llSetLinkPrimitiveParamsFast(GrabbedLink, [PRIM_POS_LOCAL, CurrentPos]);        }    }}

 If you use it on cubes, you can move them in 3D depending on the face where you click and how you move your mouse cursor... in a way that kind of makes sense... to me. :smileywink:

Link to comment
Share on other sites

Kool ill give it a try. and the request oerm i made worked fin it req on rez and thats all i needed i tryed with it not there and cant work.

~edit~

after trying you solved the keeping link number but i cant really move it but maybe .02 of a meter. but still a huge step closer

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4427 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...