Mod API Reference:CardInstance: Difference between revisions

From Warzone Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:


== How to create a Card ==
== How to create a Card ==
* Create a table (Guid)
* Create a table
* Create a card instance with '''WL.NoParameterCardInstance.Create''' (''[[Mod API Reference:CardID|CardID]]'') , then add it into the new table
* Create a card instance with '''WL.NoParameterCardInstance.Create''' (''[[Mod API Reference:CardID|CardID]]'') , then add it into the new table
* Give the card to the player you want to have this card used on with '''addNewOrder(WL.GameOrderReceiveCard.Create'''('''playerID ''' ''[[Mod API Reference:PlayerID|PlayerID]]'' ID, Guid'''))'''
* Give the card to the player you want to have this card used on with '''addNewOrder(WL.GameOrderReceiveCard.Create'''('''playerID ''' ''[[Mod API Reference:PlayerID|PlayerID]]'' ID, '''cardInstanceID''' ''[[Mod API Reference:CardInstanceID|CardInstanceID]]''))'''

Revision as of 05:16, 22 November 2023

CardInstance: An actual instance of a card belonging to a player or team. For example, when a player completes their 4th piece of a 4-piece reinforcement card, an instance of CardInstance is created, assigned a random ID, and given to the player/team.

Children

This is an abstract type. For Reinforcement cards, you should use the ReinforcementCardInstance, and for all other cards use the NoParameterCardInstance.

How to create a Card

  • Create a table
  • Create a card instance with WL.NoParameterCardInstance.Create (CardID) , then add it into the new table
  • Give the card to the player you want to have this card used on with addNewOrder(WL.GameOrderReceiveCard.Create(playerID PlayerID ID, cardInstanceID CardInstanceID))