Automatically adding libraries; a AUTOLIB lump?

Moderator: GZDoom Developers

User avatar
Talonos
Posts: 789
Joined: Mon May 03, 2004 7:08 am
Location: At college!

Automatically adding libraries; a AUTOLIB lump?

Post by Talonos »

With the rise of custom weapons and inventory items the ability to use ACS_EXECUTE as a code pointer, I'm guessing people will be making weapons that use these in combination. Like, maybe a gun that makes the screen shake when it fires (Via a nondamaging earthquake), or an item that increases your speed using ACS. Even cooler, a heavy gun that lowers your speed when you raise it and sets it back to normal when you lower it (To simulate weight) Stuff like this can be very useful and fun in a wad.

The only problem is that for these guns to work, the script needs to be included. While if you make the map these weapons will be on, this is no problem, this is completely impossible with conversion wads (Such as those done by Xaser or Wildweasel), which aim to be compatible with all existing maps.

I'd like to request a lump, perhaps titled AUTOLIB, that is just like a library, only it is loaded regardless of whether or not a #library entry is in the scripts lump. This way, a wad can be loaded with any other wad, and the scripts needed to run the weapon are always present.

For example, I have a wad called myweapons.wad. I load this up with gothicdm.wad. Though gothicdm.wad has no scripts lump, much less a scripts lump that loads a library, because I have a lump named AUTOLIB in myweapons.wad, zdoom notices it and automatically adds it to gothicdm.wad, allowing my weapons to work.

This change would, primarily, greatly help weapon wads. Many people don't like weapon conversion wads, because they throw off the balance. The monsters and weapons in doom are meant to be balanced against one-another, and changing the weapons disturbs this balance. While I understand and agree (for the most part; I still need a good weapon conversion wad to get through TNT) this problem only arises in single player play. Because all players get the weapons in deathmatch play, balance is conserved, almost no matter what weapons the players have. Many deathmaches can be spiced up with unusual weapon settings. A lump that lets you load weapons that use scripts will help these people as well as people like Xaser who use weapon conversion wads in single player games.

I know that if you have a favorite weapon wad that uses scripts, and a favorite deathmatch wad, you could manually add a script library to it, but in the case of a large wad file, such as tormenters map01 remixes, you will have to edit all thirty-two maps in order to include the library in each map. Also, and AUTOLIB will let you load it with anything without having to do work. For those of you who think I'm just being lazy, think of my friend Nachiket Patkar. He likes zdoom, and likes different weapon wads. However, he doesn't have the first clue about scripting, libraries, or decorate. He would appreciate being able to just select gothicdm and myweapons, and move them both over the zdoom icon in order to use it. While you can call me lazy, without an AUTOLIB lump, or something like unto it, people like my friend Nachiket would never be able to play myweapons without learning a bunch of stuff he won't have any intrest in using.

Also, this AUTOLIB will help for other semi-conversion wads as well. With it, you can make custom HUDs, scripts to give you a count of how many enemies remain, and other stuff. (Other stuff being a technical term meaning people much smarter than me will find other cool uses for this new lump.) Best of all, if you have a custom HUD or something that you like, you can load it with any wad, even those you've just downloaded off of the ID games archive.

Am I making any sense? (By this I mean, do you understand what I'm saying, not do you understand why I'm saying it.)
User avatar
Chris
Posts: 2942
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

I had a nicer solution. Allow DECORATE actors to specify libraries it'll use functions from, and those libraries will automatically load if the object is used. Then you can have a special that'll call those library functions.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Post by wildweasel »

I greatly support this idea. It would be quite cool to script out special effects like this to be used on weapons - the screen shaking on its own is a good example, but the custom HUD and such would also be quite cool.
User avatar
Cutmanmike
Posts: 11335
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

This is sort of what I meant by global scripts.
User avatar
Talonos
Posts: 789
Joined: Mon May 03, 2004 7:08 am
Location: At college!

Post by Talonos »

Graf? rubber? How easy would this be from a programming standpoint?
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

The code is already in there - loading of STRFHELP library. Only thing to make is generalizing the code to autoload any library.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

...and to work with Hexen format maps that already contain scripts. Without that limitation I'd have taken care of it already but so far I haven't analyzed the script loading code sufficiently.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Post by wildweasel »

Here's a (not-so-elegant) solution. Layer the "auto-load" script over any existing scripts, but require the user to use a script number in a certain range (say, script numbers 32000-32100).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

script numbers are restricted to 0-999.
User avatar
Talonos
Posts: 789
Joined: Mon May 03, 2004 7:08 am
Location: At college!

Post by Talonos »

999? From a programming prospective, isn't that a bit odd? Why not 1024, or some other bianary number? Could you enable the use of scripts 1000-1024, but make them only available for autoloading scripts? That way, you can use a weapons mod in a wad that already uses scripts up in the 900 ranges, and map authors won't accidentally use scripts that disable weapon mods.

Oh, and that STRFHELP library? You said the code was already there. Does that mean I just put a library in there named STRFHELP in my wad, and it works as described above?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Sorry, I have no idea why Raven chose 999.
Unfortunately due to internal organization the number cannot be increased at all.

STRFHELP is only loaded with Strife maps not in Hexen format so it won't help you at all.
Costja
Posts: 188
Joined: Mon Oct 18, 2004 3:58 pm
Location: Russia, Moscow
Contact:

Post by Costja »

Can't we use ACS-functions then? (And allow only ACS-functions in autoload libraries)

Example:

Code: Select all

function void somefunction(int arg1, int arg2, int arg3, int arg4, int arg5) {
//...
}

Code: Select all

//...
SOME A 0 A_Call("somefunction", 1, 2, 3, 4, 5)
//...
NiGHTMARE
Posts: 3463
Joined: Sat Jul 19, 2003 8:39 am

Post by NiGHTMARE »

Does this "internal organization" simply mean the script number can't be more than three digits? If so, might it be possible to allow it to use characters other numbers, e.g. script ABC?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

It means that it can't be more than 1000. Raven did some really odd things to mark open scripts and as a result script numbers larger than 1000 can't be used - ever!
User avatar
Cutmanmike
Posts: 11335
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Curse raven for their mysterious ways.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”