Mostly Harmless

Difference between revisions of "Legacy:GameInfo (UT)"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(reworked and added some infos)
 
(3 intermediate revisions by 3 users not shown)
Line 56: Line 56:
 
===Other Properties===
 
===Other Properties===
 
; int ItemGoals, KillGoals, SecretGoals : Special game goals.
 
; 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=
+
; 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 bRestartLevel :  
 
; bool bPauseable : Whether the level is pauseable.
 
; bool bPauseable : Whether the level is pauseable.
Line 105: Line 105:
 
==Methods ==
 
==Methods ==
 
; AdminLogin ([[Legacy:PlayerPawn|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.
 
; AdminLogin ([[Legacy:PlayerPawn|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 ([[Legacy:PlayerPawn|PlayerPawn]] P) : This function is called when a player leaves administrator mode.  It ensures that the player is forced to "Walk", and kills them. <i>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. &ndash; must check</i>.
+
; AdminLogout ([[Legacy:PlayerPawn|PlayerPawn]] P) : This function is called when a player leaves administrator mode.  It ensures that the player is forced to "Walk", and kills them. <i>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. &ndash; must check</i>.
; InitLogging ( ) : Called from <code>PostBeginPlay()</code>. Logs more stuff than you can shake a big stick at. Calls functions on the WorldLog, Log, and LocalLog objects to do so.
+
; InitLogging ( ) : Called from <tt>PostBeginPlay()</tt>. 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 [[Legacy:GameReplicationInfo|GameReplicationInfo]] object.
 
; InitGameReplicationInfo ( ) : This function is responsible for placing the values of the attributes of the GameInfo class important to the client onto the [[Legacy:GameReplicationInfo|GameReplicationInfo]] object.
 
; string GetInfo ( ) : Returns the status of the World log.
 
; 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.
 
; 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.
 
; int GetServerPort ( ) : This functon returns the port the server is runing on by interrogating the level URL.
; bool SetPause (bool bPause, [[Legacy:PlayerPawn|PlayerPawn]] P) : If the level can be paused then the player who paused the game is stored and the function returns <tt>true</tt>.  If the game is not pausable then the function will return <tt>false</tt>.
+
; bool SetPause (bool bPause, [[Legacy:PlayerPawn|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 ([[Legacy:StatLog|StatLog]] StatLog) : This function writes the general game parameters to the stat. log.
+
; LogGameParameters ([[Legacy:StatLog|StatLog]] StatLog) : This function writes the general game parameters to the <tt>StatLog</tt>.
; SetGameSpeed (float T) : This function sets the game speed.
+
; SetGameSpeed (float T) : This function sets the game speed (but never below 0.1).
; bool IsRelevant ([[Legacy:Actor|Actor]] Other) : This function is called from any [[Legacy:Actor|Actor]]'s <code>PreBeginPlay()</code>. If this function returns <tt>true</tt> the actor continues to exist.  If the function returns <tt>false</tt> then the actor is removed from the game.  This function calls the <tt>AlwaysKeep(), and IsRelevant()</tt> 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 <tt>SecretGoals</tt>, <tt>ItemGoals</tt>, and <tt>KillGoals</tt> left within the level. (also see [[Legacy:Creating Actors And Objects|Creating Actors And Objects]])
+
; bool IsRelevant ([[Legacy:Actor|Actor]] Other) : This function is called from any [[Legacy:Actor|Actor]]'s <tt>PreBeginPlay()</tt>. 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 <tt>AlwaysKeep()</tt> and <tt>IsRelevant()</tt> 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 <tt>SecretGoals</tt>, <tt>ItemGoals</tt>, and <tt>KillGoals</tt> left within the level (also see [[Legacy:Creating Actors And Objects|Creating Actors And Objects]]).
; bool GrabOption (out string Options, out string Result) : <i>finish me</i>
+
; 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) : <i>finish me</i>
+
; 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) : <i>finish me</i>
+
; bool HasOption (string Options, string InKey) : See if an option was specified in the options string.
; string ParseOption (string Options, string InKey) : <i>finsh me</i>
+
; 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 jsut played is tidied up.
+
; 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 AtCapacity (string Options) : This function returns ''true'' if the server has the maximum number of players allowed on it.
; bool CheckIPPolicy (string Address) : Returns <tt>true</tt> if the IP address of the client is allowed to connect to the server.
+
; 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 ) : <i>finish me</i>
+
; 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 ([[Legacy:Pawn (UT)|Pawn (UT)]] Exiting) : Logs the player out and tells the logging engine about it.
 
; Logout ([[Legacy:Pawn (UT)|Pawn (UT)]] Exiting) : Logs the player out and tells the logging engine about it.
 
; AddDefaultInventory ([[Legacy:Pawn (UT)|Pawn (UT)]] PlayerPawn) : Add any default inventory to the player.
 
; AddDefaultInventory ([[Legacy:Pawn (UT)|Pawn (UT)]] PlayerPawn) : Add any default inventory to the player.
 
; NavigationPoint FindPlayerStart ([[Legacy:Pawn (UT)|Pawn (UT)]] Player, optional byte InTeam, optional string incomingName) : Locates the "best" player start for the player.
 
; NavigationPoint FindPlayerStart ([[Legacy:Pawn (UT)|Pawn (UT)]] Player, optional byte InTeam, optional string incomingName) : Locates the "best" player start for the player.
; bool RestartPlayer ([[Legacy:Pawn (UT)|Pawn (UT)]] aPlayer) : Restart a player after they have died.  This function adds the default inventory by calling AddDefaultInventory(), finds a start location by calling (you guessed it) FindPlayerStart(). Once this has been acomplished, sets the player's stats back to defaults.
+
; bool RestartPlayer ([[Legacy:Pawn (UT)|Pawn (UT)]] aPlayer) : Restart a player after he has died.  This function adds the default inventory by calling <tt>AddDefaultInventory()</tt>, finds a start location by calling <tt>FindPlayerStart()</tt>. Once this has been acomplished, sets the player's stats back to defaults.
 
; StartPlayer ([[Legacy:PlayerPawn|PlayerPawn]] Other) : Start a player. <i>Finish me</i>
 
; StartPlayer ([[Legacy:PlayerPawn|PlayerPawn]] Other) : Start a player. <i>Finish me</i>
; Killed ([[Legacy:Pawn (UT)|Pawn (UT)]] Killer, [[Legacy:Pawn (UT)|Pawn (UT)]] Other, name damageType) : Called when someon gets killed. This function broadcasts the death message, logs the event, and calls the <tt>ScoreKill()</tt> function.
+
; Killed ([[Legacy:Pawn (UT)|Pawn (UT)]] Killer, [[Legacy:Pawn (UT)|Pawn (UT)]] Other, name damageType) : Called when someone gets killed. This function broadcasts the death message, logs the event, and calls the <tt>ScoreKill()</tt> function.
 
; BroadcastRegularDeathMessage ([[Legacy:Pawn (UT)|Pawn (UT)]] Killer, [[Legacy:Pawn (UT)|Pawn (UT)]] Other, name damageType) : Calls on to <tt>BroadcastLocalizedMessage()</tt>.
 
; BroadcastRegularDeathMessage ([[Legacy:Pawn (UT)|Pawn (UT)]] Killer, [[Legacy:Pawn (UT)|Pawn (UT)]] Other, name damageType) : Calls on to <tt>BroadcastLocalizedMessage()</tt>.
 
; ScoreKill ([[Legacy:Pawn (UT)|Pawn (UT)]] Killer, [[Legacy:Pawn (UT)|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.
 
; ScoreKill ([[Legacy:Pawn (UT)|Pawn (UT)]] Killer, [[Legacy:Pawn (UT)|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, [[Legacy:Pawn (UT)|Pawn (UT)]] Other) [static] : Returns " died." as a default catch all death message.
 
; string KillMessage (name damageType, [[Legacy:Pawn (UT)|Pawn (UT)]] Other) [static] : Returns " died." as a default catch all death message.
; bool CanSpectate ([[Legacy:Pawn (UT)|Pawn (UT)]] Viewer, [[Legacy:Actor|Actor]] ViewTarget) : Returns whether players are allowed to use a certain Actor as ViewTarget.
+
; bool CanSpectate ([[Legacy:Pawn (UT)|Pawn (UT)]] Viewer, [[Legacy:Actor|Actor]] ViewTarget) : Returns whether ''Viewer'' is allowed to use ''ViewTarget'' as its point of view. GameInfo's return value is unconditionally ''true''.
 
; RegisterDamageMutator ([[Legacy:Mutator|Mutator]] M) : Adds a damage mutator at the front of the list of damage mutators.
 
; RegisterDamageMutator ([[Legacy:Mutator|Mutator]] M) : Adds a damage mutator at the front of the list of damage mutators.
 
; RegisterMessageMutator ([[Legacy:Mutator|Mutator]] M) : Adds a message mutator at the front of the list of message mutators.
 
; RegisterMessageMutator ([[Legacy:Mutator|Mutator]] M) : Adds a message mutator at the front of the list of message mutators.
; int ReduceDamage (int Damage, name DamageType, [[Legacy:Pawn (UT)|Pawn (UT)]] injured, [[Legacy:Pawn (UT)|Pawn (UT)]] instigatedBy) : This function returns a damage of 0 if the injured [[Legacy:Pawn (UT)|Pawn (UT)]] is in a zone that has it's <tt>bNeutralZone</tt> property set to <tt>true</tt>.  Otherwise the original damage is returned.
+
; int ReduceDamage (int Damage, name DamageType, [[Legacy:Pawn (UT)|Pawn (UT)]] injured, [[Legacy:Pawn (UT)|Pawn (UT)]] instigatedBy) : This function returns a damage of 0 if the injured [[Legacy:Pawn (UT)|Pawn (UT)]] is in a zone that has it's <tt>bNeutralZone</tt> property set to ''true''.  Otherwise the original damage is returned.
; bool ShouldRespawn ([[Legacy:Actor|Actor]] Other) : Returns whether an actor item should respawn. In death matches this function should return True for weapon and item pickups.
+
; bool ShouldRespawn ([[Legacy:Actor|Actor]] Other) : Returns whether an actor item should respawn. In death matches this function should return ''true'' for weapon and item pickups.
; bool PickupQuery ([[Legacy:Pawn (UT)|Pawn (UT)]] Other, [[Legacy:Inventory (UT)|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 he wants to pick it up, false if he does not want it.
+
; bool PickupQuery ([[Legacy:Pawn (UT)|Pawn (UT)]] Other, [[Legacy:Inventory (UT)|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 ([[Legacy:Pawn (UT)|Pawn (UT)]] Other) : Discard a player's inventory after he dies.
 
; DiscardInventory ([[Legacy:Pawn (UT)|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
+
; float PlayerJumpZScaling ( ) : Returns 1.0, but could be overidden for "low grav" game types.
 
; ChangeName ([[Legacy:Pawn (UT)|Pawn (UT)]] Other, coerce string S, bool bNameChange) : Attempt to change a players name.
 
; ChangeName ([[Legacy:Pawn (UT)|Pawn (UT)]] Other, coerce string S, bool bNameChange) : Attempt to change a players name.
 
; bool ChangeTeam ([[Legacy:Pawn (UT)|Pawn (UT)]] Other, int N) : Return whether a player can change teams or not.
 
; bool ChangeTeam ([[Legacy:Pawn (UT)|Pawn (UT)]] Other, int N) : Return whether a player can change teams or not.
Line 146: Line 146:
 
; string CreatureKillMessage (name damageType, [[Legacy:Pawn (UT)|Pawn (UT)]] Other) [static] : returns "was killed by a "
 
; string CreatureKillMessage (name damageType, [[Legacy:Pawn (UT)|Pawn (UT)]] Other) [static] : returns "was killed by a "
 
; SendPlayer ([[Legacy:PlayerPawn|PlayerPawn]] aPlayer, string URL) : Send the player specified to the URL passed to the function.
 
; SendPlayer ([[Legacy:PlayerPawn|PlayerPawn]] aPlayer, string URL) : Send the player specified to the URL passed to the function.
; RestartGame ( ) : Called to restart the current game
+
; RestartGame ( ) : Called to restart the current game.
; bool AllowsBroadcast ([[Legacy:Actor|Actor]] broadcaster, int Len) : Returns <tt>true</tt> if the [[Legacy:Actor|Actor]] passed to the function is allowed to broadcast a message.
+
; bool AllowsBroadcast ([[Legacy:Actor|Actor]] broadcaster, int Len) : Returns ''true'' if the [[Legacy:Actor|Actor]] passed to the function is allowed to broadcast a message.
; EndGame (string Reason) : Called at the end of the game. Is responsible for checking with the mutator function <tt>HandleEndGame()</tt> and the function <tt>SetEndCams</tt> to determine whether the ame should go into extra time. The function also closes the game logging down.
+
; EndGame (string Reason) : Called at the end of the game. If first calls <tt>BaseMutator.HandleEndGame()</tt> and <tt>SetEndCams()</tt> and if both returns ''false'' game is not ended but <tt>bOverTime</tt> set to ''true''. Otherwise <tt>bGameEnded</tt> 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 <tt>clientGameEnded()</tt> function on them.  The function returns <tt>true</tt>.
+
; bool SetEndCams (string Reason) : Puts all player pawns into a ''GameEnded'' state and calls the <tt>ClientGameEnded()</tt> function on them.  The function returns ''true''.
; ResetGame ( ) [static] : <i>finish me</i>
+
; ResetGame ( ) [static] : GameInfo's <tt>ResetGame( )</tt> does nothing. In Game type ''Assault'' it is overridden and some default values are reset and saved there.
; bool AddBot ( ) : <i>finish me</i>
+
; bool AddBot ( ) : GameInfo's <tt>AddBot( )</tt> does nothing. It is overwitten in derivied game types, for example in ''DeathMatchPlus''.
; bool ForceAddBot ( ) : <i>finish me</i>
+
; bool ForceAddBot ( ) : GameInfo's <tt>ForceAddBot( )</tt> does nothing. It is overridden in ''DeathMatchPlus''.
; PlayTeleportEffect ([[Legacy:Actor|Actor]] Incoming, bool bOut, bool bSound) : <i>finish me</i>
+
; PlayTeleportEffect ([[Legacy:Actor|Actor]] Incoming, bool bOut, bool bSound) : It is intended to play a teleporting special effect, but GameInfo's <tt>PlayTeleportEffect( )</tt> does nothing. Overridden for example in ''DeathMatchPlus''.
  
 
===Native Functions ===
 
===Native Functions ===
; string GetNetworkNumber() : <i>finish me</i>
+
; string GetNetworkNumber() : <i>(unknown)</i>
; string ParseKillMessage (string KillerName, string VictimName, string WeaponName, string DeathMessage) [static] : Parses the kill message.  Replaces the first occurances of <tt>%k</tt>, <tt>%o</tt> and <tt>%w</tt> with <tt>KillerName</tt>, <tt>VictimName</tt> and <tt>WeaponName</tt> respectively. (also see [[Legacy:Message Placeholder|Message Placeholder]])
+
; string ParseKillMessage (string KillerName, string VictimName, string WeaponName, string DeathMessage) [static] : Parses the kill message.  Replaces the first occurances of <tt>%k</tt>, <tt>%o</tt> and <tt>%w</tt> with <tt>KillerName</tt>, <tt>VictimName</tt> and <tt>WeaponName</tt> respectively (also see [[Legacy:Message Placeholder|Message Placeholder]]).
  
 
===Events ===
 
===Events ===
 
; GameEnding ( ) : This functon is called when a game is shut down.  It halts any world logging and local logging.
 
; 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 <tt>bHighDetailMode</tt> property set to true will be destroyed on entry to a "low detail" mode.
+
; 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 <tt>bHighDetailMode</tt> 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 [[Legacy:Actor|Actor]]s <tt>PreBeginPlay()</tt> function if the comment in the file is to be believed. It sets up some of the game options.
+
; InitGame (string Options, out string Error) : This function is called before the [[Legacy:Actor|Actor]]s <tt>PreBeginPlay()</tt> function. It sets up some of the game options and spawns the [[BaseMutator]].
; string GetBeaconText ( ) : <i>finish me</i>
+
; string GetBeaconText ( ) : Returns ''Level.ComputerName'', the length truncated ''Level.Title'', the ''BeaconName'' and the number of players and ''MaxPlayers''. Used by <tt>UdpBeacon.BroadcastBeacon()</tt>.
; PreLogin (string Options, string Address, out string Error, out string FailCode) : Accepts or rejects a player based upon any game password vlaidation, IP bans, and current server capacity.
+
; 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.
; [[Legacy:PlayerPawn|PlayerPawn]] Login (string Portal, string Options, out string Error, class<[[Legacy:PlayerPawn|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.
+
; [[Legacy:PlayerPawn|PlayerPawn]] Login (string Portal, string Options, out string Error, class<[[Legacy:PlayerPawn|PlayerPawn]]> SpawnClass) : Log a player in. Fails login if you set the Error string. <tt>PreLogin()</tt> is called before <tt>Login()</tt>, but significant game time may pass before <tt>Login()</tt> is called, especially if content is downloaded.
 
; PostLogin ([[Legacy:PlayerPawn|PlayerPawn]] NewPlayer) : Called after a successful login. This is the first place it is safe to call replicated functions on the PlayerPawn. <i>finish me</i>
 
; PostLogin ([[Legacy:PlayerPawn|PlayerPawn]] NewPlayer) : Called after a successful login. This is the first place it is safe to call replicated functions on the PlayerPawn. <i>finish me</i>
; AcceptInventory ([[Legacy:Pawn (UT)|Pawn (UT)]] PlayerPawn) : Called when new inventory is accepted.  Calls the function <tt>AddDefaultInventory</tt>.
+
; AcceptInventory ([[Legacy:Pawn (UT)|Pawn (UT)]] PlayerPawn) : Called when new inventory is accepted.  Calls the function <tt>AddDefaultInventory()</tt>.
; ScoreEvent (name EventName, [[Legacy:Actor|Actor]] EventActor, [[Legacy:Pawn (UT)|Pawn (UT)]] InstigatedBy) : Placeholder event function.
+
; ScoreEvent (name EventName, [[Legacy:Actor|Actor]] EventActor, [[Legacy:Pawn (UT)|Pawn (UT)]] InstigatedBy) : Intended to award a score to an actor. GameInfo's <tt>ScoreEvent()</tt> does nothing.
  
 
==Known subclasses ==
 
==Known subclasses ==
Line 190: Line 190:
 
'''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 ?
 
'''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 ServerMode.  In ServerMode.ini you put "Commands[11]=SET Engine.GameInfo GameSpeed 1.25", but I'm still trying to find out how to set hardcore damage.
+
'''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"
 
[[Category:Legacy Class (UT)|{{PAGENAME}}]]
 
[[Category:Legacy Class (UT)|{{PAGENAME}}]]

Latest revision as of 09:38, 31 December 2016

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"