Gah - a solution with more questions. – EntropicLqd

Legacy:GameInfo (UT)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT :: Object >> Actor >> Info (UT) >> GameInfo (Package: Engine)

A GameInfo subclass contains the rules for a gametype. This includes timelimit, fraglimit, scoring, difficulty, game speed, allowed playerpawn classes, default inventory assignment, and if appropriate, team assignment and general bot behavior.

This is assigned to a map in the Level Properties window, under LevelInfo -> DefaultGameType.

The GameInfo for the current game can be retrieved from every actor in that game via Level.Game, but only on the server. GameInfo is not replicated to network clients; only GameReplicationInfo (UT) is.

See GameInfo for the UT200x version of this class.

Properties[edit]

Globalconfig Properties[edit]

bool bMuteSpectators 
Whether spectators are allowed to speak.
bool bLowGore 
Whether or not to reduce gore.
bool bVeryLowGore 
Greatly reduces gore.
bool bNoCheating 
Disallows cheating. Hehe.
bool bAllowFOV 
Allows FOV changes in net games
bool bExternalBatcher 
float AutoAim 
How much autoaiming to do (1 = none, 0 = always). (cosine of max error to correct)
float GameSpeed 
Scale applied to game rate.
int MaxSpectators 
Maximum number of spectators.
private string AdminPassword 
Password to receive bAdmin privileges.
private string GamePassword 
Password to enter game.
int MaxPlayers 
string ServerLogName 
Server Log
bool bLocalLog 
bool bWorldLog 
bool bBatchLocal 
int DemoBuild 
int DemoHasTuts 
string IPPolicies[50] 

Config Properties[edit]

bool bNoMonsters 
Whether monsters are allowed in this play mode.
bool bHumansOnly 
Whether non human player models are allowed.
bool bCoopWeaponMode 
Whether or not weapons stay when picked up.
bool bClassicDeathmessages 
Weapon deathmessages if false.

Localized Properties[edit]

bool bAlternateMode 
string SwitchLevelMessage 
string DefaultPlayerName 
string LeftMessage 
string FailedSpawnMessage 
string FailedPlaceMessage 
string FailedTeamMessage 
string NameChangedMessage 
string EnteredMessage 
string GameName 
string MaxedOutMessage 
string WrongPassword 
string NeedPassword 
string IPBanned 

Other Properties[edit]

int ItemGoals, KillGoals, SecretGoals 
Special game goals.
byte Difficulty 
In Unreal: 0=easy, 1=medium, 2=hard, 3=very hard. In UT: 0=Novice, 1=Average, 2=Experienced, 3=Skilled, 4=Adept, 5=Masterful, 6=Inhuman, 7=Godlike.
bool bRestartLevel 
bool bPauseable 
Whether the level is pauseable.
bool bCanChangeSkin 
Allow player to change skins in game.
bool bTeamGame 
This is a teamgame.
bool bDeathMatch 
This game is some type of deathmatch (where players can respawn during gameplay)
bool bGameEnded 
set when game ends
bool bOverTime 
bool bCanViewOthers 
float StartTime 
class<PlayerPawn> DefaultPlayerClass 
class<Weapon (UT)> DefaultWeapon 
Default weapon given to player at start.
int NumSpectators 
Current number of spectators.
class<ScoreBoard> ScoreBoardType 
Type of scoreboard this game uses.
class<Menu> GameMenuType 
Type of oldstyle game options menu to display.
string BotMenuType 
Type of bot menu to display.
string RulesMenuType 
Type of rules menu to display.
string SettingsMenuType 
Type of settings menu to display.
string GameUMenuType 
Type of Game dropdown to display.
string MultiplayerUMenuType 
Type of Multiplayer dropdown to display.
string GameOptionsMenuType 
Type of options dropdown to display.
class<HUD (UT)> HUDType 
HUD class this game uses.
class<MapList> MapListType 
Maplist this game uses.
string MapPrefix 
Prefix characters for names of maps for this game type.
string BeaconName 
Identifying string used for finding LAN servers.
string SpecialDamageString 
int SentText 
int NumPlayers 
int CurrentID 
class<LocalMessage (UT)> DeathMessageClass 
class<LocalMessage (UT)> DMMessageClass 
A message class to be used for commonly used messages. For example, the DeathMatchPlus gametype sets DeathMatchMessage as the default, which contains messages for overtime, players leaving and joining the game, players changing names, and players switching teams.
class<Mutator> MutatorClass 
Class of this gametype's base mutator. (Default is Engine.Mutator, DeathMatchPlus uses Botpack.DMMutator.)
Mutator BaseMutator 
Mutator DamageMutator 
Linked list of mutators which affect damage.
Mutator MessageMutator 
Linked list of mutators which get localized message queries.
class<ZoneInfo> WaterZoneType 
Default waterzone entry and exit effects
name DefaultPlayerState 
What state a player should start in for this game type
class<GameReplicationInfo> GameReplicationInfoClass 
GameReplicationInfo GameReplicationInfo 
StatLog LocalLog 
StatLog WorldLog 
bool bLoggingGame 
Does this gametype log?
string LocalLogFileName 
string WorldLogFileName 
class<StatLog> StatLogClass 
string EnabledMutators 
Server query info

Methods[edit]

AdminLogin (PlayerPawn P, string Password) 
This function will allow a player to log in as the administrator if the password entered is correct. The function also broadcasts a notification message to the other players.
AdminLogout (PlayerPawn P) 
This function is called when a player leaves administrator mode. It ensures that the player is forced to "Walk", and kills them. There is code in there to preserve the players score when they die from logging out of admin mode but I'm sure it doesn't work in practice. – must check.
InitLogging ( ) 
Called from PostBeginPlay(). Logs more stuff than you can shake a big stick at. Calls functions on the WorldLog, Log, and LocalLog objects to do so.
InitGameReplicationInfo ( ) 
This function is responsible for placing the values of the attributes of the GameInfo class important to the client onto the GameReplicationInfo object.
string GetInfo ( ) 
Returns the status of the World log.
string GetRules ( ) 
This function builds up a description of the server from the list of mutators currently in use, the type of server (Listen or otherwise), and whether there is a password on the server or not.
int GetServerPort ( ) 
This functon returns the port the server is runing on by interrogating the level URL.
bool SetPause (bool bPause, PlayerPawn P) 
If the level can be paused then the player who paused the game is stored and the function returns true. If the game is not pausable then the function will return false.
LogGameParameters (StatLog StatLog) 
This function writes the general game parameters to the StatLog.
SetGameSpeed (float T) 
This function sets the game speed (but never below 0.1).
bool IsRelevant (Actor Other) 
This function is called from any Actor's PreBeginPlay(). If this function returns true the actor continues to exist. If the function returns false the actor is removed from the game. This function calls the AlwaysKeep() and IsRelevant() functions on any mutators within the game prior to checking actor difficulty levels and "odds of appearing" values. The function also counts the number of remaining SecretGoals, ItemGoals, and KillGoals left within the level (also see Creating Actors And Objects).
bool GrabOption (out string Options, out string Result) 
Grabs the next left option from a string. Result contains the part between the first "?" and the next "?" (if exist). Result is removed then from Options. If Options starts with "?", true is returned, otherwise false.
GetKeyValue (string Pair, out string Key, out string Value) 
Break up a key=value pair into its key and value.
bool HasOption (string Options, string InKey) 
See if an option was specified in the options string.
string ParseOption (string Options, string InKey) 
Find the most left option of kind "InKey=Value" in Options and returns Value if InKey has been found, an empty string else. Options stays unchanged.
ProcessServerTravel (string URL, bool bItems) 
Called when a map changes. Is responsible for handling the transfer of players and their inventory as well as ensuring that all logging for the level just played is tidied up.
bool AtCapacity (string Options) 
This function returns true if the server has the maximum number of players allowed on it.
bool CheckIPPolicy (string Address) 
Returns true if the IP address of the client is allowed to connect to the server.
int GetIntOption( string Options, string ParseString, int CurrentValue ) 
Same as ParseOption but returns an Integer. If the key ParseString is not found, CurrentValue is returned.
Logout (Pawn (UT) Exiting) 
Logs the player out and tells the logging engine about it.
AddDefaultInventory (Pawn (UT) PlayerPawn) 
Add any default inventory to the player.
NavigationPoint FindPlayerStart (Pawn (UT) Player, optional byte InTeam, optional string incomingName) 
Locates the "best" player start for the player.
bool RestartPlayer (Pawn (UT) aPlayer) 
Restart a player after he has died. This function adds the default inventory by calling AddDefaultInventory(), finds a start location by calling FindPlayerStart(). Once this has been acomplished, sets the player's stats back to defaults.
StartPlayer (PlayerPawn Other) 
Start a player. Finish me
Killed (Pawn (UT) Killer, Pawn (UT) Other, name damageType) 
Called when someone gets killed. This function broadcasts the death message, logs the event, and calls the ScoreKill() function.
BroadcastRegularDeathMessage (Pawn (UT) Killer, Pawn (UT) Other, name damageType) 
Calls on to BroadcastLocalizedMessage().
ScoreKill (Pawn (UT) Killer, Pawn (UT) Other) 
Increases the Killer's killCount and score by 1 unless it was a suicide - in which case the killed pawn loses a point.
string KillMessage (name damageType, Pawn (UT) Other) [static] 
Returns " died." as a default catch all death message.
bool CanSpectate (Pawn (UT) Viewer, Actor ViewTarget) 
Returns whether Viewer is allowed to use ViewTarget as its point of view. GameInfo's return value is unconditionally true.
RegisterDamageMutator (Mutator M) 
Adds a damage mutator at the front of the list of damage mutators.
RegisterMessageMutator (Mutator M) 
Adds a message mutator at the front of the list of message mutators.
int ReduceDamage (int Damage, name DamageType, Pawn (UT) injured, Pawn (UT) instigatedBy) 
This function returns a damage of 0 if the injured Pawn (UT) is in a zone that has it's bNeutralZone property set to true. Otherwise the original damage is returned.
bool ShouldRespawn (Actor Other) 
Returns whether an actor item should respawn. In death matches this function should return true for weapon and item pickups.
bool PickupQuery (Pawn (UT) Other, Inventory (UT) Item) 
Called when pawn has a chance to pick Item up (i.e. when the pawn touches a weapon or item pickup). Should return true if it is allowed to pick it up, false if not.
DiscardInventory (Pawn (UT) Other) 
Discard a player's inventory after he dies.
float PlayerJumpZScaling ( ) 
Returns 1.0, but could be overidden for "low grav" game types.
ChangeName (Pawn (UT) Other, coerce string S, bool bNameChange) 
Attempt to change a players name.
bool ChangeTeam (Pawn (UT) Other, int N) 
Return whether a player can change teams or not.
float PlaySpawnEffect (Inventory (UT) Inv) 
Play an inventory respawn effect.
string PlayerKillMessage (name damageType, PlayerReplicationInfo Other) [static] 
returns " was killed by ".
string CreatureKillMessage (name damageType, Pawn (UT) Other) [static] 
returns "was killed by a "
SendPlayer (PlayerPawn aPlayer, string URL) 
Send the player specified to the URL passed to the function.
RestartGame ( ) 
Called to restart the current game.
bool AllowsBroadcast (Actor broadcaster, int Len) 
Returns true if the Actor passed to the function is allowed to broadcast a message.
EndGame (string Reason) 
Called at the end of the game. If first calls BaseMutator.HandleEndGame() and SetEndCams() and if both returns false game is not ended but bOverTime set to true. Otherwise bGameEnded is set to true, the event 'EndGame' is risen and game logging is closed down.
bool SetEndCams (string Reason) 
Puts all player pawns into a GameEnded state and calls the ClientGameEnded() function on them. The function returns true.
ResetGame ( ) [static] 
GameInfo's ResetGame( ) does nothing. In Game type Assault it is overridden and some default values are reset and saved there.
bool AddBot ( ) 
GameInfo's AddBot( ) does nothing. It is overwitten in derivied game types, for example in DeathMatchPlus.
bool ForceAddBot ( ) 
GameInfo's ForceAddBot( ) does nothing. It is overridden in DeathMatchPlus.
PlayTeleportEffect (Actor Incoming, bool bOut, bool bSound) 
It is intended to play a teleporting special effect, but GameInfo's PlayTeleportEffect( ) does nothing. Overridden for example in DeathMatchPlus.

Native Functions[edit]

string GetNetworkNumber() 
(unknown)
string ParseKillMessage (string KillerName, string VictimName, string WeaponName, string DeathMessage) [static] 
Parses the kill message. Replaces the first occurances of %k, %o and %w with KillerName, VictimName and WeaponName respectively (also see Message Placeholder).

Events[edit]

GameEnding ( ) 
This functon is called when a game is shut down. It halts any world logging and local logging.
DetailChange ( ) 
This function is called whenever the client changes their level of detail (high to low, or low to high). Apart from re-linking all of the zones to a SkyBox, any actors with their bHighDetailMode property set to true will be destroyed on entry to a "low detail" mode.
InitGame (string Options, out string Error) 
This function is called before the Actors PreBeginPlay() function. It sets up some of the game options and spawns the BaseMutator.
string GetBeaconText ( ) 
Returns Level.ComputerName, the length truncated Level.Title, the BeaconName and the number of players and MaxPlayers. Used by UdpBeacon.BroadcastBeacon().
PreLogin (string Options, string Address, out string Error, out string FailCode) 
Accepts or rejects a player based upon any game password validation, IP bans, and current server capacity.
PlayerPawn Login (string Portal, string Options, out string Error, class<PlayerPawn> SpawnClass) 
Log a player in. Fails login if you set the Error string. PreLogin() is called before Login(), but significant game time may pass before Login() is called, especially if content is downloaded.
PostLogin (PlayerPawn NewPlayer) 
Called after a successful login. This is the first place it is safe to call replicated functions on the PlayerPawn. finish me
AcceptInventory (Pawn (UT) PlayerPawn) 
Called when new inventory is accepted. Calls the function AddDefaultInventory().
ScoreEvent (name EventName, Actor EventActor, Pawn (UT) InstigatedBy) 
Intended to award a score to an actor. GameInfo's ScoreEvent() does nothing.

Known subclasses[edit]

Comments[edit]

We could do with a nice time diagram showing when all of the different functions and events (including those on the mutators) get called.

Related Topics[edit]

See Function Syntax and Variable Syntax for additional background information.


Category:Legacy Class (UT)


Fearless: Hmmm, some interesting information here even if it's basic. I'd really like to do a mutator that changes gamespeed without the intervention of an admin. I have also a little question concerning the adminlogout command. It says here that the player is killed when the command is invoked. This does happen on our Linux 4.40 server but this doesn't happen on a server you're hosting yourself. Does anyone have any idea why this is :P ?

NogginBasher: You can do that using a combination of x3dfxMapVote and IdeFiX's ServerMode. In ServerMode.ini you need something like: "Commands[11]=SET Engine.GameInfo GameSpeed 1.25". I'm currently testing: "Commands[12]=SET Botpack.DeathMatchPlus bHardcoreMode True"