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

Melee Map With Enforced Random Heroes (Tavern Editing Help)

Status
Not open for further replies.
Level 1
Joined
Dec 7, 2018
Messages
1
I'm a complete novice at the editor and probably won't advance much but wanted to develop "random hero" melee maps. What this means is when you build your hero in the altar (or equivalent) or tavern, you now only have the option of building a random hero that will select from the game's 24 pre-set available heroes (4 per race + 8 neutral). So the basic mechanic is that, like in a normal melee map, after altar is completed you may build your first random hero; once you upgrade your townhall you may build your second random hero, and onto Tier 3 the 3rd random hero.

I was able to find some code from Normalice/Ugri that did this and successfully plagerized it although guys on this site stated it is sloppy it at least works. It essentially uses the GUI for making the code and doesn't use the elegant JASS method.

What the code doesn't have is how to apply these mods to a tavern: just like in a melee map, I'd like to have the ability to purchase a random hero from the tavern instead of though your altar. I am unsure how to do this currently as I've only tried a few things and both failed.

I've attached the map I'm working on, but if anyone has tips/pointers on how to make the tavern produce a random hero I'm all ears!
 

Attachments

  • (8)GoldRushRandHeroes.w3x
    401.8 KB · Views: 45
Level 2
Joined
Dec 8, 2018
Messages
11
I do not know how to do it, but i had an idea:
*Create a new custom unit (hero).
*Make the altars to only train this unit.
*Create the necessary triggers to transform any of that units, to a random hero.
*Create variables to only can train three of them.

I will try to do this in a test map, when i finish i will post it here, keep an eye.

(Sorry for my bad English, i from argentina).
 
Altars throw the Finish training event.
Trained Unit = Hero.​
Taverns throw the sell unit event.
Sold Unit = Hero​

I personaly would adive create a clone of a tavern hero.
Make that one the only train /sold one in all altars and the tavern.
At map start also limit training for that fake hero to 3.

When inside an Trained/Sold Event the Trained/Sold Unit is the "Random Hero" replace it.

Dat is quite ugly in GUI, cause you need 2D variables. Using Indexes like (player x maxHeroCount).
You also need to reindex that or use a more advanced indexing technique inside an 2D. Heavy, Heavy is that.​
If you would have access to unitpools, you could do everything player based in simple arrays.
 
Last edited:
Status
Not open for further replies.
Top