GAMEMODE: Difference between revisions
(Added documentation for the "singleonly" and "onlineonly" sub-blocks that are to be added in Zandronum 3.2.) |
DrinkyBird (talk | contribs) No edit summary Tag: Source edit |
||
Line 12: | Line 12: | ||
flagname2 = <true/false> | flagname2 = <true/false> | ||
singleonly | singleonly {{Devfeature|3.2|alpha}} | ||
{ | { | ||
CVar1 = <value> | CVar1 = <value> | ||
Line 18: | Line 18: | ||
} | } | ||
onlineonly | onlineonly {{Devfeature|3.2|alpha}} | ||
{ | { | ||
CVar3 = <value> | CVar3 = <value> |
Revision as of 21:51, 21 August 2022
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:
GAMEMODENAME { RemoveFlag FLAGNAME1 AddFlag FLAGNAME2 Property "Value" GameSettings { flagname1 = <true/false> flagname2 = <true/false> singleonly (development version 3.2-alpha and above only) { CVar1 = <value> CVar2 = <value> } onlineonly (development version 3.2-alpha and above only) { CVar3 = <value> CVar4 = <value> } } LockedGameSettings { flagname3 = <true/false> } }
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
- PLAYERSEARNKILLS
Display the players kills (monsters) on the scoreboard
- PLAYERSEARNFRAGS
Display the players frags on the scoreboard
- PLAYERSEARNPOINTS
Display the players points (score in ctf)
- PLAYERSEARNWINS
Display the players wins on the scoreboard (used in lms)
- DONTSPAWNMAPTHINGS
Items and weapons aren't spawned (monsters are still spawned)
- MAPRESETS
- DEADSPECTATORS
- PLAYERSONTEAMS
Display the team selection menu when pressing the spacebar (joining)
- USEMAXLIVES
- USETEAMITEM
- MAPRESET_RESETS_MAPTIME
- 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.
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:
- Buckshot
- Instagib
- SV_AirControl
- SV_ArtifactReturnTime
- SV_Coop_DamageFactor
- SV_DuelCountdownTime
- 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
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.
Initialzing settings for singleplayer or multiplayer only
(development version 3.2-alpha and above only) 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
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 } }