OsSetPrimitiveParams
From OpenSimulator
(Difference between revisions)
												
			m (Added note stating which version of OpenSim introduced this function)  | 
			m (Change See Also)  | 
			||
| (5 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{osslfunc  | {{osslfunc  | ||
| − | |threat_level=  | + | |threat_level=None  | 
|permissions=false  | |permissions=false  | ||
|delay=0  | |delay=0  | ||
|additional_info=This function was added in 0.7  | |additional_info=This function was added in 0.7  | ||
| − | |function_syntax=  | + | |function_syntax= osSetPrimitiveParams(key prim, list rules)  | 
|ossl_example=<source lang="lsl">  | |ossl_example=<source lang="lsl">  | ||
| − | //   | + | //  | 
| + | // osSetPrimitiveParams Script Exemple  | ||
| + | //  | ||
| + | |||
| + | // Change target_uuid to any uuid of the prim you wish to change visibility by clicking.  | ||
string target_uuid = "69031c69-36a5-4031-bdc8-8ca8c37f8eda";  | string target_uuid = "69031c69-36a5-4031-bdc8-8ca8c37f8eda";  | ||
vector default_color;  | vector default_color;  | ||
| − | + | ||
default  | default  | ||
{  | {  | ||
     state_entry()  |      state_entry()  | ||
     {  |      {  | ||
| + |         llSay(PUBLIC_CHANNEL, "Touch to see osSetPrimitiveParams usage.");  | ||
         list prim_params = osGetPrimitiveParams(target_uuid, [PRIM_COLOR, ALL_SIDES]);  |          list prim_params = osGetPrimitiveParams(target_uuid, [PRIM_COLOR, ALL_SIDES]);  | ||
         default_color = llList2Vector(prim_params, 0);  |          default_color = llList2Vector(prim_params, 0);  | ||
     }        |      }        | ||
| − | + | ||
     touch_start(integer number)  |      touch_start(integer number)  | ||
     {  |      {  | ||
| Line 25: | Line 30: | ||
     }  |      }  | ||
}  | }  | ||
| − | + | ||
state alpha  | state alpha  | ||
{  | {  | ||
| Line 39: | Line 44: | ||
* This function has the same behave as llSetPrimitiveParams except you can specify target prim anywhere in the scene.  | * This function has the same behave as llSetPrimitiveParams except you can specify target prim anywhere in the scene.  | ||
* For general information about '''rules''', see [http://wiki.secondlife.com/wiki/LlSetPrimitiveParams llSetPrimitiveParams in SecondLife Wiki].  | * For general information about '''rules''', see [http://wiki.secondlife.com/wiki/LlSetPrimitiveParams llSetPrimitiveParams in SecondLife Wiki].  | ||
| − | + | * If there is no prim with id '''prim_uuid''' in the scene, or the owner of the target prim is different from the owner of the scripted prim, it will fail without error.  | |
| − | * If there is no '''prim_uuid'''   | + | |
| − | + | ||
|  | |  | ||
}}  | }}  | ||
| + | == See Also ==  | ||
| + | * [[osSetPrimitiveParams]]  | ||
| + | * [[osGetPrimitiveParams]]  | ||
Latest revision as of 19:02, 5 December 2020
osSetPrimitiveParams(key prim, list rules)
 
 | |
  | |
| Threat Level | None | 
| Permissions | Use of this function is always disabled by default | 
| Extra Delay | 0 seconds | 
| Example(s) | |
// // osSetPrimitiveParams Script Exemple // // Change target_uuid to any uuid of the prim you wish to change visibility by clicking. string target_uuid = "69031c69-36a5-4031-bdc8-8ca8c37f8eda"; vector default_color; default { state_entry() { llSay(PUBLIC_CHANNEL, "Touch to see osSetPrimitiveParams usage."); list prim_params = osGetPrimitiveParams(target_uuid, [PRIM_COLOR, ALL_SIDES]); default_color = llList2Vector(prim_params, 0); } touch_start(integer number) { list rules = [PRIM_NAME, "HIDDEN", PRIM_COLOR, ALL_SIDES, default_color, 0.0]; osSetPrimitiveParams(target_uuid, rules); state alpha; } } state alpha { touch_start(integer number) { list rules = [PRIM_NAME, "VISIBLE", PRIM_COLOR, ALL_SIDES, default_color, 1.0]; osSetPrimitiveParams(target_uuid, rules); state default; } }  | |
| Notes | |
| This function was added in 0.7 | |
[edit] See Also
- osSetPrimitiveParams
 - osGetPrimitiveParams