• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[Trigger] Make Players Start With Random Hero?

Status
Not open for further replies.
Level 3
Joined
Jun 22, 2008
Messages
20
So I'm trying to make a map that's arena-based. Each player starts out with a random hero. Problem is, I can't get the triggers right. Here's what I have.
trigger1.jpg


trigger2.jpg


Thanks for any help you can offer me.
 
Heroes should be a Unit type variable

then you set each array to each hero (your first trigger is fine but you will want to add another variable that sets the max number of hero types in your game)

and

  • Unit - Create 1 Heroes[(Random integer number between 1 and maxHerocount)] for Player 1 (Red) at (Player 1(Red) start location) facing Default building facing degrees
where Heroes is your variable with array
and maxHerocount is the number for how many heros you have in ur map.
 
Level 3
Joined
Jun 22, 2008
Messages
20
It's checked off, still only spawning heroes 3 and 4.

EDIT: Odd, for some reason when I hit "Test Map" it's always the same guys, but when I start it in WCIII it works fine. Well, thanks for your help, I appreciate it.
 
Level 2
Joined
Jan 10, 2009
Messages
30
  • Random Heroes TRIGGER
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Hero[1] = (Random unit from (Units of type Paladin))
      • Set Random_Hero[2] = (Random unit from (Units of type Archmage))
      • Set Random_Hero[3] = (Random unit from (Units of type Mountain King))
      • Set Random_Hero[4] = (Random unit from (Units of type Blood Mage))
  • Random Heroes TRIGGER 2
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 (Unit-type of Random_Hero[(Random integer number between 1 and 4)]) for Picked Player at (Center of (Playable map area)) facing Default building facing degrees
There you go, that should do it... Simple and easy...
Now, if you dont want ALL players to get random her, just change the (All players matching (((Matching player) slot status
and set it to (Player(Player 1 (Red)))
 
Status
Not open for further replies.
Top