GameType

From ZDoom Wiki
Revision as of 04:47, 17 June 2009 by Marisa Heit (talk | contribs) (Remove <tt> tag)
Jump to navigation Jump to search

int GameType (void)

Usage

Returns the game type currently being played.

Return value

The game type currently being played. For readability there are definitions defined in zdefs.acs as follows:

  • GAME_SINGLE_PLAYER = 0
Solo play.
  • GAME_NET_COOPERATIVE = 1
Cooperative net game.
  • GAME_NET_DEATHMATCH = 2
Deathmatch net game.
  • GAME_TITLE_MAP = 3
Title map

Examples

With this command it is possible to do things such as give an explanation about the map to the player.

script 1 ENTER
{
    if (GameType () != GAME_NET_DEATHMATCH)
        Print (s:"This is a deathmatch only map!");
    else
        Print (s:"BobDM1\nBy Bob");
}

Another use could be to unlock extra areas in GAME_NET_COOPERATIVE mode.