Difference between revisions of "LlPermuteLinkedPrims"

From Second Life Wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
|p1_type=list|p1_name=subset1|p1_desc=  a subset e.g. [1,5,3] of the list of linknumbers  
|p1_type=list|p1_name=subset1|p1_desc=  a subset e.g. [1,5,3] of the list of linknumbers  
|p2_type=list|p2_name=subset2|p2_desc=  another subset e.g. [1,4,2] of the list of linknumbers
|p2_type=list|p2_name=subset2|p2_desc=  another subset e.g. [1,4,2] of the list of linknumbers
|p3_type=integer|p3_name=permtaion_strategy|p3_desc= presently only DEFAULT
|p3_type=integer|p3_name=permutation_method|p3_desc= presently only DEFAULT
|func_footnote
|func_footnote
|func_desc= returns the status of permuting the subset1 to subset2 and subset2 to subset1. It can be one of the  
|func_desc= returns the status of permuting the subset1 to subset2 and subset2 to subset1. It can be one of the  
Line 62: Line 62:
Should work also when attached.
Should work also when attached.


 
feature request [http://jira.secondlife.com/browse/SCR-361 SCR-361]
 
key words: link number, linkset, child, hierachisation
 


{{User|Sigma Avro}}
{{User|Sigma Avro}}

Latest revision as of 15:51, 3 July 2012

Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: integer llPermuteLinkOrder( list subset1, list subset2, integer permutation_method );
0.0 Forced Delay
10.0 Energy

returns the status of permuting the subset1 to subset2 and subset2 to subset1. It can be one of the [PERMUTATION_ABORTED, PERMUTATION_DONE,PERMUTATION_UNACHIEVED] if impossible and not done, possible and fully implemented, partly defined and implemented.
Returns an integer of the operation performed.

• list subset1 a subset e.g. [1,5,3] of the list of linknumbers
• list subset2 another subset e.g. [1,4,2] of the list of linknumbers
• integer permutation_method presently only DEFAULT

Specification

requires modifiable objects and that PERMISSION_CHANGE_LINKS is TRUE. Link number must not include avatar.

Examples

<lsl> integer gCount; integer gStatus; list resultsText = ["aborted","permuted","unachieved","unknown"]; list results;

default {

state_entry() { results = [PERMUTATION_ABORTED, PERMUTATION_DONE,PERMUTATION_UNACHIEVED]; } touch_start( integer num_detected) { if( llDetectedKey(0) == llGetOwner() ) llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS); }

run_time_permissions( integer perm) { if(perm & PERMISSIONS_CHANGE_LINKS) { // in a linkset of 6 primitives... gStatus = llPermuteLinkOrder([1,5,3],[1,2],DEFAULT); llOwnerSay( "guess nr 1 : " + llList2String(resultsText, llListFindList(results,[gStatus]) ); //...returns "guess nr 1: unachieved"

gStatus = llPermuteLinkOrder([1,7,3],[1,2,6],DEFAULT); llOwnerSay( "guess nr 2 : " + llList2String(resultsText, llListFindList(results,[gStatus]) ); //...returns "guess nr 2: aborted"

gStatus = llPermuteLinkOrder([1,5,3],[1,2,4],DEFAULT); llOwnerSay( "guess nr 3 : " + + llList2String(resultsText, llListFindList(results,[gStatus]) ); //...returns "guess nr 3: permuted"

if(gStatus == 1) { gCount = lllGetNumberOfPrims(); while(gCount--) llSetLinkPrimtiveParams(gCount,[PRIM_TEXT,(string)gCount,<1.,1.,1.>,1.]); //... to put the link number on the prims, or do many similar operations on prims } } }

}</lsl>

Useful Snippets

an llSetLinkNumber function would not work

Notes

used for changing a child prim or unlinking them in a given order. This in view of hierarchy of links and organizing operations on child prims. Should work also when attached.

feature request SCR-361

key words: link number, linkset, child, hierachisation


Sigma Avro

Deep Notes

Signature

//function integer llPermuteLinkOrder( list subset1, list subset2, integer permutation_method );