Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
scroton

ZDoom Pistol Start Options

Recommended Posts

Made this for a couple of guys on a site I frequent who were dissatisfied with zdoom's handling of autosaves and pistol starts (zdoom allows for disabling of autosaving, but not autoloading, so the only way to have immediate pistol start of levels on death is to delete ALL saves for a particular wad and then not save again, since any saves, even for earlier levels, will be loaded preferentially) and thought I'd share it here.

From the readme in the zip (also included as an "about" file in the WAD itself):

Pistol_Start_Options.wad is a singleplayer (g)zdoom-only mod which allows various pistol start options for players. It is compatible with all difficulty levels, all maps using vanilla weapons, all supported mods listed below, and should be compatible with all mods using non-vanilla weapons too. It works with or without (g)zdoom's autosave enabled.

Available options via CVars are:

always_pistolstart -- setting this to "true" or 1 forces pistol starts on all levels

death_pistolstart -- setting this to "true" or 1 allows the player to keep items and weapons between levels, but if they die forces a pistol restart of the level they died on. Don't press any key after dying or this effect will be canceled and you will autoload a previous save. Default time between dying and restarting the level from a pistol start is 2 seconds.

death_pistoltime -- this is the wait time in seconds after dying before you restart the level or map-set/episode from a pistol start. Does nothing if neither death_pistolstart nor death_firstmap is enabled. Defaults to 2. The toggle function cycles through 0-5 but you can set it in console to any integer 0 or higher.

death_firstmap -- setting this to "true" or 1 causes the player to pistol start the first level in an episode or map set upon death. If you're playing a map set with a MAP## naming scheme it will boot you back to MAP01. If you're playing a map set with a E#M# naming scheme it will boot you back to the first map in the episode you're in, so long as the episode is 1, 2, 3 or 4. If you're playing a map set that uses none of the aforementioned naming schemes, it will boot you back to the first map you played, which will usually be the first map in a map set or episode (unless you started zdoom with warp parameters or used idclev.) Loading saves won't affect this; you will be taken to the map that you first played in that saved game rather than the level you loaded the save from.

random_level_order -- setting this to "true" or 1 causes the player to be warped to a random level at the start of each level. This works with all iwad maps and all pwad mapsets using either E#M# or MAP## naming format that have the full 36 or 32 levels. Maps previously visited either while this cvar was set to true or with the "warp to random map" function will not be revisited unless all have already been visited. When all maps in a WAD have been visited and the player tries to go to a new random map, the player will be notified before the list is reset and a new (previously visited) random map is warped to. Whether the player is given a pistol start reset is up to their cvar settings.

not_supported -- set this to "true" or 1 if you're playing with a weapons mod or any mod that changes the actor names of the doom weaponry or modifies what the player starts with and is NOT listed below. You will see double screenwipes when starting from a pistol start; unfortunately this is required for compatibility.

Suppported Mods:
(All versions are current versions as of 3-22-2014)
(If one of these is being played, not_supported should be set to FALSE or 0)

Project MSX (v0.2a)
Samsara (v0.30 & v0.31)
The Russian Overkill (v2.2)
Brutal Doom (V19)
Brutal Doom Sperglord Edition (V19, 11/20/13 update)
DoomRL Arsenal (Beta 7.94)
Accessories to Murder (4-21-14 update)
FKER (v1.31)
Doomtra (v08f)
The Space Pirate (V.0.1.2e)
ProjectILE (v0.07)
Burl Tumd (8/11/13 update)
DoomCW (v1.5.1, Release)
GMOTA (V0.9)
NAZIS! (V2.11 hotfix, 6/1/2012)
Fractal Doom

All of these CVars also have Toggle keys that can be bound to a key. All are by default unbound. You can also just look at them in the controls configuration if you forget what they are and want to change them in the console without exiting the game to look them up.

There is also a key which displays the options (0-2) for disableautosave and displays the current disableautosave setting. This is unbound by default. Disableautosave must be changed in the console and can't by toggled by keypress.

There is also a function which immediately forces pistol start of the current level, this too can be bound to a key and is by default unbound.

Finally, there is a function which immediately warps the player to a random level, this too can be bound to a key and is by default unbound. Whether the player is given a pistol start reset is up to their cvar settings.

Uncompiled ACS is included in the file, so feel free to look it over and/or use it for whatever project you want

Download:
http://www.mediafire.com/download/q8ia32e6o4g9sn7/pistol_start_options.zip

Share this post


Link to post

Boy, it sure is a good thing nobody's suggested any hacky workarounds that don't actually help the OP ye--

BaronOfStuff said:

IDCLEVxx

...Oh.


But in seriousness, this is indeed an outstanding ZDoom feature-gap that ought to be addressed at some point. As a for-the-record, ZDoom's behavior is there so that hubs work properly, but a cvar that disables autoload for non-hubs is still a welcome (and long-overdue) thing. Good to see a temporary better-workaround, at least.

I need to get motivation to code again. :P

Share this post


Link to post

Fantastic! By default I play in continuous mode, but I've always longed for the ability to force pistol start for certain WADs (the Congestion/Claustrophobia series, for example.)

I had to look up CVARs in the ZDoom Wiki, but it looks like this sort of thing is what I'm looking for, right?

gzdoom.exe -iwad doom2.wad -file 1024.zip pistol_start_options.wad +always_pistolstart 1

Share this post


Link to post

I've been kind of curious about maybe making a mapset with a "lives" feature, where dying would act like "clearing" the stage, only you get sent back to the current map with one less life (or, perhaps, you'd just respawn MP-style with one less life, I dunno). If lives were zero, you'd get punted off to some "GAME OVER" level, or maybe the first map of the current episode.

Obviously save-scumming could work around this, just as it did in Wolfenstein 3D, but there's not really a whole lot that can be done about that.

Share this post


Link to post
BaronOfStuff said:

IDCLEVxx

:/


Yeah, that works too and is what they/I were doing before. The only thing is that it gets to be a pain having to type that at every level and every time you load a game after a while. Also if you have a non-boom or non-vanilla map with wonky level names and order it can take a second to figure out which level number you are actually on.

Xaser said:
I need to get motivation to code again. :P [/B]


DO EEET

Salt-Man Z said:

Fantastic! By default I play in continuous mode, but I've always longed for the ability to force pistol start for certain WADs (the Congestion/Claustrophobia series, for example.)

I had to look up CVARs in the ZDoom Wiki, but it looks like this sort of thing is what I'm looking for, right?

gzdoom.exe -iwad doom2.wad -file 1024.zip pistol_start_options.wad +always_pistolstart 1


Glad this will be getting used! And yeah, that will work perfectly. You can also enter "always_pistolstart 1" in the console in-game and it will do the same thing, including archiving the cvar for later play, and will take effect immediately.

Shadow Hog said:

I've been kind of curious about maybe making a mapset with a "lives" feature, where dying would act like "clearing" the stage, only you get sent back to the current map with one less life (or, perhaps, you'd just respawn MP-style with one less life, I dunno). If lives were zero, you'd get punted off to some "GAME OVER" level, or maybe the first map of the current episode.


Sounds fun and arcadey. You probably know what you're doing, but if you want to use/look at the acs in this feel free, the uncompiled code is there in the file.

Share this post


Link to post

I updated pistol start options with native support for some mods; that is, they will be handled in game like vanilla is currently and not require double screen wipes to accomplish pistol starts/pistol starts on death. I also changed not_vanilla to not_supported since it's more accurate. Shouldn't require you to remove the not_vanilla cvar from your ini, but if you're having issues try that.

Suppported Mods:
(All versions are current versions as of 3-22-2014)
(If one of these is being played, not_supported should be set to FALSE or 0)

Project MSX (v0.2a)
Samsara (v0.30 & v0.31)
The Russian Overkill (v2.2)
Brutal Doom (V19)
Brutal Doom Sperglord Edition (V19, 11/20/13 update)
DoomRL Arsenal (Beta 6 HF13)
Accessories to Murder (12-24-13 update)
FKER (v1.31)
Doomtra (v08f)
The Space Pirate (V.0.1.1 Alpha)
ProjectILE (v0.07)
Burl Tumd (8/11/13 update)
DoomCW (v1.5.1, Release)
GMOTA (V0.9)
NAZIS! (V2.11 hotfix, 6/1/2012)
Fractal Doom

NOTE: You CAN use Pistol Start Options with mods not listed above, they'll just have two screenwipes instead of one.

If you want a particular mod supported let me know and I can add it in the next version whenever I updated it again.

OP has been updated accordingly. Download link is the same.

Share this post


Link to post
Shadow Hog said:

I've been kind of curious about maybe making a mapset with a "lives" feature, where dying would act like "clearing" the stage, only you get sent back to the current map with one less life (or, perhaps, you'd just respawn MP-style with one less life, I dunno). If lives were zero, you'd get punted off to some "GAME OVER" level, or maybe the first map of the current episode.

Obviously save-scumming could work around this, just as it did in Wolfenstein 3D, but there's not really a whole lot that can be done about that.

I think it would be great if there was a singleplayer survival mod like this, with either standard "booted back to the start" deaths, or instant respawns (with options to lose all equipment upon death, lose half of all your ammo, lose only your currently-equipped weapon, or lose nothing except one life). Make it compatible with ScoreDoom and then we've got something really fun happening. :)

Share this post


Link to post

Added requested feature of having the option of having it pistol start you back at the start of the episode or mapset you're currently playing upon death.

Set the CVar death_firstmap to 1 or true to use this option. This option takes precedence over death_pistolstart, so if you have both set you will end up pistol starting the earlier map rather than the map you died on.

If you're playing a map set with a MAP## naming scheme it will boot you back to MAP01. If you're playing a map set with a E#M# naming scheme it will boot you back to the first map in the episode you're in, so long as the episode is 1, 2, 3 or 4.

If you're playing a map set that uses none of the aforementioned naming schemes, it will boot you back to the first map you played, which will usually be the first map in a map set or episode (unless you started zdoom with warp parameters or used idclev.) Loading saves won't affect this; you will be taken to the map that you first played in that saved game rather than the level you loaded the save from.

OP has been updated accordingly. Download link is the same.

As always the uncompiled ACS is included in the file, so feel free to look it over and/or use it for whatever project you want

Share this post


Link to post

Went ahead and integrated Map_Randomizer.wad into Pistol Start Options, as well as updating it to the new Space Pirate (V.0.1.2e)

Rather than a separate file, level randomization is now handled through a new cvar:

random_level_order -- setting this to "true" or 1 causes the player to be warped to a random level at the start of each level. This works with all iwad maps and all pwad mapsets using either E#M# or MAP## naming format that have the full 36 or 32 levels. Whether the player is given a pistol start reset is up to their cvar settings.

There is also a new function which immediately warps the player to a random level, this can be bound to a key and is by default unbound. Whether the player is given a pistol start reset is up to their cvar settings.

OP has been updated accordingly. Download link is the same.

As always the uncompiled ACS is included in the file, so feel free to look it over and/or use it for whatever project you want

Share this post


Link to post

If I remember well, Romero says in an interview that after the concept of lives was abandoned in Doom, restarting the map from pistol start was enough punishment for dying. So that's why the maps are designed to be playable from pistol start, I suppose. Nice to have this concept back.

Share this post


Link to post

ZDoom Pistol Start Options has received an update. No new features, but support has been updated for DoomRL Arsenal to bring it up to DRLA Beta 7.94. It is now up to date with the current version of all mods listed as supported. There's also been some restructuring of acs and removal of redundant code to lower the amount of acs used drastically, but this part won't affect the player. OP has been updated.

Share this post


Link to post

Pistol Start Options has been updated.

When a random map is now selected, maps previously visited either while this cvar was set to true or with the "warp to random map" function will not be revisited unless all have already been visited. When all maps in a WAD have been visited and the player tries to go to a new random map, the player will be notified before the list is reset and a new (previously visited) random map is warped to.

Usage of global variables has also been reduced to 2 from 7, which means greater universal compatibility.

The previous message of "DON'T PRESS ANYTHING DUMMY" after the player had died and was awaiting a pistol start on death has been replaced with "DON'T PRESS ANYTHING" and a countdown to respawn during the last 10 seconds of delay. This works regardless of how long the delay is set to.

OP has been updated with changes and new link.

BlackFish said:

This is awesome, thanks for making this!


No problem! Glad you like it/find it useful.

Share this post


Link to post

This is pretty cool. I'm particularly interested in the random level order. But is there any way to make it work with a wad that has less than 36/32 levels?

A while ago I compiled all the master levels which I usually have added as an extra episode. I always wanted them to be loaded randomly when I play and from pistol start. I made them all pistol start but couldn't figure out how to make them load randomly.

I inquired on zdoom forums about random map loading but all responses I got were that it just couldn't be done. :(

Share this post


Link to post

Yeah, this method can work with any number of levels, the only reason I put that is because the random map function has to have the names of all the levels in an array beforehand to work, so won't work with custom map names. Though I suppose since now that the random map function won't revisit the same map it would actually be fine with ones that use the same naming scheme with less than the full map amount, since it would just return an error but you could press random map again until you got one that worked, and it wouldn't try that same map again for a while.

I can add the master levels to this if you want, just let me know if the names are the same as they appear here or if they use a different naming scheme and if you're loading them along with Doom 2 or as a separate episode.

The only limitation to this is that the random map function doesn't directly take you to a random map on exit, instead you'll first go to the normal map the map would exit to before having a screen wipe and ending up in a random level. This is only a limitation because this is a mod though, because it's not (and cannot) modify the levels directly. If someone was making a map set they could use the same method to have every level exit to another random level (or semi-random level) and it would function just like a normal map exit.

Share this post


Link to post
scroton said:

The only limitation to this is that the random map function doesn't directly take you to a random map on exit, instead you'll first go to the normal map the map would exit to before having a screen wipe and ending up in a random level. This is only a limitation because this is a mod though, because it's not (and cannot) modify the levels directly. If someone was making a map set they could use the same method to have every level exit to another random level (or semi-random level) and it would function just like a normal map exit.


Actually you can make it so that nearly any map in Doom/Boom/Heretic/Strife format will exit randomly. Add a map translator that redefine the linetypes 11, 51, 52, 124, etc. into ACS_Execute(0, "your random exit script").

Share this post


Link to post

Oh wow! Thanks Gez, I didn't know that existed.

This will be much better for map randomization, and I can use it for pistol start functionality too. I can even use it in another project I'm working on, and it will save me a ton of time with that.

Share this post


Link to post

TL;DR updating this, seeking feature suggestions.

I'm going to be updating this guy over the next week or so in my downtime both to add some needed features and usability and bring him up to a better coding standard (I had things like manually zeroing all the values in an array rather than via loop and random strings on variable names for reasons unknown to present me) so that it is easier for myself or others to maintain (in the case I go missing again, someone should be able to update it or make their own version that is current, since nobody is around forever) and for any potential other modders that want to dig through my code and incorporate it into their own work. Right now it's such a mess that it's functionally unintentionally obfuscated code.

I am taking feature suggestions as well as suggestions/requests for weapon mod support. I will fulfill any suggestion/request so long as it doesn't break existing mod (including the universal option) compatibility or there's some technical or feasibility issue that means it can't be done.

Already planned updates/features:

--putting this guy up in a git; not sure how much help it will be but why not
--porting of every feature from this other pistol start mod
https://www.doomworld.com/vb/wads-mods/74385-pistol-start-mod-for-zdoom/
--continuing from above, menudef control of cvars but also a menudefless version so that cvars can be set in menu and then loaded with menudefless version for compatibility with mods that have their own menudef
--xlat so that when playing vanilla or a supported mod, there is only one screen wipe when using the random map feature, will will work without xlat being used, just with current two screen wipe behavior
--random map feature support for loading multiple iwads at the same time
--more choices for existing options, like toggling no repeat for random map and what happens on death
--the loadout feature from above mod for supported mods; due to feasibility it won't have the same level of management of vanilla doom, but you can set for instance a shotgun to spawn on top of you in a supported mod
--updating mod support to current versions of mods
--adding support for Legendoom, Trailblazer, Diaz, Demonsteele, Smooth Doom, and any requested mods
--Adding support for maps with custom names, which will be able to be shuffled with random map feature alongside iwad maps, please suggest some.
--single cvar which enables or disables the entire mod, goal is to be able to turn it off easily so that it can be kept in your autoload without interfering with other things
--universally compatible monster health multiplier
--possibly a universally compatible player health and armor multiplier, will have options to display increased health or display health as normal (with a hacky workaround so that you actually have the real health amount.)

As I said above, also taking suggestions/requests. If asking for compatibility please link to desired file if possible.

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
×