Game (Global) - originalfoo/Prison-Architect-API GitHub Wiki
##Overview
The Game global is a small function library.
##Methods
The following functions might not all work in data/scripts/
-
Game.DebugOut()- echo a string to the debug console -
Game.Time()- get the current game time in seconds (1 game second = 1 prison minute) -
Game.SetChapter()- Starts a new chapter. Takes one argumment: string Chapter -
Game.SetMap()- Loads a map by its name. Takes one argumment: string MapName -
Game.SaveMap()- Saves a map by its name. Takes one argumment: string MapName -
Game.AdviserIncoming()- Stops the script until the player answers the call. Takes a string argumment from a predefined list -
Game.AdviserSay()- Takes two argumments: string Adviser_Constant, string Sentence -
Game.AdviserSayBatch()- Takes two string values (adviser, BatchDialogName ) BatchDialogName refers to sentences defined in base-language.txt -
Game.CameraMove()- Moves the game camera. -
Game.CameraZoom()- Zooms the game camera in or out . -
Game.CameraMoveAndZoom()- Moves and zooms the game camera. -
Game.CamTrack()- Makes the game camera track an object. Takes three argumments: string ObjectID, float Zoom, float time -
Game.CameraMoveToObject()- Moves the game camera to the position of an object. Takes three argumments: string ObjectID, float x, float y, float x1, float y1, float speed, bool tweenMode -
Game.Unlock()- Unlocks an item for the player to use. Takes two argumments: string type, string Identifier -
Game.Polaroid()- Spawns in a polaroid. Takes six argumments: string PolaroidID, string imagePath, float x, float y, float size_x, float size_y -
Game.Show()- Takes one argumment: string GameUiElement. -
Game.Hide()- Takes one argumment: string GameUiElement. -
Game.SendEntityToRoom()- Takes two argumments: string EntityID, string RoomName -
Game.SendEntityToPos()- Takes six argumments: string EntityID, float x, float y, float Orientation x, float Orientation y, int Speed -
Game.SendEntityToObject()- Takes three argumments: string NamedObject, string NamedObject, int Speed -
Game.PowerOn()- Takes one argumment: string EntityID -
Game.PowerOff()- Takes one argumment: string EntityID -
Game.Pause()- Takes one argumment: int time -
Game.Sound()- Plays a sound. Takes two argumments: string SoundType, string SoundID -
Game.StopSound()- Stops a playing sound. Takes two argumments: string SoundType, string SoundID -
Game.Delivery()- Summons a delivery truck with a quantity of a certain object. Takes three argumments: string DeliveryID, int quantity, string ObjectID -
Game.Spawn()- Creates an entity. Takes three argumments: string ObjectID, string EntityID, float x, float y -
Game.GiveEquipment()- Equips the target entity with a piece of equipment as defined in objects. Takes two argumments: string EntityID, string EquipmentID -
Game.DropEquipment()- Forces the target entity to drop the currently equipped item. Takes one argumment: string EntityID -
Game.GameOver()- Ends the current scenario.
##See Also