Latest revision |
Your text |
Line 13: |
Line 13: |
| | | |
| == How to create a Card == | | == How to create a Card == |
− | * Create a table | + | * Create a table (Guid) |
− | * Create a card instance with '''WL.NoParameterCardInstance.Create''' (''[[Mod API Reference:CardID|CardID]]'') , then add it into the new table. Your element in that table is your cardInstanceID | + | * insert a card instance into the new table using '''WL.NoParameterCardInstance.Create'''(''[[Mod API Reference:CardID|CardID]]'') |
− | * 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]]'', '''cardInstanceID''' ''[[Mod API Reference:CardInstanceID|CardInstanceID]]''))'''
| + | |
− | * Play the card with the appropriate subclass of [[Mod API Reference:GameOrderPlayCard|GameOrderPlayCard]] function
| + | |
− | | + | |
− | '''Example: '''
| + | |
− | local cardinstance = {} -- step 1
| + | |
− | table.insert (cardinstance , WL.NoParameterCardInstance.Create(WL.CardID.Airlift)) -- step 2
| + | |
− | addNewOrder(WL.GameOrderReceiveCard.Create(PlayerID, cardinstance)) -- step 3
| + | |
− | addNewOrder(WL.GameOrderPlayCardAirlift.Create(cardinstance[1].ID, Player.ID, TerritoryID ''[[Mod API Reference:TerritoryID|TerritoryID]]' , TerritoryID ''[[Mod API Reference:TerritoryID|TerritoryID]]' , '''Armies''' ''[[Mod API Reference:Armies|Armies]]'')) -- step 4
| + | |