ZDoom Pistol Start Options

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
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