• 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.

An Upgrade trigger.

Status
Not open for further replies.
Level 5
Joined
Jun 27, 2010
Messages
73
Hey im still noobish for triggers and crap but anyways how do u do this:

Ok im making a zombie map. Theirs 3 paths into town. Point of game is to defend town. Theirs town guards on each path. My idea is i want to spawn new troops at each path when a Player buys a Town Defender Upgrade from shop.How do i do that?
 
Well, if these guards are used as guards only, you can do this:
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set GuardTypes[1] = Footman
    • Set GuardTypes[2] = Archer
    • Set GuardTypes[3] = Rifleman
  • Trigger2
  • Events
    • Unit - A unit sells a unit
  • Conditions
    • (Unit-type of (Sold unit)) Equal to Town Defender Upgrade
  • Actions
    • Set Integer = (Player number of (Owner of (Sold unit)))
    • Unit - Kill (Sold unit)
    • Unit - Remove (Sold unit) from the game
    • Set Count[Integer] = (Count[Integer] + 1)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable Map Area) matching ((Owner of (Matching unit)) Equal to (Owner of (Sold unit))) and (Unit-type of (Matching unit)) Equal to GuardTypes[(Integer - 1)]) and do (Actions)
      • Loop - Actions
        • Unit - Replace (Picked unit) with a GuardTypes[Integer], using the new unit's default life and mana
 
Status
Not open for further replies.
Top