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

Removing Dummies

Status
Not open for further replies.
Level 10
Joined
Jun 10, 2007
Messages
557
How would one go about removing an invisible unit belonging to a player who buys a unit?

Like, when you buy hero X (which is then transported away), the dummy belonging to the buying player which lets the player buy heroes is removed? I can't figure out how to do this without repeat progamming... Preferably without JASS.

So far, my trigger looks like this.

  • Herotransport
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Game - Display to (All players matching ((Owner of (Sold unit)) Equal to (Matching player))) for 8.00 seconds the text: Thanks to many peop...
      • Unit - Move (Sold unit) instantly to (Center of herospawn <gen>)
      • Camera - Apply beginning <gen> for (Owner of (Sold unit)) over 0.50 seconds
If this doesn't make sense, I can probably think of a better description... but, in the mean time, help?
 
Level 10
Joined
Jun 10, 2007
Messages
557
That's what I'm trying to avoid, because I'd need 8 triggers saying "Player X's Lumber becomes equal to 0, remove unit XXXX." What I'm looking for is one trigger, that doesn't need to be copied and pasted multiple times. Bonus points if it can be done within my current trigger.

Because there are 8 players, and 8 dummies.
 
use one trigger, and have a region at the point of the shop(s)(Region X).

then,
  • Dummy Removal
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Pick every unit in (Units in (Region X) matching (((Owner of (Matching unit)) Equal to (Owner of (Sold unit))) and ((Unit-type of (Matching unit)) Equal to dummy unit))) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • -------- Then the rest of your triggers --------
 
Level 10
Joined
Jun 10, 2007
Messages
557
The +rep you deserve is far greater than what I can dish out, unfortunately. Either way, +rep!!

Because if this wasn't fixed, while the hero was waiting to resurrect the player could go back to the tavern and pick a second hero, and effectively play with more than one.
 
Status
Not open for further replies.
Top