Latest revision |
Your text |
Line 1: |
Line 1: |
− | This explains how to use Warzone's [[Mods|mod]] API and links to the documentation for each object type. | + | This explains how to use WarLight's [[Mods|mod]] API and links to the documentation for each object type. |
| | | |
| == Types == | | == Types == |
| | | |
| When writing a mod, you'll encounter variables/objects of three basic types: | | When writing a mod, you'll encounter variables/objects of three basic types: |
− | * Primitives: strings, numbers, booleans, etc. | + | * Primitives: strings, integers, numbers, etc. |
− | * Tables: collections of key/value pairs. A table is a lot like a hashmap or dictionary in other languages. Note that in Warzone, the key of a table will always be either a string or an integer. Some places in this reference will refer to Arrays which are just tables with numeric keys starting at 1. | + | * Tables: collections of key/value pairs. A table is a lot like a hashmap or dictionary in other languages. Note that in WarLight, the key of a table will always be either a string or an integer. Some places in this reference will refer to Arrays which are just tables with numeric keys starting at 1. |
| * Proxy objects: Discussed in the next section. | | * Proxy objects: Discussed in the next section. |
| | | |
| == Proxy Objects == | | == Proxy Objects == |
| | | |
− | A '''proxy object''' proxies information back and forth between your mod and Warzone. You can tell if an object is a proxy object by looking for a <code>proxyType</code> field. All proxy objects always have the following fields: | + | A '''proxy object''' proxies information back and forth between your mod and WarLight. You can tell if an object is a proxy object by looking for a <code>proxyType</code> field. All proxy objects always have the following fields: |
| | | |
| * proxyType: A string identifying the type of proxy object. | | * proxyType: A string identifying the type of proxy object. |
Line 27: |
Line 27: |
| == Writing Tables == | | == Writing Tables == |
| | | |
− | If a writable Warzone proxy object exposes a table, and you wish to make changes to that table, you must assign the table back to the proxy object. For example, assume you have a <code>GameStanding</code> object named <code>standing</code> which exposes the <code>Cards</code> table, and you want to add something at index 9: | + | If a writable WarLight proxy object exposes a table, and you wish to make changes to that table, you must assign the table back to the proxy object. For example, assume you have a <code>GameStanding</code> object named <code>standing</code> which exposes the <code>Cards</code> table, and you want to add something at index 9: |
| | | |
| standing.Cards[9] = something --WRONG! | | standing.Cards[9] = something --WRONG! |
Line 40: |
Line 40: |
| == API Reference == | | == API Reference == |
| | | |
− | * [[Mod API Reference:ActiveCard|ActiveCard]]
| |
− | * [[Mod API Reference:ActiveCardWoreOff|ActiveCardWoreOff]]
| |
− | * [[Mod API Reference:Armies|Armies]]
| |
− | * [[Mod API Reference:BonusDetails|BonusDetails]]
| |
− | * [[Mod API Reference:Boss1|Boss1]]
| |
− | * [[Mod API Reference:Boss2|Boss2]]
| |
− | * [[Mod API Reference:Boss3|Boss3]]
| |
− | * [[Mod API Reference:Boss4|Boss4]]
| |
− | * [[Mod API Reference:CardGame|CardGame]]
| |
− | * [[Mod API Reference:CardGameAbandon|CardGameAbandon]]
| |
− | * [[Mod API Reference:CardGameAirlift|CardGameAirlift]]
| |
− | * [[Mod API Reference:CardGameBlockade|CardGameBlockade]]
| |
− | * [[Mod API Reference:CardGameBomb|CardGameBomb]]
| |
− | * [[Mod API Reference:CardGameDiplomacy|CardGameDiplomacy]]
| |
− | * [[Mod API Reference:CardGameGift|CardGameGift]]
| |
− | * [[Mod API Reference:CardGameOrderDelay|CardGameOrderDelay]]
| |
− | * [[Mod API Reference:CardGameOrderPriority|CardGameOrderPriority]]
| |
− | * [[Mod API Reference:CardGameReconnaissance|CardGameReconnaissance]]
| |
− | * [[Mod API Reference:CardGameReinforcement|CardGameReinforcement]]
| |
− | * [[Mod API Reference:CardGameSanctions|CardGameSanctions]]
| |
− | * [[Mod API Reference:CardGameSpy|CardGameSpy]]
| |
− | * [[Mod API Reference:CardGameSurveillance|CardGameSurveillance]]
| |
− | * [[Mod API Reference:CardInstance|CardInstance]]
| |
− | * [[Mod API Reference:ClanPlayerInfo|ClanPlayerInfo]]
| |
− | * [[Mod API Reference:ClientGame|ClientGame]]
| |
− | * [[Mod API Reference:Commander|Commander]]
| |
− | * [[Mod API Reference:CustomScenario|CustomScenario]]
| |
− | * [[Mod API Reference:CustomScenarioTerritory|CustomScenarioTerritory]]
| |
− | * [[Mod API Reference:DistributionMode|DistributionMode]]
| |
| * [[Mod API Reference:Game|Game]] | | * [[Mod API Reference:Game|Game]] |
− | * [[Mod API Reference:GameColor|GameColor]]
| + | * [[Mod API Reference:GameStanding|Standing]] |
− | * [[Mod API Reference:GameOpenSeat|GameOpenSeat]]
| + | |
− | * [[Mod API Reference:GameOrder|GameOrder]]
| + | |
− | * [[Mod API Reference:GameOrderAttackTransfer|GameOrderAttackTransfer]]
| + | |
− | * [[Mod API Reference:GameOrderAttackTransferResult|GameOrderAttackTransferResult]]
| + | |
− | * [[Mod API Reference:GameOrderBossEvent|GameOrderBossEvent]]
| + | |
− | * [[Mod API Reference:GameOrderCustom|GameOrderCustom]]
| + | |
− | * [[Mod API Reference:GameOrderDeploy|GameOrderDeploy]]
| + | |
− | * [[Mod API Reference:GameOrderDiscard|GameOrderDiscard]]
| + | |
− | * [[Mod API Reference:GameOrderEvent|GameOrderEvent]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCard|GameOrderPlayCard]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardAbandon|GameOrderPlayCardAbandon]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardAirlift|GameOrderPlayCardAirlift]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardAirliftResult|GameOrderPlayCardAirliftResult]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardBlockade|GameOrderPlayCardBlockade]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardBomb|GameOrderPlayCardBomb]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardDiplomacy|GameOrderPlayCardDiplomacy]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardFogged|GameOrderPlayCardFogged]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardGift|GameOrderPlayCardGift]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardOrderDelay|GameOrderPlayCardOrderDelay]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardOrderPriority|GameOrderPlayCardOrderPriority]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardReconnaissance|GameOrderPlayCardReconnaissance]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardReinforcement|GameOrderPlayCardReinforcement]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardSanctions|GameOrderPlayCardSanctions]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardSpy|GameOrderPlayCardSpy]]
| + | |
− | * [[Mod API Reference:GameOrderPlayCardSurveillance|GameOrderPlayCardSurveillance]]
| + | |
− | * [[Mod API Reference:GameOrderReceiveCard|GameOrderReceiveCard]]
| + | |
− | * [[Mod API Reference:GameOrderStateTransition|GameOrderStateTransition]]
| + | |
− | * [[Mod API Reference:GamePlayer|GamePlayer]]
| + | |
− | * [[Mod API Reference:GameSettings|GameSettings]]
| + | |
− | * [[Mod API Reference:GameStanding|GameStanding]] | + | |
− | * [[Mod API Reference:GameWL|GameWL]]
| + | |
− | * [[Mod API Reference:IncomeMod|IncomeMod]]
| + | |
− | * [[Mod API Reference:IsVersionOrHigher|IsVersionOrHigher]]
| + | |
− | * [[Mod API Reference:MapDetails|MapDetails]]
| + | |
− | * [[Mod API Reference:MapFamily|MapFamily]]
| + | |
− | * [[Mod API Reference:NoParameterCardInstance|NoParameterCardInstance]]
| + | |
− | * [[Mod API Reference:PendingStateTransition|PendingStateTransition]]
| + | |
− | * [[Mod API Reference:PlayerCards|PlayerCards]]
| + | |
− | * [[Mod API Reference:PlayerInfo2|PlayerInfo2]]
| + | |
− | * [[Mod API Reference:ReinforcementCardInstance|ReinforcementCardInstance]]
| + | |
− | * [[Mod API Reference:ServerGame|ServerGame]]
| + | |
− | * [[Mod API Reference:SpecialUnit|SpecialUnit]]
| + | |
− | * [[Mod API Reference:TerritoryConnection|TerritoryConnection]]
| + | |
− | * [[Mod API Reference:TerritoryDetails|TerritoryDetails]]
| + | |
− | * [[Mod API Reference:TerritoryModification|TerritoryModification]]
| + | |
− | * [[Mod API Reference:TerritoryStanding|TerritoryStanding]]
| + | |
− | * [[Mod API Reference:TickCount|TickCount]]
| + | |
| * [[Mod API Reference:UI|UI]] | | * [[Mod API Reference:UI|UI]] |
− | * [[Mod API Reference:WL|WL]]
| |
− |
| |
− | == Newer API features ==
| |
− | Some features were introduced after the first version of the Mod API framework and should be checked for using [[Mod_API_Reference:IsVersionOrHigher|IsVersionOrHigher]]:
| |
− |
| |
− | {| class="wikitable"
| |
− | |-
| |
− | ! Symbol
| |
− | ! New in version
| |
− | |-
| |
− | | [[Mod_API_Reference:IncomeMod|IncomeMod]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:GameOrderEvent|GameOrderEvent.IncomeMods]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:UI|UI.InterceptNextTerritoryClick]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:UI|UI.InterceptNextBonusLinkClick]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Arena]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.ArmyCache]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.ArmyCamp]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Attack]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Crafter]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.DigSite]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Draft]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Hospital]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Market]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.MercenaryCamp]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Mine]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.MoneyCache]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Mortar]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Power]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Recipe]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.ResourceCache]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:StructureType|WL.StructureType.Smelter]]
| |
− | | 5.17
| |
− | |-
| |
− | | [[Mod_API_Reference:GameOrderEvent|GameOrderEvent.AddResourceOpt]]
| |
− | | 5.20
| |
− | |-
| |
− | | [[Mod_API_Reference:GameOrderCustom|GameOrderCustom.OccursInPhaseOpt]]
| |
− | | 5.22
| |
− | |-
| |
− | | [[Mod_API_Reference:TerritoryModification|TerritoryModification.RemoveSpecialUnitsOpt]]
| |
− | | 5.22
| |
− | |-
| |
− | | [[Mod_API_Reference:Boss1|Boss1.CombatOrder]]
| |
− | | 5.22.2
| |
− | |-
| |
− | | [[Mod_API_Reference:Boss2|Boss2.CombatOrder]]
| |
− | | 5.22.2
| |
− | |-
| |
− | | [[Mod_API_Reference:Boss3|Boss3.CombatOrder]]
| |
− | | 5.22.2
| |
− | |-
| |
− | | [[Mod_API_Reference:Boss4|Boss4.CombatOrder]]
| |
− | | 5.22.2
| |
− | |-
| |
− | | [[Mod_API_Reference:Commander|Commander.CombatOrder]]
| |
− | | 5.22.2
| |
− | |-
| |
− | | [[Mod_API_Reference:CustomSpecialUnit|CustomSpecialUnit.CombatOrder]]
| |
− | | 5.24.1
| |
− | |-
| |
− | | [[Mod_API_Reference:CustomSpecialUnit|CustomSpecialUnit.Health]]
| |
− | | 5.24.2
| |
− | |}
| |
− |
| |
− | [[Category:Mod Developers Guide]][[Category:Mod API Reference]]
| |