Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Surface Light Values
Surface Light Values
2001-11-21, 12:49 PM #1
Can somebody cook me up a cog that will make a specified surface's extra light value flicker between to to specified values at a random rate? (for the randomization there make it so i can enter the max rate and minimum rate.) Thanks in advance!
2001-11-21, 1:11 PM #2
No.   Ok, maby just a short one. [http://www.plauder-smilies.com/spiny.gif]


 


#11/2001 GBK
Symbols
Message Startup
Message Pulse
Surface Wall
Flex Min_val=0.1
Flex Max_val=0.9
Flex R=0 Local
End
Code
Startup:
Setpulse(Rand() * 10);
Stop;
Pulse:
R=Rand();
While((R < Min_val) || (R > Max_val)) { R=Rand(); }
Setsurfacelight(Wall, R, 0.1);
Setpulse(Rand() * 10);
Stop;
End

Dont know if it works, I just typed it into the box. But it should.... [http://forums.massassi.net/html/biggrin.gif]


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-21, 3:11 PM #3
I dont think it works
2001-11-21, 3:36 PM #4
I just tested it. It works. It just runs a litle slow. Try this one...

 


#11/2001 GBK
Symbols
Message Startup
Message Pulse
Surface Wall
Flex Min_val=0.1
Flex Max_val=0.9
Flex R=0 Local
End
Code
Startup:
Setpulse(Rand());
Stop;
Pulse:
R=Rand();
While((R < Min_val) || (R > Max_val)) { R=Rand(); }
Setsurfacelight(Wall, R, 0.1);
Setpulse(Rand());
Stop;
End

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-11-21, 6:08 PM #5
Yay that works, can you make it so i can set the minimum/maximum intervals?
2001-11-21, 6:20 PM #6
Oops, I allowed for specific light values. Silly me. Try this on for size... [http://www.plauder-smilies.com/spiny.gif]


 

Code:
#11/2001 GBK
Symbols
Message Startup
Message Pulse
Surface Wall
Flex Min_val=0.1
Flex Max_val=0.9
Flex R=0   Local
End
Code
Startup:
Setpulse(Rand());
Stop;
Pulse:
Setsurfacelight(Wall, Rand(), 0.1);
R=Rand();
While((R < Min_val) || (R > Max_val)) { R=Rand(); }
Setpulse(R);
Stop;
End



That should do the trick.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!