Mod API Reference:GameOrderEvent

From Warzone Wiki
(Difference between revisions)
Jump to: navigation, search
Line 6: Line 6:
 
* '''SetResourceOpt''' ''Table<[[Mod API Reference:PlayerID|PlayerID]],Table<[[Mod API Reference:ResourceType|ResourceType]] (enum),integer>>'':  Sets the resource value of a player, such as their [[gold]], to a specific value.
 
* '''SetResourceOpt''' ''Table<[[Mod API Reference:PlayerID|PlayerID]],Table<[[Mod API Reference:ResourceType|ResourceType]] (enum),integer>>'':  Sets the resource value of a player, such as their [[gold]], to a specific value.
 
* '''IncomeMods''' ''Array<[[Mod API Reference:IncomeMod|IncomeMod]]>'':  
 
* '''IncomeMods''' ''Array<[[Mod API Reference:IncomeMod|IncomeMod]]>'':  
 
+
* '''AddResourceOpt''' ''Table<[[Mod API Reference:PlayerID|PlayerID]],Table<[[Mod API Reference:ResourceType|ResourceType]] (enum),integer>>'':  Adds (or subtracts with negative numbers) to the resources of a player, such as their [[gold]]. When adding or subtracting a fixed number, this is preferred over SetResourceOpt.  Added in version 5.20.0.
 +
* '''AddCardPiecesOpt''' ''Table<[[Mod API Reference:PlayerID|PlayerID]],Table<[[Mod API Reference:CardID|CardID]],integer>>'': Provides a way to add (or remove with negative numbers) pieces of a card to a player.  This can also add whole cards -- if the player's total cards exceeds the number of peices that make up that card as defined in the game settings, they will automatically be turned into whole cards and be given to the player.  This cannot remove whole cards.  For that, use RemoveWholeCardsOpt.
 +
* '''RemoveWholeCardsOpt''' ''Table<[[Mod API Reference:PlayerID|PlayerID]],[[Mod API Reference:CardInstanceID|CardInstanceID]]>'': Removes whole cards from a player. 
  
 
== Functions ==
 
== Functions ==

Revision as of 18:10, 4 August 2022

GameOrderEvent: Subclass of GameOrder. This is a generic event that can present a message or modify territories. It can also control which players can see it. It was added for use by Mods and is not used by any built-in game mechanics.

  • Message string: The message displayed in the orders list. Must be specified.
  • TerritoryModifications Array<TerritoryModification>: Optionally, can modify territories, such as changing ownership or armies.
  • VisibleToOpt HashSet<PlayerID>: Defines who this event is visible to. Note that the player this event is assigned to can always see it, and any player who can see the effects of a territory modification can always see it as well. Set this to nil to mean that it should be visible to everyone (public). Set this to an empty list to indicate that the event should not be visible to anyone, except those that can see it by a previously mentioned rule.
  • SetResourceOpt Table<PlayerID,Table<ResourceType (enum),integer>>: Sets the resource value of a player, such as their gold, to a specific value.
  • IncomeMods Array<IncomeMod>:
  • AddResourceOpt Table<PlayerID,Table<ResourceType (enum),integer>>: Adds (or subtracts with negative numbers) to the resources of a player, such as their gold. When adding or subtracting a fixed number, this is preferred over SetResourceOpt. Added in version 5.20.0.
  • AddCardPiecesOpt Table<PlayerID,Table<CardID,integer>>: Provides a way to add (or remove with negative numbers) pieces of a card to a player. This can also add whole cards -- if the player's total cards exceeds the number of peices that make up that card as defined in the game settings, they will automatically be turned into whole cards and be given to the player. This cannot remove whole cards. For that, use RemoveWholeCardsOpt.
  • RemoveWholeCardsOpt Table<PlayerID,CardInstanceID>: Removes whole cards from a player.

Functions

  • WL.GameOrderEvent.Create(playerID PlayerID, message string, visibleToOpt HashSet<PlayerID>, terrModsOpt Array<TerritoryModification>, setResourcesOpt Table<PlayerID,Table<ResourceType (enum),integer>>, incomeModsOpt Array<IncomeMod>) (static) returns GameOrderEvent:
    • playerID: Pass the ID of a player that this event pertains to. This is one of the few players where WL.PlayerID.Neutral is an allowed value. An event assigned to Neutral is suitable for events that weren't initiated by a player.
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox