View Single Post
# 1 25-07-2004 , 02:23 AM
Registered User
Join Date: Jul 2003
Location: Australia
Posts: 50

basic MEL help please

Hi there.

I want to create the effect of sheet lightning, by randomising the intensity of a point light.

I can get this to happen, but i need it so that i can vary the time between flashes, like i need an avg random 30 frames between changes.

i came up with this, having not much programming or MEL experience,


//setup values
int $mycount;
$mycount = rand(20,30);
int $i;

//loop for 380 frames
for ($i=1; $i <380; $i++) {

//check random value against frame value
if (frame == $mycount) {

//change light intensity
pointLightShape1.intensity = rand(0,1);

//increase random value to progress
$mycount += $mycount;
}
}


and now I'm stuck. can anyone point out where i went wrong?
it only changes the intensity once. and then not even everytime i play it through.
or perhaps a less round about way of doing it?
thanks!!

Adam.