Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
kristus

Making efficient ACS counter script.

Recommended Posts

I'm trying to make a light strobing effect with ACS. And while it was easy to make a crude script that simply ran a loop with a shitload of lines. It wasn't very manageable when you wanted to do fine tuning of pace and such. So I wanted to make it a bit more clever.

I'm not very comfortable with ACS yet though, and especially with not being sure of what functions listed on Zdoom's wiki is actually present in Hexen's original version of ACS it makes things more difficult. I noticed that there doesn't appear to be any goto command in ACS which i found odd.

But anyway. I was hoping that someone could give me a bit of help on the way. Because right now (as unimpressive as it is) I'm not really getting anywhere.

Share this post


Link to post

It's kind of hard to know what exact effect you want. Do you want a bunch of sectors to fade to a brightness then fade back? Or just blink? Having them blink would be easy in a For loop.

On which functions are or not in the original hexen, maybe asking someone who codes a hexen port would have that info.

Share this post


Link to post
kristus said:

I'm trying to make a light strobing effect with ACS.

That is all.

Doom and Heretic sector special 8, light glows.

Share this post


Link to post

Not sure if this would work, it's been a long time since I worked with ACS.

Int StrobeLightValue, NormalLightValue;
script 1 (void) {
	// (StrobeLightValue - NormalLightValue) should be dividable by LightValueIncrement
	for(int X = NormalLightValue; X <= StrobeLightValue; X += *LightValueIncrement*){
	
		for(int Y = *lowestsectortag*; Y <= *highestsectortag*; Y++){
			Light_ChangeToValue (Y, X); // Y = tag, X = brightness
		}
	delay(*anynumber*); //time between light changes
		
	}
	Delay(*anynumber*); //time for light to stay at maximum
	for(int X = StrobeLightValue; X >= NormalLightValue; X -= *LightValueIncrement*){
	
		for(int Y = *lowestsectortag*; Y <= *highestsectortag*; Y++){
			Light_ChangeToValue (Y, X);
		}
	delay(*anynumber*); //time between light changes
	}
        delay(*anynumber*); //delay before next strobe
}
Values between *'s are inputted by you. The script relies on all sectors being the same value. Having different sector light values would need arrays.

I tried to make it so it's easy to change values to get the proper effect you want.

Edit: or maybe Light_Glow as you mentioned. gah. Not sure how that would work on multiple sectors though.

Share this post


Link to post
kristus said:

I'm trying to make a light strobing effect with ACS...

...Doom and Heretic sector special 8, light glows.

That's indeed confusing, because Doom's glow effect is not what a strobe light does. Strobing is (fast) blinking.

At any rate, ZDoom has a Light_Glow special for this that should do what you want easily. Here's a script that assigns a bunch of delayed glow effects to a range of sectors, to get a lighting effect like what you see in Guardian of Steel:

int highLight = * // maximum brightness of effect.
int lowLight = * // minimum brightness of effect.
int lowtag = *; // Set to lowest tag desired.
int hightag = *; // Set to highest tag desired. All tags in range will be affected.
int glowTime = * // # of tics it takes to cycle between high/low light values.
int glowDelay = *; // # of tics before starting next sector's light glow.

script 1 OPEN
{
	for(int i = lowtag; i <= hightag; i++)
	{
		Light_Glow(i, highLight, lowLight, glowTime);
		delay(glowDelay);
	}
}
I have no idea either whether or not this function existed in Hexen ACC or if it was a ZDoom extension. A few maps (Guardian of Steel naturally comes to mind) did use lighting like this, though, so there's likely a shortcut to it even if it's not this.

Share this post


Link to post

?

116:Light_Strobe / tag / upper / lower / u-tics / l-tics
		tag:		tag of affected sector
		upper:		brightest light level
		lower:		lowest light level
		u-tics:		tics to stay at upper light level
		l-tics:		tics to stay at lower light level
Sorry, I'm not sure if you're looking for this or something more elaborate than this.

EDIT: or this
115:Light_Flicker / tag / upper / lower / arg4 / arg5
		tag:		tag of affected sector
		upper:		brightest light level
		lower:		lowest light level

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×