What would be the equivalent of Light Flicker to ACS?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
TheMafla
Posts: 18
Joined: Wed Jun 20, 2018 8:28 am
Contact:

What would be the equivalent of Light Flicker to ACS?

Post by TheMafla »

Well, I am something new in this, I was trying to make several sectors blink under the action of Light_Flicker but obviously this is not at least what I want.
From what I understand, this may be possible by ACS and I have created a code but this light has a very short delay compared to action 65: Light Flicker, it has a longer delay and I would like the code to work almost equal to this. What should I change in the code?

Code: Select all

Script 2 OPEN{
   Light_ChangeToValue (3, 256);
   delay (random (0, 1) * 64 + 1);
   while (1){
	  Light_ChangeToValue (3, 160);
      delay (random (1,7));
      Light_ChangeToValue (3, 256);
      delay (random (1,23));
      }
}
User avatar
Tartlman
Posts: 226
Joined: Thu Oct 11, 2018 5:24 am
Location: meme hell
Contact:

Re: What would be the equivalent of Light Flicker to ACS?

Post by Tartlman »

TheMafla wrote:Well, I am something new in this, I was trying to make several sectors blink under the action of Light_Flicker but obviously this is not at least what I want.
From what I understand, this may be possible by ACS and I have created a code but this light has a very short delay compared to action 65: Light Flicker, it has a longer delay and I would like the code to work almost equal to this. What should I change in the code?

Code: Select all

Script 2 OPEN{
   Light_ChangeToValue (3, 256);
   delay (random (0, 1) * 64 + 1);
   while (1){
	  Light_ChangeToValue (3, 160);
      delay (random (1,7));
      Light_ChangeToValue (3, 256);
      delay (random (1,23));
      }
}
You could probably fix that simply by changing the lowest value of your random.
Also, keep in mind that delay doesn't use octics - that means you'll have to delay for 35 tics to pass a second.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: What would be the equivalent of Light Flicker to ACS?

Post by Tormentor667 »

Why not all random like this:

Code: Select all

script “FlickerLight” OPEN
{
Light_ChangeToValue(3, random(128,255));
Delay(random(1,5));
Restart;
}
Post Reply

Return to “Scripting”