GAMEMODE: Difference between revisions

From Zandronum Wiki
m (Whoops, missing colon)
(Added a section that explains the "GameSettings" and "LockedGameSettings" feature in 3.1-alpha, and some examples showing how to use them.)
Line 34: Line 34:
*''USETEAMITEM''
*''USETEAMITEM''
*''MAPRESET_RESETS_MAPTIME''
*''MAPRESET_RESETS_MAPTIME''
=Gameplay and compatibility settings=
{{Devfeature|3.1|alpha}} 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#DMFlags2|DMFlags2]]
*[[DMFlags#ZaDMFlags|ZaDMFlags]]
*[[DMFlags#CompatFlags|CompatFlags]]
*[[DMFlags#CompatFlags2|CompatFlags2]]
*[[DMFlags#ZaCompatFlags|ZaCompatFlags]]
*[[LMSFlags#LMSAllowedWeapons|LMSAllowedWeapons]]
*[[LMSFlags#LMSSpectatorSettings|LMSSpectatorSettings]]
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.
Flags are enabled using either <code>true</code> or <code>1</code>, or disabled using either <code>false</code> or <code>0</code>.


=Gamemode names=
=Gamemode names=
Line 59: Line 76:
cooperative {
cooperative {
     addflag PLAYERSONTEAMS
     addflag PLAYERSONTEAMS
}
</pre>
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.
<pre>
Cooperative
{
    GameSettings
    {
        sv_unblockallies = true
        sv_shootthroughallies = true
        sv_dontpushallies = true
    }
}
</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''.
<pre>
LastManStanding
{
    GameSettings
    {
        lms_allowpistol = false
        lms_spectatorchat = true
    }
    LockedGameSettings
    {
        lms_allowchainsaw = false
        lms_allowplasma = true
        lms_spectatorview = true
    }
}
}
</pre>
</pre>


[[Category:Special Lumps]]
[[Category:Special Lumps]]

Revision as of 19:10, 25 September 2021

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
}

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

Gameplay and compatibility settings

(development version 3.1-alpha and above only) You can initialize any flags belonging to gameplay or compatibility flagsets for a particular game mode. The flagsets that are currently supported are:

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.

Flags are enabled using either true or 1, or disabled using either false or 0.

Gamemode names

Must be one of the following:

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