Mod API Reference:GameOrderCustom: Difference between revisions

From Warzone Wiki
Jump to navigation Jump to search
Created page with "'''GameOrderCustom''': Subclass of GameOrder. This order does nothing on its own, but it can be used by mods for custom orders. GameOrderCus..."
 
No edit summary
Line 2: Line 2:
* '''Message''' ''string'': The message that will appear in the orders list.  This is what players see.
* '''Message''' ''string'': The message that will appear in the orders list.  This is what players see.
* '''Payload''' ''string'': Data the mod wishes to store along with this order, but does not want players to see.
* '''Payload''' ''string'': Data the mod wishes to store along with this order, but does not want players to see.
* '''CostOpt''' ''Table<[[Mod API Reference:ResourceType|ResourceType]] (enum),integer>'': Defines how much gold the order will cost the player in a [[Commerce]] game.  This should only be set in commerce games.  If CostOpt is set to nil, then it's assumed to be the same as having a cost of 0.  The game will take care of taking the player's resources away correctly, both on the client and server, when inserting an order with a cost into their orders list.


== Functions ==
== Functions ==


* '''WL.GameOrderCustom.Create'''('''playerID''' ''[[Mod API Reference:PlayerID|PlayerID]]'', '''message''' ''string'', '''payload''' ''string'') (static) returns [[Mod API Reference:GameOrderCustom|GameOrderCustom]]:
+* '''WL.GameOrderCustom.Create'''('''playerID''' ''[[Mod API Reference:PlayerID|PlayerID]]'', '''message''' ''string'', '''payload''' ''string'', '''costOpt''' ''Table<[[Mod API Reference:ResourceType|ResourceType]] (enum),integer>'') (static) returns [[Mod API Reference:GameOrderCustom|GameOrderCustom]]:

Revision as of 22:35, 8 August 2017

GameOrderCustom: Subclass of GameOrder. This order does nothing on its own, but it can be used by mods for custom orders. GameOrderCustom is typically sent up from clients to the server, in contrast to GameOrderEvent which is typically sent down from the server to clients.

  • Message string: The message that will appear in the orders list. This is what players see.
  • Payload string: Data the mod wishes to store along with this order, but does not want players to see.
  • CostOpt Table<ResourceType (enum),integer>: Defines how much gold the order will cost the player in a Commerce game. This should only be set in commerce games. If CostOpt is set to nil, then it's assumed to be the same as having a cost of 0. The game will take care of taking the player's resources away correctly, both on the client and server, when inserting an order with a cost into their orders list.

Functions

+* WL.GameOrderCustom.Create(playerID PlayerID, message string, payload string, costOpt Table<ResourceType (enum),integer>) (static) returns GameOrderCustom: