-
Posts
5 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Posts posted by Roswell Grayman
-
-
Basically, it's easy. With integer in LSL, you may operate 32 distinct bits (as the integer is stored in 4 bytes). To set a bit, pick its position (starting from right to left, 0 to 31) and power 2 to the position, then apply the 'bitwise or' operator, for example:
integer b = 0;
b = b | 0x8; // 0x8 (8 decimal) is 2 power 3, hence we're setting here the 4th bit (remember, the position is counted from 0)
b = b | 0x40; // 0x40 (64 decimal) is 2 power 6, so the set bit is 7th.To check if a bit is set, simply apply the 'bitwise and':
integer b = 0x48;
if ( b & 0x20 == 0x20 ) { } // false (think why
if ( b & 0x8 == 0x8 ) { } // true
if ( b & 0x40 == 0x40 ) { } // true aswellGood luck!
-
If it's still actual, I would like to assist your friend. I'm native Russian, and he may freely come in touch with me (I wouldn't share my Skype ID or somewhat else private here, so please, first be IMming me in SL). Peace )
-
Here's the very basic example. Upon start, it renders the prim invisible, then cycles through every face and switches its visibility.
integer last = 0;integer total = 0;float delay = 1.0; // The delay between cycle steps, in secondsdefault { on_rez( integer param ) { llResetScript(); } state_entry() { total = llGetNumberOfSides(); integer i; for ( i = 0 ; i < total ; i ++ ) { llSetAlpha( 0.0, i ); } llSetTimerEvent( delay ); } timer() { llSetAlpha( 0.0, last ); last ++; if ( last > total - 1 ) { last = 0; } llSetAlpha( 1.0, last ); }}
A scripter seeks employment
in Inworld Employment
Posted