SetCurrentGameMode: Difference between revisions

From Zandronum Wiki
(3.1 is released, so Devfeature templates have been removed)
No edit summary
Tag: Source edit
Line 3: Line 3:
int '''SetCurrentGameMode''' (str ''gamemode'')
int '''SetCurrentGameMode''' (str ''gamemode'')


==Usage==
== Usage ==
Changes the current game mode, which also resets the game upon success. This requires players to reconnect to the server when it happens. For forwards-compatibility, ''gamemode'' is entered as a string and must be one of the following:
Changes the current game mode, which also resets the game upon success. This requires players to reconnect to the server when it happens.  
*[[Game_Modes#Cooperative|Cooperative]]
*[[Game_Modes#Cooperative_Survival|Survival]]
*[[Game_Modes#Invasion|Invasion]]
*[[Game_Modes#Deathmatch|Deathmatch]]
*[[Game_Modes#Team_Deathmatch|Teamplay]]
*[[Game_Modes#Duel|Duel]]
*[[Game_Modes#Terminator|Terminator]]
*[[Game_Modes#Last_Man_Standing|LastManStanding]]
*[[Game_Modes#Team_Last_Man_Standing|TeamLMS]]
*[[Game_Modes#Possession|Possession]]
*[[Game_Modes#Team_Possession|TeamPossession]]
*[[Game_Modes#Team_Game|TeamGame]]
*[[Game_Modes#Capture_the_Flag|CTF]]
*[[Game_Modes#One_Flag_Capture_the_Flag|OneFlagCTF]]
*[[Game_Modes#Skull_Tag|Skulltag]]
*[[Game_Modes#Domination|Domination]]


==Return Value==
=== Parameters ===
* ''gamemode'': For forwards-compatibility, the game mode is passed as a string and must be one of the following:
** [[Game_Modes#Cooperative|Cooperative]]
** [[Game_Modes#Cooperative_Survival|Survival]]
** [[Game_Modes#Invasion|Invasion]]
** [[Game_Modes#Deathmatch|Deathmatch]]
** [[Game_Modes#Team_Deathmatch|Teamplay]]
** [[Game_Modes#Duel|Duel]]
** [[Game_Modes#Terminator|Terminator]]
** [[Game_Modes#Last_Man_Standing|LastManStanding]]
** [[Game_Modes#Team_Last_Man_Standing|TeamLMS]]
** [[Game_Modes#Possession|Possession]]
** [[Game_Modes#Team_Possession|TeamPossession]]
** [[Game_Modes#Team_Game|TeamGame]]
** [[Game_Modes#Capture_the_Flag|CTF]]
** [[Game_Modes#One_Flag_Capture_the_Flag|OneFlagCTF]]
** [[Game_Modes#Skull_Tag|Skulltag]]
** [[Game_Modes#Domination|Domination]]
 
=== Return Value ===
Returns 1 if the game mode was changed, or 0 if it wasn't. There are several reasons why a game mode might not change:
Returns 1 if the game mode was changed, or 0 if it wasn't. There are several reasons why a game mode might not change:
* The new game mode either doesn't exist, or is already being played.
* The new game mode either doesn't exist, or is already being played.
Line 29: Line 32:
* The result sequence is currently active. Refer to [[GetGameModeState#GAMESTATE_INRESULTSEQUENCE|GetGameModeState]].
* The result sequence is currently active. Refer to [[GetGameModeState#GAMESTATE_INRESULTSEQUENCE|GetGameModeState]].


[[category:ACS Functions]]
== Examples ==
{{noexamples}}
 
[[category:ACS functions]]

Revision as of 01:45, 3 July 2022

This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

int SetCurrentGameMode (str gamemode)

Usage

Changes the current game mode, which also resets the game upon success. This requires players to reconnect to the server when it happens.

Parameters

Return Value

Returns 1 if the game mode was changed, or 0 if it wasn't. There are several reasons why a game mode might not change:

  • The new game mode either doesn't exist, or is already being played.
  • The current level cannot support the new game mode (e.g. no team starts in a team-based game mode, no deathmatch starts in a deathmatch-based game mode, or no coop starts in a cooperative-based game mode).
  • The new game mode is Duel and there's more than two players already in the game.
  • The result sequence is currently active. Refer to GetGameModeState.

Examples

This article lists no examples, please add one.