GLOBAL script.

Moderator: GZDoom Developers

User avatar
Cutmanmike
Posts: 11353
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

GLOBAL script.

Post by Cutmanmike »

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?
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

I second this. It'd make things a lot more flexible and that flexibility could make skins and the like a lot more powerful.
User avatar
AFADoomer
Posts: 1341
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Post by AFADoomer »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

A very timely suggestion indeed - only a few hours too late. ;)
User avatar
Cutmanmike
Posts: 11353
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Damn you Graf! :P
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Damn Randy, not me. :P
User avatar
Cutmanmike
Posts: 11353
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Graf Zahl wrote:Damn Randy, not me. :P
I've already damned him to oblivion, time to damn some other developer else for a change :P
User avatar
Enjay
 
 
Posts: 27022
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

The translation table is an external lump so if you need to there's nothing that would prevent you from defining it yourself. Remember my Caverns of Darkness patch last year? That included a modified line action table.
User avatar
Cardboard Marty
Posts: 1149
Joined: Sat Oct 23, 2004 8:29 am
Graphics Processor: nVidia with Vulkan support
Location: Robot Mountain
Contact:

Post by Cardboard Marty »

Does this mean that I need to learn ACS to replace default weapons in the future?
User avatar
Cutmanmike
Posts: 11353
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

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);
}
Not much to learn really :P
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

A pratical example for Heretic (For GZDoom 1.0.10)

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);
}
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

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.
Wouldn't it be better to have this configurable in KEYCONF instead of adding just-another-init-lump?
User avatar
MartinHowe
Posts: 2070
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Post by MartinHowe »

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?
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

I think ZDoom tries to merge the scripts but it doesn't work particularily well (For example, GZDoom once tried to give me a Pain Elemental in HoCX when playing it with Heretech.)
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”