Mod API Reference:GameOrderEvent

From Warzone Wiki
(Difference between revisions)
Jump to: navigation, search
m
Line 11: Line 11:
 
* '''WL.GameOrderEvent.Create'''('''playerID''' ''[[Mod API Reference:PlayerID|PlayerID]]'', '''message''' ''string'', '''visibleToOpt''' ''[[Mod API Reference:HashSet|HashSet]]<[[Mod API Reference:PlayerID|PlayerID]]>'', '''terrModsOpt''' ''Array<[[Mod API Reference:TerritoryModification|TerritoryModification]]>'', '''setResourcesOpt''' ''Table<[[Mod API Reference:PlayerID|PlayerID]],Table<[[Mod API Reference:ResourceType|ResourceType]] (enum),integer>>'') (static) returns [[Mod API Reference:GameOrderEvent|GameOrderEvent]]:
 
* '''WL.GameOrderEvent.Create'''('''playerID''' ''[[Mod API Reference:PlayerID|PlayerID]]'', '''message''' ''string'', '''visibleToOpt''' ''[[Mod API Reference:HashSet|HashSet]]<[[Mod API Reference:PlayerID|PlayerID]]>'', '''terrModsOpt''' ''Array<[[Mod API Reference:TerritoryModification|TerritoryModification]]>'', '''setResourcesOpt''' ''Table<[[Mod API Reference:PlayerID|PlayerID]],Table<[[Mod API Reference:ResourceType|ResourceType]] (enum),integer>>'') (static) returns [[Mod API Reference:GameOrderEvent|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.
 
** 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.
 +
[[Category:Mod API Reference]]

Revision as of 17:09, 4 December 2018

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.


Functions

  • WL.GameOrderEvent.Create(playerID PlayerID, message string, visibleToOpt HashSet<PlayerID>, terrModsOpt Array<TerritoryModification>, setResourcesOpt Table<PlayerID,Table<ResourceType (enum),integer>>) (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