Jump to content

GAMEMODE: Difference between revisions

993 bytes added ,  18 August 2022
Added documentation for the "singleonly" and "onlineonly" sub-blocks that are to be added in Zandronum 3.2.
(Added a list of built-in CVars that are supported by GAMEMODE in Zandronum 3.2.)
(Added documentation for the "singleonly" and "onlineonly" sub-blocks that are to be added in Zandronum 3.2.)
Line 1: Line 1:
This special lump allows the current SkullTag game modes to be reconfigured.  Such game modes can be Deathmatch, Duel, SkullTag, Capture the Flag, Possession, etc....
This special lump allows the current SkullTag game modes to be reconfigured.  Such game modes can be Deathmatch, Duel, SkullTag, Capture the Flag, Possession, etc....
The hard coded game modes internally use a bunch of flags to configure certain stuff and to share code. The GAMEMODE lump allows you to alter the flags a game mode uses so that you can combine game mode traits. The syntax for the lump is as follows:
The hard coded game modes internally use a bunch of flags to configure certain stuff and to share code. The GAMEMODE lump allows you to alter the flags a game mode uses so that you can combine game mode traits. The syntax for the lump is as follows:
GAMEMODENAME
{
    RemoveFlag FLAGNAME1
    AddFlag FLAGNAME2
    Property "Value"
    GameSettings
    {
        flagname1 = <true/false>
        flagname2 = <true/false>
       
        singleonly (3.2-alpha and above only)
        {
            CVar1 = <value>
            CVar2 = <value>
        }
       
        onlineonly (3.2-alpha and above only)
        {
            CVar3 = <value>
            CVar4 = <value>
        }
    }
    LockedGameSettings
    {
        flagname3 = <true/false>
    }
}


<pre>
=Flags =
GAMEMODENAME
{
    RemoveFlag FLAGNAME1
    AddFlag FLAGNAME2
    Property "Value"
 
    GameSettings
    {
        flagname1 = <true/false>
        flagname2 = <true/false>
    }
 
    LockedGameSettings
    {
        flagname3 = <true/false>
    }
}
</pre>
 
=Flags=
*''COOPERATIVE''
*''COOPERATIVE''
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''
*''DEATHMATCH''
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''
*''TEAMGAME''  
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''
*''USEFLAGASTEAMITEM''
Line 35: Line 44:
Display the players frags on the scoreboard
Display the players frags on the scoreboard
*''PLAYERSEARNPOINTS''
*''PLAYERSEARNPOINTS''
Display the players points (score in ctf)
Display the players points (score in ctf)  
*''PLAYERSEARNWINS''
*''PLAYERSEARNWINS''
Display the players wins on the scoreboard (used in lms)
Display the players wins on the scoreboard (used in lms)
*''DONTSPAWNMAPTHINGS''
*''DONTSPAWNMAPTHINGS''
Items and weapons aren't spawned (monsters are still spawned)
Items and weapons aren't spawned (monsters are still spawned)
*''MAPRESETS''
* ''MAPRESETS''
*''DEADSPECTATORS''
*''DEADSPECTATORS''
*''PLAYERSONTEAMS''
*''PLAYERSONTEAMS''  
Display the team selection menu when pressing the spacebar (joining)
Display the team selection menu when pressing the spacebar (joining)
*''USEMAXLIVES''
*''USEMAXLIVES''
*''USETEAMITEM''
*''USETEAMITEM''
Line 51: Line 60:


=Properties=
=Properties=
*''Name''
*''Name''  
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''
*''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.
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''
*''F1Texture''
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.
Line 62: Line 71:
*[[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 71: Line 80:
{{Devfeature|3.2|alpha}} The following CVars are also supported:
{{Devfeature|3.2|alpha}} The following CVars are also supported:


* [[Console Variables|Buckshot]]
*[[Console Variables|Buckshot]]
* [[Console Variables|Instagib]]
*[[Console Variables|Instagib]]
* [[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 forcerespawntime|SV_ForceRespawnTime]]
*[[Server Variables#sv forcerespawntime|SV_ForceRespawnTime]]
* [[Server Variables#sv flagreturntime|SV_FlagReturnTime]]
*[[Server Variables#sv flagreturntime|SV_FlagReturnTime]]
* [[Server Variables#sv gravity|SV_Gravity]]
*[[Server Variables#sv gravity|SV_Gravity]]
* [[Server Variables#sv invasioncountdowntime|SV_InvasionCountdownTime]]
*[[Server Variables#sv invasioncountdowntime|SV_InvasionCountdownTime]]
* [[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]]
* [[Server Variables#sv survivalcountdowntime|SV_SurvivalCountdownTime]]
*[[Server Variables#sv survivalcountdowntime|SV_SurvivalCountdownTime]]
* [[Server Variables#sv usemapsettingspossessionholdtime|SV_UseMapSettingsPossessionHoldTime]]
*[[Server Variables#sv usemapsettingspossessionholdtime|SV_UseMapSettingsPossessionHoldTime]]
* [[Server Variables#sv usemapsettingswavelimit|SV_UseMapSettingsWaveLimit]]
*[[Server Variables#sv usemapsettingswavelimit|SV_UseMapSettingsWaveLimit]]
* [[Server Variables#sv useteamstartsindm|SV_UseTeamStartsInDM]]
*[[Server Variables#sv useteamstartsindm|SV_UseTeamStartsInDM]]


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:  
* '''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.
*'''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.
*'''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 <code>true</code> or <code>1</code>, or disabled using either <code>false</code> or <code>0</code>.
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 <code>true</code> or <code>1</code>, or disabled using either <code>false</code> or <code>0</code>.


'''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.
==Initialzing settings for singleplayer or multiplayer only==
{{Devfeature|3.2|alpha}} By default, CVars are always initialized in singleplayer and multiplayer games. However, it is possible to create lists of CVars that you want to initialize for only singleplayer or multiplayer, or both. Inside the '''GameSettings''' and '''LockedGameSettings''' blocks, two more sub-blocks can be added:
*'''SingleOnly''' - CVars in this block are only initialized (and locked) in offline games.
* '''OnlineOnly''' - CVars in this block are only initialized (and locked) in online games.
This also works if you add these sub-blocks inside the '''DefaultGameSettings''' or '''DefaultLockedGameSettings''' blocks, which apply to all game modes.


=Gamemode names=
=Gamemode names=
Line 110: Line 127:
*[[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 119: Line 136:
*[[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]]
Line 145: Line 162:
</pre>
</pre>


This initializes some [[LMSFlags|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''.
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''.
<pre>
<pre>
LastManStanding
LastManStanding