# Game

Game functions such as spawning titans and managing game state.

### **Fields**

<table><thead><tr><th width="174">Field</th><th width="137">Type</th><th width="121">Readonly</th><th>Description</th></tr></thead><tbody><tr><td>IsEnding</td><td>bool</td><td>true</td><td>Is the game currently ending.</td></tr><tr><td>EndTimeLeft</td><td>float</td><td>true</td><td>Time left before game restarts.</td></tr><tr><td>Titans</td><td>List(Titan)</td><td>true</td><td>List of titans currently alive.</td></tr><tr><td>Shifters</td><td>List(Shifter)</td><td>true</td><td>List of shifters currently alive.</td></tr><tr><td>Humans</td><td>List(Human)</td><td>true</td><td>List of humans currently alive.</td></tr><tr><td>AITitans</td><td>List(Titan)</td><td>true</td><td>List of AI titans currently alive.</td></tr><tr><td>AIShifters</td><td>List(Shifter)</td><td>true</td><td>List of AI shifters currently alive.</td></tr><tr><td>AIHumans</td><td>List(Human)</td><td>true</td><td>List of AI humans currently alive.</td></tr><tr><td>PlayerTitans</td><td>List(Titan)</td><td>true</td><td>List of player titans currently alive.</td></tr><tr><td>PlayerShifters</td><td>List(Shifter)</td><td>true</td><td>List of player shifters currently alive.</td></tr><tr><td>PlayerHumans</td><td>List(Human)</td><td>true</td><td>List of player humans currently alive.</td></tr><tr><td>Loadouts</td><td>List(string)</td><td>true</td><td>List of allowed player loadouts.</td></tr><tr><td>DefaultShowKillScore</td><td>bool</td><td>false</td><td>Default kill score behavior. If set to false, kill scores (damage popup) will not automatically show upon player dealing character damage.</td></tr><tr><td>DefaultShowKillFeed</td><td>bool</td><td>false</td><td>Default kill feed behavior. If set to false, kill feeds (feed popup) will not automatically show upon player kills.</td></tr><tr><td>DefaultAddKillScore</td><td>bool</td><td>false</td><td>Default add score behavior. If set to false, kills will not automatically modify kills/damage/deaths stats.</td></tr><tr><td>ShowScoreboardStatus</td><td>bool</td><td>false</td><td>Whether to show player alive/dead status in the scoreboard.</td></tr><tr><td>ShowScoreboardLoadout</td><td>bool</td><td>false</td><td>Whether to show player character/loadout in the scoreboard.</td></tr><tr><td>ForcedCharacterType</td><td>bool</td><td>false</td><td>The forced character for the local player. Upon next spawn or SpawnPlayer call, the player will spawn as this character instead of their chosen character. Available characters: Human, Titan, Shifter.</td></tr><tr><td>ForcedLoadout</td><td>bool</td><td>false</td><td><p>The forced loadout for the local player. Upon next spawn, the player will spawn using this loadout. Available loadouts per character type:</p><p>Shifter: Annie, Eren</p><p>Titan: Small, Medium, Large</p><p>Human: Blades, AHSS, APG, Thunderspears</p></td></tr></tbody></table>

### Functions

<table><thead><tr><th width="291">Function</th><th width="149.33333333333331">Returns</th><th>Description</th></tr></thead><tbody><tr><td>Debug(message: string)</td><td>null</td><td>Prints a message to the debug console (accessible using F11).</td></tr><tr><td>Print(message: string)</td><td>null</td><td>Prints a message to the chat window.</td></tr><tr><td>PrintAll(message: string)</td><td>null</td><td>Prints a message to all players chat window.</td></tr><tr><td>End(delay: float)</td><td>null</td><td>Ends the game and restarts after given delay. Master client only.</td></tr><tr><td>SpawnTitan(type: string)</td><td>Titan</td><td>Spawn a titan. Master client only. Valid types: "Default", "Dummy", "Normal", "Abnormal", "Punk", "Crawler", "Thrower".</td></tr><tr><td>SpawnTitanAt(type: string, position: Vector3, optional rotationY: float)</td><td>Titan</td><td>Spawn a titan at position. Master client only.</td></tr><tr><td>SpawnTitans(type:string, amount: int)</td><td>List(Titan)</td><td>Spawn amount titans. Master client only.</td></tr><tr><td>SpawnTitansAt(type:string, amount: int, position: Vector3, optional rotationY: float)</td><td>List(Titan)</td><td>Spawn amount titans at position. Master client only.</td></tr><tr><td>SpawnTitansAsync(type: string, amount: int)</td><td>null</td><td>Spawn amount titans over time. Note that no titan list is returned.</td></tr><tr><td>SpawnTitansAtAsync(type: string, amount: int, position: Vector3, optional rotationY: float)</td><td>null</td><td>Spawn amount titans at position over time.</td></tr><tr><td>SpawnShifter(type: string)</td><td>Shifter</td><td>Spawn a shifter. Master client only. Valid types: "Annie"</td></tr><tr><td>SpawnShifterAt(type: string, position: Vector3, optional rotationY: float)</td><td>Shifter</td><td>Spawn a shifter at position.</td></tr><tr><td>SpawnPlayer(player: Player, force: bool)</td><td>null</td><td>Spawns the given player. Must be the given player or masterclient. If force is true, will kill the existing player and respawn them, otherwise will only spawn if the player is dead.</td></tr><tr><td>SpawnPlayerAt(player: Player, force: bool, position: Vector3, optional rotationY: float)</td><td>null</td><td>Spawns the player at a given position.</td></tr><tr><td>SpawnPlayerAll(force: bool)</td><td>null</td><td>Spawns all players. Master client only.</td></tr><tr><td>SpawnPlayerAtAll(force: bool, position: Vector3, optional rotationY: float)</td><td>null</td><td>Spawns all players at position.</td></tr><tr><td>GetGeneralSetting(setting: string)</td><td>bool | int | float | string</td><td>Retrieves the value of the given general tab setting. Dropdown setting's values are ordered 0,n.<br>Example: GetGeneralSetting("Difficulty") returns 0 for training, 1 for easy, 2 for normal, and 3 for hard.</td></tr><tr><td>GetTitanSetting(setting: string)</td><td>bool | int | float | string</td><td>Retrieves the value of the given titan tab setting.</td></tr><tr><td>GetMiscSetting(setting: string)</td><td>bool | int | float | string</td><td>Retrieves the value of the given misc tab setting. Dropdown setting's values are ordered 0,n.<br>Example: GetMiscSetting("PVP")<br>returns results ordered 0,n in order of the dropdown list of the setting.<br>0 for off, 1 for ffa, and 2 for teams.</td></tr><tr><td>SpawnProjectile(projectile: string, position: Vector3, rotation: Vector3, velocity: Vector3, gravity: Vector3, liveTime: float, team: string, [extra params])</td><td>null</td><td>Spawns a projectile. Valid projectiles: Thunderspear, CannonBall, Flare, BladeThrow, Smokebomb, Rock1. Thunderspear takes two extra params (radius: float, color: Color)<br>Flare takes extra param (color: Color). Rock takes extra param (size: float).</td></tr><tr><td>SpawnProjectileWithOwner(projectile: string, position: Vector3, rotation: Vector3, velocity: Vector3, gravity: Vector3, liveTime: float, owner: Character, [extra params])</td><td>null</td><td>Spawns a projectile from the given character as its owner.</td></tr><tr><td>SpawnEffect(effect: string, position: Vector3, rotation: Vector3, scale: float, [params])</td><td>null</td><td>Spawns an effect. Valid effects can be found <a href="https://raw.githubusercontent.com/AoTTG-2/Aottg2-Unity/refs/heads/main/Assets/Scripts/Effects/EffectPrefabs.cs">here</a> (left-hand variable name). ThunderSpearExplode takes extra params explodeColor (Color) and killSound (bool).</td></tr><tr><td>SetPlaylist(playlist: string)</td><td>null</td><td>Sets the music playlist. Valid playlists: Default, Boss, Menu, Peaceful, Battle, Racing</td></tr><tr><td>SetSong(song: string)</td><td>null</td><td>Sets the music song.</td></tr><tr><td>FindCharacterByViewID(viewID: int)</td><td>Character</td><td>Returns character from View ID.</td></tr><tr><td>ShowKillScore(score: int)</td><td>null</td><td>Locally shows a kill score popup for the player.</td></tr><tr><td>ShowKillFeed(killer: string, victim: string, score: int, weapon: string)</td><td>null</td><td>Locally shows a kill feed for the player. Valid weapon icons: Blades, AHSS, APG, Thunderspear, Titan, Shifter.</td></tr><tr><td>ShowKillFeedAll(killer: string, victim: string, score: int, weapon: string)</td><td>null</td><td>Shows a kill feed for all players. Can be called by anyone.</td></tr></tbody></table>
