HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do I create a hero that can build structures?

12-20-2003, 07:42 PM#1
bobthemage
Hello,

I was wondering If anyone here could help me out on this. I already searched the board, and I did not find anything - maybe I simply used the wrong keywords.

Anyway, here's my problem: I want a unit that is a hero as well as being able to build certain structures for my map. If I create a new hero (by making a custom unit from any existing hero, or changing an existing hero), I do not get the "Techtree - Structures Build" (or simply "Build" as raw data) data field. Is there any workaround for this, using triggers or JASS perhaps?

Hoping for answers,
bobthemage
12-20-2003, 07:56 PM#2
Ligature
Scroll down to the bottom of this thread and you will see links to some other threads that deal with this same issue.

Apparently the problem is that the build menu is programmatically the same as the hero's learn menu... so you have to use workarounds like a spellbook with a Build Tiny Farm ability.
12-20-2003, 09:04 PM#3
bobthemage
Okay, thank you very much. I found that thread and read it, however it does not solve my problem. Perhaps I'll simply have to go for the workaround then...

Greetings,
bobthemage
12-20-2003, 10:10 PM#4
chuck5700
ok, make a hero spell, and in ability editor, make it tiny castle/farm/barracks etc. and then just change the barracks/watever to what you want it to be, it might work... or you could make a dummy spell that targets an aoe, and have a structure appear at the center of it using triggers, that might work as well...
12-20-2003, 10:22 PM#5
bobthemage
What I did so far was:

First try: Create a hero ability based on the "Build Tiny Great Hall" ability, basically an ability that allows you to build a different building each level.

Limitations: The usual placement prerequisites for that building do not apply. I wanted a Haunted Goldmine - that's impossible, you can build it anywhere on normal ground but not on goldmines - you simply get an empty goldmine. Furthermore, there's no gold and lumber cost on the build then, which makes it hard to prevent abuse.

Second try: Since I wanted my hero to be able to construct different buildings, I placed several of these abilities in a spell book ability and gave it to my hero.

Limitations: Only one build ability (the last in order) works correctly, all others simply construct the same building as the last one. And you get all the disadvandtages of the aforementioned ability to boot. Can't recommend this either.

Probably I'll simply have to attack the problem from a different angle - is there any way to transform a normal unit into a hero unit while keeping all of its original abilities? Perhaps someone knows about this... I'll try to find a way, perhaps an ability based on Metamorphosis will do the trick.

Greetings,
bobthemage
12-20-2003, 11:25 PM#6
Kirym
i don't know, try making it into a worker or something, otherwise i don't know, just use an alternate unit it can summon, that can build.
12-21-2003, 12:22 PM#7
HyperNox
I know this put this File I attached in Units\
in your WC3 dir and restart WE, now all heroes can be given the ability to build.
12-21-2003, 10:54 PM#8
bobthemage
Great, that worked. Thank you very much for helping me out - do I have to import that file into the map for other players to be able to play it?

Greetings,
bobthemage
12-22-2003, 08:57 AM#9
HyperNox
Nope, there is no need for that.
12-22-2003, 09:09 AM#10
bobthemage
So this file only changes the data fields displayed in the editor? Neat! I think I should have a closer look at it :)

Thanks again, HyperNox :)

Greetings,
bobthemage