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

Set variable

Status
Not open for further replies.
Level 3
Joined
Aug 14, 2006
Messages
29
Hi all, i need to set this variable to the last created hero.
Like set unitg(1) = last created hero (by player 1).
set unitg(2) = last created hero /by player 2).
Must be player defined, since ill need to set one of those for each player.. Can any one help? (or any other suggestion which could do this ^^)
 
Level 5
Joined
Oct 17, 2006
Messages
151
Actually you can do this.

  • Set Hero
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • ((Trained unit) is A Hero) Equal to True
    • Actions
      • If ((Owner of (Trained unit)) Equal to Player 1 (Red)) then do (Set Player1Hero = (Trained unit)) else do (Do nothing)
      • If ((Owner of (Trained unit)) Equal to Player 2 (Blue)) then do (Set Player2Hero = (Trained unit)) else do (Do nothing)
      • Repeat this for all players...
This will reset every time you train a new hero unless you have (hero limit number) of "Player#Hero"
 
Last edited:
Level 5
Joined
Oct 17, 2006
Messages
151
Then you would add 2 conditions...
  • Set Hero
  • Events
  • Unit - A unit Finishes training a unit
  • Conditions
  • ((Trained unit) is A Hero) Equal to True
  • (Owner of (Trained unit)) Equal to (which ever player)
 
Status
Not open for further replies.
Top