Random flashing Colors

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Zell
Posts: 791
Joined: Thu Jul 24, 2003 7:47 am
Location: IN A GODDAMN BOX[In Erie.]

Random flashing Colors

Post by Zell »

is it possible to make a pad that flashes diffrent colors or random colors with a flip of a swicth?
any help is appreciated

zell
User avatar
Kappes Buur
 
 
Posts: 4182
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Post by Kappes Buur »

You could include a script which changes the colour of a sector by using the special:

Sector_SetColor (Sid, red, green, blue)

and setting the time intervals for the colour change:

delay(random(lo_tics_limit, hi_tics_limit)*multiplier)

entering appropriate values, of course.
User avatar
Zell
Posts: 791
Joined: Thu Jul 24, 2003 7:47 am
Location: IN A GODDAMN BOX[In Erie.]

Post by Zell »

any way to loop it? lol sry i have no clue on how to do that =p
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post by cccp_leha »

Use "restart;" at the end of the script, it's kinda the same thing you'd do for sparks. lol I did an infinite loop for that once, but that didn't work.
User avatar
Kappes Buur
 
 
Posts: 4182
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Post by Kappes Buur »

I made a small map with four sectors, which I tagged 1, 2, 3, 4. Then I added this script:

Code: Select all

#include "zcommon.acs"

script 10 open
{
Sector_SetColor (1, 255, 0, 0);
Sector_SetColor (2, 255, 255, 255);
Sector_SetColor (3, 255, 128, 0);
Sector_SetColor (4, 128, 255, 255);
delay(random(1, 15));

Sector_SetColor (1, 0, 255, 0);
Sector_SetColor (4, 255, 0, 0);
delay(random(1, 15));

Sector_SetColor (2, 0, 0, 0);
Sector_SetColor (3, 255, 255, 0);
Sector_SetColor (4, 255, 0, 255);
delay(random(1, 15));

Sector_SetColor (1, 0, 0, 255);
Sector_SetColor (2, 255, 0, 0);
delay(random(1, 15));

restart;
}
Granted, it is rather simple. But it shows you how it can be done.
Locked

Return to “Editing (Archive)”