Mod API Reference:ClientGame

From Warzone Wiki
Revision as of 00:37, 18 May 2017 by Fizzer (talk | contribs) (Created page with " '''ClientGame''': Provides information about a game in Client_ hooks. Also lets mods view and alter the orders list. * '''Map''' ''[[Mod API Reference:MapDetails|MapDetail...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


ClientGame: Provides information about a game in Client_ hooks. Also lets mods view and alter the orders list.

  • Map MapDetails: Details about the map for this game.
  • Us GamePlayer: Details about the player who is playing. Note that this will be nil when a spectator views this game, so be sure to test your mod as spectators if you use this field.
  • Game GameWL: Details about the game.
  • Map MapDetails: Details about the map for this game.
  • Settings GameSettings: The settings this game uses.
  • LatestStanding GameStanding: The latest state of the game.
  • GetDistributionStanding: A function used to get the GameStanding during the picking phase of this game. Pass this function your own callback function which takes a GameStanding as an argument. For example: game.GetDistributionStanding(function(standing) print('got ' .. standing) end). Your function will be called with nil if the distribution standing is not available, for example if it's an automatic distribution game. In the event of an error, such as lack of an internet connection, your callback will not be called.
  • GetStanding: A function used to get the GameStanding for any turn of the game. Pass this function two arguments: first, an integer represneting what turn to get (0 for the start of the game, 1 for the second turn, 2 for the third turn, etc.) Second, pass a callback function that will get called with the GameStanding. See GetDistributionStanding for an example.
  • GetTurn: A function used to get the GameTurn for any turn of the game. Identical to GetStanding in every way, except that it calls back your function with a GameTurn.
  • Orders List<GameOrder>: Allows you to read and write the orders that the player is building up in the orders list for the current turn. You can call this property to see the orders, or assign a list of orders to it to replace the player's orders with your list.