• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Card Game

Status
Not open for further replies.
Level 3
Joined
Nov 28, 2010
Messages
42
Hello,

I am creating a card game at the moment and i need help with a trigger.

All Heroes have an ability called "Play Card". If this ability is used it creates an unit on your site of the field matching to the Item in you first Inventory Slot.

For Example: You have the card "Footman" in your first Inventory Slot. Now you cast the ability "Play Card". The Item dissapears from the Inventory and a Footman appears on your site of the field.

The only way i see this working, is with IF THEN ELSE Triggers, but if i use too many the trigger isn't working.

I hope you can help me create this trigger!

Thanks for reading my thread!
 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set cards[1] = Footman(item)
      • Set cards[2] = Paladin(item)
      • Set units[1] = Footman
      • Set units[2] = Paladin
      • Set cardCount = 2
  • cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to your ability
    • Actions
      • For each (Integer A) from 1 to cardCount, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to cards[(Integer A)]
            • Then - Actions
              • Unit - Create 1 units[(Integer A)] for (Owner of (Triggering unit)) at (Center of (Playable map area)) facing Default building facing degrees
            • Else - Actions
 
Status
Not open for further replies.
Top