Class GameMode
GameMode is a subclass of GameModeBase that behaves like a multiplayer match-based game.
Inherited Members
Namespace: UE4.Engine
Assembly: UE4DotNet.dll
Syntax
public class GameMode : GameModeBase
Remarks
It has default behavior for picking spawn points and match state. If you want a simpler base, inherit from GameModeBase instead.
Properties
| Improve this Doc View SourcebDelayedStart
Declaration
public bool bDelayedStart { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
bHandleDedicatedServerReplays
Declaration
public bool bHandleDedicatedServerReplays { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DefaultObject
Get UE4 Default Object for this Class
Declaration
public static GameMode DefaultObject { get; }
Property Value
Type | Description |
---|---|
GameMode |
EngineMessageClass
Contains strings describing localized game agnostic messages.
Declaration
public SubclassOf<LocalMessage> EngineMessageClass { get; set; }
Property Value
Type | Description |
---|---|
SubclassOf<LocalMessage> |
InactivePlayerArray
PlayerStates of players who have disconnected from the server (saved in case they reconnect)
Declaration
public ObjectArrayField<PlayerState> InactivePlayerArray { get; }
Property Value
Type | Description |
---|---|
ObjectArrayField<PlayerState> |
InactivePlayerStateLifeSpan
Time a playerstate will stick around in an inactive state after a player logout
Declaration
public float InactivePlayerStateLifeSpan { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
MatchState
What match state we are currently in
Declaration
public Name MatchState { get; set; }
Property Value
Type | Description |
---|---|
Name |
MaxInactivePlayers
The maximum number of inactive players before we kick the oldest ones out
Declaration
public int MaxInactivePlayers { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MinRespawnDelay
Minimum time before player can respawn after dying.
Declaration
public float MinRespawnDelay { get; }
Property Value
Type | Description |
---|---|
System.Single |
NumBots
number of non-human players (AI controlled but participating as a player).
Declaration
public int NumBots { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
NumPlayers
Current number of human players.
Declaration
public int NumPlayers { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
NumSpectators
Current number of spectators.
Declaration
public int NumSpectators { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
NumTravellingPlayers
Number of players that are still traveling from a previous map
Declaration
public int NumTravellingPlayers { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
Type | Description |
---|---|
Class |
Methods
| Improve this Doc View SourceAbortMatch()
Report that a match has failed due to unrecoverable error
Declaration
public void AbortMatch()
EndMatch()
Transition from InProgress to WaitingPostMatch. You can call this manually, will also get called if ReadyToEndMatch returns true
Declaration
public void EndMatch()
GetMatchState()
Returns the current match state, this is an accessor to protect the state machine flow
Declaration
public Name GetMatchState()
Returns
Type | Description |
---|---|
Name |
HasMatchEnded()
Returns true if the match state is WaitingPostMatch or later
Declaration
public bool HasMatchEnded()
Returns
Type | Description |
---|---|
System.Boolean |
IsMatchInProgress()
Returns true if the match state is InProgress or other gameplay state
Declaration
public bool IsMatchInProgress()
Returns
Type | Description |
---|---|
System.Boolean |
New(UObject, Name)
Spawn an object of this class
Declaration
public static GameMode New(UObject obj = null, Name name = default(Name))
Parameters
Type | Name | Description |
---|---|---|
UObject | obj | |
Name | name |
Returns
Type | Description |
---|---|
GameMode |
RestartGame()
Restart the game, by default travel to the current map
Declaration
public void RestartGame()
Say(String)
Exec command to broadcast a string to all players
Declaration
public void Say(string Msg)
Parameters
Type | Name | Description |
---|---|---|
System.String | Msg |
StartMatch()
Transition from WaitingToStart to InProgress. You can call this manually, will also get called if ReadyToStartMatch returns true
Declaration
public void StartMatch()
Events
| Improve this Doc View SourceK2_OnSetMatchState
Implementable event to respond to match state changes
Declaration
public event GameMode.K2_OnSetMatchState_delegate K2_OnSetMatchState
Event Type
Type | Description |
---|---|
GameMode.K2_OnSetMatchState_delegate |
ReadyToEndMatch
@return true if ready to End Match. Games should override this
Declaration
public event GameMode.ReadyToEndMatch_delegate ReadyToEndMatch
Event Type
Type | Description |
---|---|
GameMode.ReadyToEndMatch_delegate |
ReadyToStartMatch
@return True if ready to Start Match. Games should override this
Declaration
public event GameMode.ReadyToStartMatch_delegate ReadyToStartMatch
Event Type
Type | Description |
---|---|
GameMode.ReadyToStartMatch_delegate |
Operators
| Improve this Doc View SourceImplicit(IntPtr to GameMode)
Convert from IntPtr to UObject
Declaration
public static implicit operator GameMode(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | p |
Returns
Type | Description |
---|---|
GameMode |