GAMEMODE: Difference between revisions
DrinkyBird (talk | contribs) No edit summary Tag: Source edit |
DrinkyBird (talk | contribs) (Add special lump warning box) Tag: Source edit |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{SpecialLumpWarning}} | |||
'''GAMEMODE''' is a special lump that allows mods to change the attributes of [[Zandronum]]'s existing [[Game modes|game modes]], and initialise and enforce certain settings when certain game modes are in use. | |||
The full syntax of the lump is as such: | |||
GAMEMODENAME | GAMEMODENAME | ||
{ | { | ||
Line 9: | Line 12: | ||
GameSettings | GameSettings | ||
{ | { | ||
CVar1 = <value> | |||
CVar2 = <value> | |||
offlineonly {{Devfeature|3.2|alpha}} | |||
{ | { | ||
CVar3 = <value> | |||
CVar4 = <value> | |||
} | } | ||
onlineonly {{Devfeature|3.2|alpha}} | onlineonly {{Devfeature|3.2|alpha}} | ||
{ | { | ||
CVar5 = <value> | |||
CVar6 = <value> | |||
} | } | ||
} | } | ||
Line 27: | Line 30: | ||
LockedGameSettings | LockedGameSettings | ||
{ | { | ||
CVar7 = <value> | |||
} | } | ||
} | } | ||
=Flags = | =Flags= | ||
*''COOPERATIVE'' | *<code>'''COOPERATIVE'''</code> | ||
Cooperative is a flag that distinguishes the coop modes ([[Game_Modes#Cooperative|Cooperative]], [[Game_Modes#Cooperative_Survival|Survival]], [[Game_Modes#Invasion|Invasion]]) from others game modes. | Cooperative is a flag that distinguishes the coop modes ([[Game_Modes#Cooperative|Cooperative]], [[Game_Modes#Cooperative_Survival|Survival]], [[Game_Modes#Invasion|Invasion]]) from others game modes. | ||
*''DEATHMATCH'' | *<code>'''DEATHMATCH'''</code> | ||
Players are spawned at deathmatch starts (needs Zandronum 3.0 to work properly). | Players are spawned at deathmatch starts (needs Zandronum 3.0 to work properly). | ||
*''TEAMGAME'' | *<code>'''TEAMGAME'''</code> | ||
Players are spawned at team starts (needs Zandronum 3.0 to work properly). | Players are spawned at team starts (needs Zandronum 3.0 to work properly). | ||
*''USEFLAGASTEAMITEM'' | *<code>'''USEFLAGASTEAMITEM'''</code> | ||
*''PLAYERSEARNKILLS'' | Forces a game mode to use a team's flag item or icon instead of their skull. | ||
*<code>'''PLAYERSEARNKILLS'''</code> | |||
*''PLAYERSEARNFRAGS'' | Players earn kills from monsters. This also displays their kills on the scoreboard. | ||
*<code>'''PLAYERSEARNFRAGS'''</code> | |||
*''PLAYERSEARNPOINTS'' | Players/teams win the game by killing enemy players. | ||
*<code>'''PLAYERSEARNPOINTS'''</code> | |||
*''PLAYERSEARNWINS'' | Players or teams win the game by earning points (e.g. capturing the flag in CTF). This also displays how many points a player or team has on the scoreboard. | ||
*<code>'''PLAYERSEARNWINS'''</code> | |||
*''DONTSPAWNMAPTHINGS'' | Players or teams win the game by winning rounds (particularly used in LMS). This also displays how many wins a player or team has on the scoreboard. | ||
Items and weapons aren't spawned (monsters are still spawned) | *<code>'''DONTSPAWNMAPTHINGS'''</code> | ||
* ''MAPRESETS'' | Items and weapons aren't spawned (monsters are still spawned). | ||
*''DEADSPECTATORS'' | *<code>'''MAPRESETS'''</code> | ||
*''PLAYERSONTEAMS'' | The map can be reset to the same state that it was when it was first started. The [[ResetMap]] ACS function and "ResetMap" CCMD require this flag to be added to work. | ||
*<code>'''DEADSPECTATORS'''</code> | |||
*''USEMAXLIVES'' | Enables support for dead spectators, which are players that are dead and cannot rejoin until the round is over. | ||
*''USETEAMITEM'' | *<code>'''PLAYERSONTEAMS'''</code> | ||
*''MAPRESET_RESETS_MAPTIME'' | Players are organized into teams, and displays the team selection menu when pressing the spacebar to join the game. | ||
*''DONTPRINTPLAYERSLEFT'' | *<code>'''USEMAXLIVES'''</code> | ||
Players have a limited number of lives, controlled by the [[Server_Variables#sv_maxlives|sv_maxlives]] CVar. | |||
*<code>'''USETEAMITEM'''</code> | |||
Enables support for a team's flag or skull item in CTF and Skulltag respectively, or the white flag in 1-flag CTF. | |||
* <code>'''MAPRESET_RESETS_MAPTIME'''</code> | |||
Resetting the map also resets the level time. This also prevents the time limit from being active while the game isn't in progress. | |||
* <code>'''DONTPRINTPLAYERSLEFT'''</code> | |||
Prevents the "x allies/opponents left" message from being drawn on the screen. | Prevents the "x allies/opponents left" message from being drawn on the screen. | ||
=Properties= | =Properties= | ||
*''Name'' | * <code>'''Name'''</code> | ||
The name of the game mode as it appears on the scoreboard, countdown screen, and server console window. | The name of the game mode as it appears on the scoreboard, countdown screen, and server console window. | ||
*''ShortName'' | *<code>'''ShortName'''</code> | ||
This is generally a shorter and abbreviated version of the game mode's name. This is only used in the built-in server browser. | This is generally a shorter and abbreviated version of the game mode's name. This is only used in the built-in server browser. | ||
*''F1Texture'' | *<code>'''F1Texture'''</code> | ||
The graphic that will be drawn in the "Read This!" menu in non-single player games if no other help page is defined. | The graphic that will be drawn in the "Read This!" menu in non-single player games if no other help page is defined. | ||
*<code>'''WelcomeSound'''</code> {{Devfeature|3.2|alpha}} | |||
The announcer sound that's played at the start of a new game. For example, "welcome to capture the flag" or "welcome to Skulltag" in CTF and Skulltag respectively. | |||
=Gameplay and | =Gameplay and Compatibility Settings= | ||
You can initialize any flags belonging to gameplay or compatibility flagsets for a particular game mode. The flagsets that are currently supported are: | You can initialize any flags belonging to gameplay or compatibility flagsets for a particular game mode. The flagsets that are currently supported are: | ||
*[[DMFlags#DMFlags|DMFlags]] | *[[DMFlags#DMFlags|DMFlags]] | ||
*[[DMFlags#DMFlags2|DMFlags2]] | *[[DMFlags#DMFlags2|DMFlags2]] | ||
* [[DMFlags#ZaDMFlags|ZaDMFlags]] | *[[DMFlags#ZaDMFlags|ZaDMFlags]] | ||
*[[DMFlags#CompatFlags|CompatFlags]] | *[[DMFlags#CompatFlags|CompatFlags]] | ||
*[[DMFlags#CompatFlags2|CompatFlags2]] | *[[DMFlags#CompatFlags2|CompatFlags2]] | ||
* [[DMFlags#ZaCompatFlags|ZaCompatFlags]] | *[[DMFlags#ZaCompatFlags|ZaCompatFlags]] | ||
*[[LMSFlags#LMSAllowedWeapons|LMSAllowedWeapons]] | *[[LMSFlags#LMSAllowedWeapons|LMSAllowedWeapons]] | ||
*[[LMSFlags#LMSSpectatorSettings|LMSSpectatorSettings]] | *[[LMSFlags#LMSSpectatorSettings|LMSSpectatorSettings]] | ||
Line 80: | Line 91: | ||
{{Devfeature|3.2|alpha}} The following CVars are also supported: | {{Devfeature|3.2|alpha}} The following CVars are also supported: | ||
*[[Console Variables|AlwaysApplyDMFlags]] | |||
*[[Console Variables|Buckshot]] | *[[Console Variables|Buckshot]] | ||
*[[Console Variables|DuelLimit]] | |||
*[[Console Variables|FragLimit]] | |||
*[[Console Variables|Instagib]] | *[[Console Variables|Instagib]] | ||
*[[Console Variables|PointLimit]] | |||
*[[Server Variables#sv aircontrol|SV_AirControl]] | *[[Server Variables#sv aircontrol|SV_AirControl]] | ||
*[[Server Variables#sv artifactreturntime|SV_ArtifactReturnTime]] | *[[Server Variables#sv artifactreturntime|SV_ArtifactReturnTime]] | ||
*[[Server Variables#sv coop damagefactor|SV_Coop_DamageFactor]] | *[[Server Variables#sv coop damagefactor|SV_Coop_DamageFactor]] | ||
*[[Server Variables#sv duelcountdowntime|SV_DuelCountdownTime]] | *[[Server Variables#sv duelcountdowntime|SV_DuelCountdownTime]] | ||
*[[Server Variables#sv fastweapons|SV_FastWeapons]] | |||
*[[Server Variables#sv forcerespawntime|SV_ForceRespawnTime]] | *[[Server Variables#sv forcerespawntime|SV_ForceRespawnTime]] | ||
*[[Server Variables#sv flagreturntime|SV_FlagReturnTime]] | *[[Server Variables#sv flagreturntime|SV_FlagReturnTime]] | ||
Line 92: | Line 108: | ||
* [[Server Variables#sv lmscountdowntime|SV_LMSCountdownTime]] | * [[Server Variables#sv lmscountdowntime|SV_LMSCountdownTime]] | ||
*[[Server Variables#sv maprotation|SV_MapRotation]] | *[[Server Variables#sv maprotation|SV_MapRotation]] | ||
*[[Server Variables#sv maxlives|SV_MaxLives]] | *[[Server Variables#sv maxlives|SV_MaxLives]] | ||
*[[Server Variables#sv maxplayers|SV_MaxPlayers]] | *[[Server Variables#sv maxplayers|SV_MaxPlayers]] | ||
*[[Server Variables#sv maxteams|SV_MaxTeams]] | *[[Server Variables#sv maxteams|SV_MaxTeams]] | ||
*[[Server Variables#sv possessioncountdowntime|SV_PossessionCountdownTime]] | *[[Server Variables#sv possessioncountdowntime|SV_PossessionCountdownTime]] | ||
*[[Server Variables#sv possessionholdtime|SV_PossessionHoldTime]] | *[[Server Variables#sv possessionholdtime|SV_PossessionHoldTime]] | ||
*[[Server Variables#sv randomcoopstarts|SV_RandomCoopStarts]] | *[[Server Variables#sv randomcoopstarts|SV_RandomCoopStarts]] | ||
*[[Server Variables#sv randommaprotation|SV_RandomMapRotation]] | * [[Server Variables#sv randommaprotation|SV_RandomMapRotation]] | ||
*[[Server Variables#sv respawndelaytime|SV_RespawnDelayTime]] | *[[Server Variables#sv respawndelaytime|SV_RespawnDelayTime]] | ||
*[[Server Variables#sv suddendeath|SV_SuddenDeath]] | *[[Server Variables#sv suddendeath|SV_SuddenDeath]] | ||
Line 105: | Line 121: | ||
*[[Server Variables#sv usemapsettingswavelimit|SV_UseMapSettingsWaveLimit]] | *[[Server Variables#sv usemapsettingswavelimit|SV_UseMapSettingsWaveLimit]] | ||
*[[Server Variables#sv useteamstartsindm|SV_UseTeamStartsInDM]] | *[[Server Variables#sv useteamstartsindm|SV_UseTeamStartsInDM]] | ||
*[[Console Variables|TeamDamage]] | |||
*[[Console Variables|TimeLimit]] | |||
*[[Console Variables|WaveLimit]] | |||
*[[Console Variables|WinLimit]] | |||
There are two different blocks that are used to initialize these flags, with different attributes: | There are two different blocks that are used to initialize these flags, with different attributes: | ||
Line 114: | Line 134: | ||
'''Note:''' loading another '''DefaultGameSettings''' or '''DefaultLockedGameSettings''' block in a subsequent GAMEMODE lump will reset all the flags and their attributes back to zero. | '''Note:''' loading another '''DefaultGameSettings''' or '''DefaultLockedGameSettings''' block in a subsequent GAMEMODE lump will reset all the flags and their attributes back to zero. | ||
= | =Settings for Offline or Online Games Only= | ||
{{Devfeature|3.2|alpha}} By default, CVars are always initialized | {{Devfeature|3.2|alpha}} By default, CVars are always initialized, for both offline (i.e. singleplayer or if multiplayer emulation is enabled) and online games. However, if a mod needs certain CVars to be set up differently for offline games or online games, then it's possible to insert two kinds of sub-blocks: | ||
*''' | *'''OfflineOnly''' - CVars in this block will be initialized in offline games only. | ||
* '''OnlineOnly''' - CVars in this block | *'''OnlineOnly''' - CVars in this block will be initialized in online games only. | ||
The same CVar can be inserted in an '''OfflineOnly''' and '''OnlineOnly''' sub-block at the same time. It's guaranteed that the value specified in the former will be applied in offline games, while the value specified in the latter will be applied in online games. It's also possible to add these sub-blocks inside the '''DefaultGameSettings''' or '''DefaultLockedGameSettings''' blocks, which will be applied to all game modes. | |||
= | =Game Mode Names= | ||
Must be one of the following: | Must be one of the following: | ||
*[[Game_Modes#Cooperative|Cooperative]] | *[[Game_Modes#Cooperative|Cooperative]] | ||
*[[Game_Modes#Cooperative_Survival|Survival]] | *[[Game_Modes#Cooperative_Survival|Survival]] | ||
*[[Game_Modes#Invasion|Invasion]] | *[[Game_Modes#Invasion|Invasion]] | ||
* [[Game_Modes#Deathmatch|Deathmatch]] | *[[Game_Modes#Deathmatch|Deathmatch]] | ||
*[[Game_Modes#Team_Deathmatch|Teamplay]] | *[[Game_Modes#Team_Deathmatch|Teamplay]] | ||
*[[Game_Modes#Duel|Duel]] | *[[Game_Modes#Duel|Duel]] | ||
Line 136: | Line 156: | ||
*[[Game_Modes#Team_Possession|TeamPossession]] | *[[Game_Modes#Team_Possession|TeamPossession]] | ||
*[[Game_Modes#Team_Game|TeamGame]] | *[[Game_Modes#Team_Game|TeamGame]] | ||
*[[Game_Modes#Capture_the_Flag|CTF]] | *[[Game_Modes#Capture_the_Flag|CTF]] | ||
*[[Game_Modes#One_Flag_Capture_the_Flag|OneFlagCTF]] | *[[Game_Modes#One_Flag_Capture_the_Flag|OneFlagCTF]] | ||
*[[Game_Modes#Skull_Tag|Skulltag]] | *[[Game_Modes#Skull_Tag|Skulltag]] |
Latest revision as of 20:29, 2 January 2023
This article documents a Zandronum-specific special lump which may not be supported by ZDoom and its other child ports. |
GAMEMODE is a special lump that allows mods to change the attributes of Zandronum's existing game modes, and initialise and enforce certain settings when certain game modes are in use.
The full syntax of the lump is as such:
GAMEMODENAME { RemoveFlag FLAGNAME1 AddFlag FLAGNAME2 Property "Value" GameSettings { CVar1 = <value> CVar2 = <value> offlineonly (development version 3.2-alpha and above only) { CVar3 = <value> CVar4 = <value> } onlineonly (development version 3.2-alpha and above only) { CVar5 = <value> CVar6 = <value> } } LockedGameSettings { CVar7 = <value> } }
Flags
COOPERATIVE
Cooperative is a flag that distinguishes the coop modes (Cooperative, Survival, Invasion) from others game modes.
DEATHMATCH
Players are spawned at deathmatch starts (needs Zandronum 3.0 to work properly).
TEAMGAME
Players are spawned at team starts (needs Zandronum 3.0 to work properly).
USEFLAGASTEAMITEM
Forces a game mode to use a team's flag item or icon instead of their skull.
PLAYERSEARNKILLS
Players earn kills from monsters. This also displays their kills on the scoreboard.
PLAYERSEARNFRAGS
Players/teams win the game by killing enemy players.
PLAYERSEARNPOINTS
Players or teams win the game by earning points (e.g. capturing the flag in CTF). This also displays how many points a player or team has on the scoreboard.
PLAYERSEARNWINS
Players or teams win the game by winning rounds (particularly used in LMS). This also displays how many wins a player or team has on the scoreboard.
DONTSPAWNMAPTHINGS
Items and weapons aren't spawned (monsters are still spawned).
MAPRESETS
The map can be reset to the same state that it was when it was first started. The ResetMap ACS function and "ResetMap" CCMD require this flag to be added to work.
DEADSPECTATORS
Enables support for dead spectators, which are players that are dead and cannot rejoin until the round is over.
PLAYERSONTEAMS
Players are organized into teams, and displays the team selection menu when pressing the spacebar to join the game.
USEMAXLIVES
Players have a limited number of lives, controlled by the sv_maxlives CVar.
USETEAMITEM
Enables support for a team's flag or skull item in CTF and Skulltag respectively, or the white flag in 1-flag CTF.
MAPRESET_RESETS_MAPTIME
Resetting the map also resets the level time. This also prevents the time limit from being active while the game isn't in progress.
DONTPRINTPLAYERSLEFT
Prevents the "x allies/opponents left" message from being drawn on the screen.
Properties
Name
The name of the game mode as it appears on the scoreboard, countdown screen, and server console window.
ShortName
This is generally a shorter and abbreviated version of the game mode's name. This is only used in the built-in server browser.
F1Texture
The graphic that will be drawn in the "Read This!" menu in non-single player games if no other help page is defined.
WelcomeSound
(development version 3.2-alpha and above only)
The announcer sound that's played at the start of a new game. For example, "welcome to capture the flag" or "welcome to Skulltag" in CTF and Skulltag respectively.
Gameplay and Compatibility Settings
You can initialize any flags belonging to gameplay or compatibility flagsets for a particular game mode. The flagsets that are currently supported are:
- DMFlags
- DMFlags2
- ZaDMFlags
- CompatFlags
- CompatFlags2
- ZaCompatFlags
- LMSAllowedWeapons
- LMSSpectatorSettings
(development version 3.2-alpha and above only) The following CVars are also supported:
- AlwaysApplyDMFlags
- Buckshot
- DuelLimit
- FragLimit
- Instagib
- PointLimit
- SV_AirControl
- SV_ArtifactReturnTime
- SV_Coop_DamageFactor
- SV_DuelCountdownTime
- SV_FastWeapons
- SV_ForceRespawnTime
- SV_FlagReturnTime
- SV_Gravity
- SV_InvasionCountdownTime
- SV_LMSCountdownTime
- SV_MapRotation
- SV_MaxLives
- SV_MaxPlayers
- SV_MaxTeams
- SV_PossessionCountdownTime
- SV_PossessionHoldTime
- SV_RandomCoopStarts
- SV_RandomMapRotation
- SV_RespawnDelayTime
- SV_SuddenDeath
- SV_SurvivalCountdownTime
- SV_UseMapSettingsPossessionHoldTime
- SV_UseMapSettingsWaveLimit
- SV_UseTeamStartsInDM
- TeamDamage
- TimeLimit
- WaveLimit
- WinLimit
There are two different blocks that are used to initialize these flags, with different attributes:
- GameSettings - flags can still be changed during gameplay. This is useful for mods that want to change certain flags by default but still allow the host to change as they see fit.
- LockedGameSettings - flags can never be changed, and attempting to do so will print an error message. This is useful for mods that need certain flags enabled or disabled and don't want the host to mess with those settings.
If you want to initialize flags universally for your mod, you can add the DefaultGameSettings or DefaultLockedGameSettings blocks at the beginning of the file, which are applied across all game modes. You may then override some of these flags by also adding them to specific game modes. Additionally, if you want to remove a flag from a game mode, use RemoveGameSetting followed by the flag's name. Flags are enabled using either true
or 1
, or disabled using either false
or 0
.
Note: loading another DefaultGameSettings or DefaultLockedGameSettings block in a subsequent GAMEMODE lump will reset all the flags and their attributes back to zero.
Settings for Offline or Online Games Only
(development version 3.2-alpha and above only) By default, CVars are always initialized, for both offline (i.e. singleplayer or if multiplayer emulation is enabled) and online games. However, if a mod needs certain CVars to be set up differently for offline games or online games, then it's possible to insert two kinds of sub-blocks:
- OfflineOnly - CVars in this block will be initialized in offline games only.
- OnlineOnly - CVars in this block will be initialized in online games only.
The same CVar can be inserted in an OfflineOnly and OnlineOnly sub-block at the same time. It's guaranteed that the value specified in the former will be applied in offline games, while the value specified in the latter will be applied in online games. It's also possible to add these sub-blocks inside the DefaultGameSettings or DefaultLockedGameSettings blocks, which will be applied to all game modes.
Game Mode Names
Must be one of the following:
- Cooperative
- Survival
- Invasion
- Deathmatch
- Teamplay
- Duel
- Terminator
- LastManStanding
- TeamLMS
- Possession
- TeamPossession
- TeamGame
- CTF
- OneFlagCTF
- Skulltag
- Domination
Example
For instance, if you would like to have teams in coop, the lump needs to be:
cooperative { addflag PLAYERSONTEAMS }
A cooperative-based mod might want players to be able to walk and shoot through their teammates, and also prevent their attacks from pushing them around. Note that here, the server host has the option to enable or disable these flags if they feel like it.
Cooperative { GameSettings { sv_unblockallies = true sv_shootthroughallies = true sv_dontpushallies = true } }
This initializes some LMSFlags for the Last Man Standing game mode. By default, players can't start with a pistol or chainsaw, but they are guarantee to start with a plasma rifle. In addition, spectators are free to view and chat with live players. Note that here, the server host is allowed to modify lms_allowpistol and lms_spectatorchat, but is forbidden from changing lms_allowchainsaw, lms_allowplasma, and lms_spectatorview.
LastManStanding { GameSettings { lms_allowpistol = false lms_spectatorchat = true } LockedGameSettings { lms_allowchainsaw = false lms_allowplasma = true lms_spectatorview = true } }