GLOBAL script.
Moderator: GZDoom Developers
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
GLOBAL script.
Before you say "Oh just use libraries" that's NOT what I mean here.
A global script would be a script which runs through ANY level, regardless if they have a BEHAIVOUR lump or not. This is essential for modders and the like if they want to extend the limits of weapons, monsters, playerclasses etc, or if they just want to change something in every level without having to add extra scripts to every map.
For example, we all know we can use action specials in DECORATE states including ACS_Execute which activates scripts in the level. Well, we could have another one such as ACS_GlobalExecute, which only activates scripts within the global script. You get what i'm saying here?
A global script would be a script which runs through ANY level, regardless if they have a BEHAIVOUR lump or not. This is essential for modders and the like if they want to extend the limits of weapons, monsters, playerclasses etc, or if they just want to change something in every level without having to add extra scripts to every map.
For example, we all know we can use action specials in DECORATE states including ACS_Execute which activates scripts in the level. Well, we could have another one such as ACS_GlobalExecute, which only activates scripts within the global script. You get what i'm saying here?
Read rh-log.txt in the subversion...
- Added support for automatically loading ACS objects (even for Doom-format
maps). To use it, compile the ACS files as ordinary libraries placed
between A_START/A_END markers. Then outside the markers, create a lump
called LOADACS. This is just a plain text lump that lists all the libraries
you want to autoload with every map. You can do this with as many libraries
as you want, and LOADACS lumps are also cummulative.
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Not that it is something I am worried about, nor am I likely to use this feature in this way but I am intrigued: is there a line action that can activate scripts in Doom format maps? Obviously you couldn't have all the normal line arguments, but you could, presumably, use the tag field to identify a script number and have all the other args effectively default to 0. Like I said, just wondering.
- Cardboard Marty
- Posts: 1149
- Joined: Sat Oct 23, 2004 8:29 am
- Graphics Processor: nVidia with Vulkan support
- Location: Robot Mountain
- Contact:
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Marty Razor Kirra wrote:Does this mean that I need to learn ACS to replace default weapons in the future?
Code: Select all
script 1 ENTER
{
ClearInventory();
GiveInventory(ReplacementWeapon1);
GiveInventory(ReplacementWeapon2);
}

- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
A pratical example for Heretic (For GZDoom 1.0.10)
I forgot to include my script source in the WAD so here it is:
I forgot to include my script source in the WAD so here it is:
Code: Select all
#include "zcommon.acs"
Script 1 ENTER
{
If(!Checkinventory("QuestItem1"))
{
takeinventory("GoldWand",1);
takeinventory("Staff", 1);
giveinventory("DoomguyFists", 1);
giveinventory("XM63Pistol",1);
takeinventory("GoldWandAmmo", 999);
giveinventory("XM63Ammo", 50);
setweapon("XM63Pistol");
giveinventory("QuestItem1",1);
}
}
Script 2 RESPAWN
{
takeinventory("GoldWand",1);
takeinventory("Staff", 1);
giveinventory("DoomguyFists", 1);
giveinventory("XM63Pistol",1);
takeinventory("GoldWandAmmo", 999);
giveinventory("XM63Ammo", 50);
setweapon("XM63Pistol");
giveinventory("QuestItem1",1);
}
Wouldn't it be better to have this configurable in KEYCONF instead of adding just-another-init-lump?randy wrote:- Added support for automatically loading ACS objects (even for Doom-format
maps). To use it, compile the ACS files as ordinary libraries placed
between A_START/A_END markers. Then outside the markers, create a lump
called LOADACS. This is just a plain text lump that lists all the libraries
you want to autoload with every map. You can do this with as many libraries
as you want, and LOADACS lumps are also cummulative.
- MartinHowe
- Posts: 2070
- Joined: Mon Aug 11, 2003 1:50 pm
- Preferred Pronouns: He/Him
- Location: East Suffolk (UK)
But how does the LOADACS method avoid clashing with script numbers in WADs? Surely now is the time to take the opportunity for the community to agree a range of script numbers and possibly TIDs for modders to use and mappers to ignore? Or is there a better way?
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place