Question for Universal ACS script

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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
pixeln00b_Topeka
Posts: 8
Joined: Mon Mar 18, 2019 12:09 pm

Question for Universal ACS script

Post by pixeln00b_Topeka »

Is it possible for an ACS script to target/run for every thing in a map?
For example, let's say I wanted to make every demon on E1M1 or MAP01 invisible. The script itself would probably look like this:

Code: Select all

script 1 (void)
{
	if (CheckFlag(0, "ISMONSTER") == TRUE)
	{
		SetActorProperty(0, APROP_RenderStyle, STYLE_None);
	}
}
How could I make it so this code runs for all the things on a level so that every monster is affected?
SetActivator doesn't work without a preset TID, and that's not what I'm going for.
Jarewill
 
 
Posts: 1768
Joined: Sun Jul 21, 2019 8:54 am

Re: Question for Universal ACS script

Post by Jarewill »

To make an universal ACS script, you need two things: A library and a named script.
The named script isn't really required, but it will lessen the chances of the script being overridden.

However I am not aware of any ACS functions that iterate through all monsters.
The most you can do is alter the level at start with an OPEN script, like how original DarkDoom did it, custom player logic with an ENTER script, custom death screens with a DEATH script or any other possible thing with the available script types.

However that universality in ACS is very limited and has mostly been replaced with ZScript.
And for what you want, the only way to do it would be to use ZScript Event Handlers.
User avatar
pixeln00b_Topeka
Posts: 8
Joined: Mon Mar 18, 2019 12:09 pm

Re: Question for Universal ACS script

Post by pixeln00b_Topeka »

Jarewill wrote: Tue Dec 20, 2022 1:06 am To make an universal ACS script, you need two things: A library and a named script.
The named script isn't really required, but it will lessen the chances of the script being overridden.

However I am not aware of any ACS functions that iterate through all monsters.
The most you can do is alter the level at start with an OPEN script, like how original DarkDoom did it, custom player logic with an ENTER script, custom death screens with a DEATH script or any other possible thing with the available script types.

However that universality in ACS is very limited and has mostly been replaced with ZScript.
And for what you want, the only way to do it would be to use ZScript Event Handlers.
I think that's all I need to know. If there aren't any ACS functions that can iterate through all monsters, then I'll just have to come up with something else, likely with Zscript. Thank you.
Post Reply

Return to “Scripting”