Difference between revisions of "RandomPrimParams"
Jump to navigation
Jump to search
(cleanup) |
m (<lsl> tag to <source>) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{LSL Header}}{{LSLC|Examples}} | {{LSL Header}}{{LSLC|Examples}} | ||
Simple script to show how to set random {{LSLGC| | Simple script to show how to set random {{LSLGC|PrimitiveParams|primitive parameters}}. | ||
< | <source lang="lsl2"> | ||
state_entry() { | default | ||
llSetTimerEvent(0 | { | ||
state_entry() | |||
{ | |||
// set timer to go off every other 5.0 seconds | |||
llSetTimerEvent(5.0); | |||
} | } | ||
timer() { | |||
vector color = <llFrand(1.0), llFrand(1.0), llFrand(1.0)>;// | timer() | ||
llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_COLOR, ALL_SIDES, color, | { | ||
vector color = <llFrand(1.0), llFrand(1.0), llFrand(1.0)>; | |||
// set random color on all sides of linkset with opaque as alpha value | |||
llSetLinkPrimitiveParamsFast(LINK_SET, | |||
[PRIM_COLOR, ALL_SIDES, color, (float)TRUE]); | |||
} | } | ||
}</ | } | ||
</source> |
Latest revision as of 17:42, 24 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Simple script to show how to set random primitive parameters.
default
{
state_entry()
{
// set timer to go off every other 5.0 seconds
llSetTimerEvent(5.0);
}
timer()
{
vector color = <llFrand(1.0), llFrand(1.0), llFrand(1.0)>;
// set random color on all sides of linkset with opaque as alpha value
llSetLinkPrimitiveParamsFast(LINK_SET,
[PRIM_COLOR, ALL_SIDES, color, (float)TRUE]);
}
}