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

How to remove Unit for owning player from player group

Status
Not open for further replies.
Since I don't know how you are supposed to hire heroes in your map (be it with trigger creation or selling event) and guessing that one hero is used per player, I'll use this:
  • Trigger
  • Events
    • Unit - A unit enters (Playable Map Area)
  • Conditions
    • ((Triggering unit) is a Hero) Equal to True
    • ((Triggering unit) is in HeroGroup) Equal to False
  • Actions
    • Unit Group - Add (Triggering unit) to HeroGroup
    • Set Hero[(Player number of (Triggering player))] = (Triggering unit)
  • Trigger1
  • Events
    • Unit - A unit dies
  • Conditions
    • (Triggering unit) Equal to Hero[(Player number of (Triggering player))]
  • Actions
    • Player Group - Remove (Triggering player) from YourForce
Variables used:

i) HeroGroup: Unit Group
ii) Hero[]: Unit, array ticked
iii) YourForce: Player Group, the one you want the owner of the unit to be removed from.
 
Status
Not open for further replies.
Top