llPermuteLinkedPrims

From Second Life Wiki
Revision as of 16:18, 3 July 2012 by Sigma Avro (talk | contribs)
Jump to navigation Jump to search
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 );
REQUEST Function ID
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.


Sigma Avro

Deep Notes

Search JIRA for related Issues

Signature

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