• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How can I create a Random Hero Chooser?

Status
Not open for further replies.
Level 2
Joined
May 30, 2008
Messages
7
Ok, I'm makeing a map in WE.

As you guys probably have seen in the Tool Palette, the are two buttons "Random Unit" and "Random Building" to choose a random unit or building to appear where you put it.

So... I would like to know how can I make one of those buttons but for Heros. To be "Random Hero".

I would really apreciate your help guys. :ogre_haosis:
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
You can not.

You can however script a system to do that. Just make an array list of hero types and use a random index to get a random hero type from that. Then it is a mater of creating it where ever you want. Repeate for every random hero you need.

You may wish to increase level, give items and learn spells of them after doing this.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
  • hero setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Hero[1] = Paladin
      • Set Hero[2] = Archmage
      • Set Hero[3] = Mountain King
      • Set Hero[4] = Blood Mage
      • Set Number_of_heros = 4
  • random hero trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to random_hero_item
    • Actions
      • Item - Remove (Item being manipulated)
      • Set temp_point = (Position of (Triggering unit))
      • Unit - Create 1 Hero[(Random integer number between 1 and Number_of_heros)] for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_temp_point)
 
Level 4
Joined
Nov 24, 2010
Messages
61
  • hero setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Hero[1] = Paladin
      • Set Hero[2] = Archmage
      • Set Hero[3] = Mountain King
      • Set Hero[4] = Blood Mage
      • Set Number_of_heros = 4
  • random hero trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to random_hero_item
    • Actions
      • Item - Remove (Item being manipulated)
      • Set temp_point = (Position of (Triggering unit))
      • Unit - Create 1 Hero[(Random integer number between 1 and Number_of_heros)] for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_temp_point)

The item should be rune and use trigger as spell trigger.
However I prefer a Locust Unit sold as Random Button.
 
Status
Not open for further replies.
Top