GAMEMODE: Difference between revisions

4,450 bytes added ,  29 November 2022
Updated GAMEMODE lump information up to 3.2-alpha.
(These changes aren't actually available in 3.2 yet. To save any confusion, I will remove them from this page until they are officially added.)
Tag: Source edit
(Updated GAMEMODE lump information up to 3.2-alpha.)
Tag: Source edit
Line 9: Line 9:
     GameSettings
     GameSettings
     {
     {
         flagname1 = <true/false>
         CVar1 = <value>
         flagname2 = <true/false>
         CVar2 = <value>
        offlineonly {{Devfeature|3.2|alpha}}
        {
            CVar3 = <value>
            CVar4 = <value>
        }
       
        onlineonly {{Devfeature|3.2|alpha}}
        {
            CVar5 = <value>
            CVar6 = <value>
        }
     }
     }
   
   
     LockedGameSettings
     LockedGameSettings
     {
     {
         flagname3 = <true/false>
         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.
Display the players kills (monsters) on the scoreboard
*<code>'''PLAYERSEARNKILLS'''</code>
*''PLAYERSEARNFRAGS''
Players earn kills from monsters. This also displays their kills on the scoreboard.
Display the players frags on the scoreboard
*<code>'''PLAYERSEARNFRAGS'''</code>
*''PLAYERSEARNPOINTS''
Players/teams win the game by killing enemy players.
Display the players points (score in ctf)  
*<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.
Display the players wins on the scoreboard (used in lms)
*<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.
Display the team selection menu when pressing the spacebar (joining) 
*<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 compatibility settings=
=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]]
{{Devfeature|3.2|alpha}} The following CVars are also supported:
*[[Console Variables|AlwaysApplyDMFlags]]
*[[Console Variables|Buckshot]]
*[[Console Variables|DuelLimit]]
*[[Console Variables|FragLimit]]
*[[Console Variables|Instagib]]
*[[Console Variables|PointLimit]]
*[[Server Variables#sv aircontrol|SV_AirControl]]
*[[Server Variables#sv artifactreturntime|SV_ArtifactReturnTime]]
*[[Server Variables#sv coop damagefactor|SV_Coop_DamageFactor]]
*[[Server Variables#sv duelcountdowntime|SV_DuelCountdownTime]]
*[[Server Variables#sv fastweapons|SV_FastWeapons]]
*[[Server Variables#sv forcerespawntime|SV_ForceRespawnTime]]
*[[Server Variables#sv flagreturntime|SV_FlagReturnTime]]
*[[Server Variables#sv gravity|SV_Gravity]]
*[[Server Variables#sv invasioncountdowntime|SV_InvasionCountdownTime]]
* [[Server Variables#sv lmscountdowntime|SV_LMSCountdownTime]]
*[[Server Variables#sv maprotation|SV_MapRotation]]
*[[Server Variables#sv maxlives|SV_MaxLives]]
*[[Server Variables#sv maxplayers|SV_MaxPlayers]]
*[[Server Variables#sv maxteams|SV_MaxTeams]]
*[[Server Variables#sv possessioncountdowntime|SV_PossessionCountdownTime]]
*[[Server Variables#sv possessionholdtime|SV_PossessionHoldTime]]
*[[Server Variables#sv randomcoopstarts|SV_RandomCoopStarts]]
* [[Server Variables#sv randommaprotation|SV_RandomMapRotation]]
*[[Server Variables#sv respawndelaytime|SV_RespawnDelayTime]]
*[[Server Variables#sv suddendeath|SV_SuddenDeath]]
*[[Server Variables#sv survivalcountdowntime|SV_SurvivalCountdownTime]]
*[[Server Variables#sv usemapsettingspossessionholdtime|SV_UseMapSettingsPossessionHoldTime]]
*[[Server Variables#sv usemapsettingswavelimit|SV_UseMapSettingsWaveLimit]]
*[[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 74: Line 131:
'''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.


This also works if you add these sub-blocks inside the '''DefaultGameSettings''' or '''DefaultLockedGameSettings''' blocks, which apply to all game modes.
=Settings for Offline or Online Games Only=
{{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 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.


=Gamemode names=
=Game Mode Names=
Must be one of the following:
Must be one of the following:
*[[Game_Modes#Cooperative|Cooperative]]
*[[Game_Modes#Cooperative|Cooperative]]