Wc3C.net

Wc3C.net (http://www.wc3c.net/forums.php)
-   General Mapping Tutorials (http://www.wc3c.net/forumdisplay.php?f=427)
-   -   I don't like MULTIPLES of my HEROES! How do I fix it? (http://www.wc3c.net/showthread.php?t=75649)

linkmaster23 06-05-2005 04:03 AM

I don't like MULTIPLES of my HEROES! How do I fix it?
 
Boom! Here we go.

Now, let's say you're trying to make a new custom hero and want to add it to your Tavern / Altar, but you're having an issue. An issue that allows you to have 5 BILLION of the same hero! Double-yoo tee eff?

Well, YOU ARE NOT ALONE! (At least, for now.)

OK. Now, let's fix this.

First thing you need to do.

On the main Editor Menu, go to the Advanced tab. Go down to Gameplay Constants. Next, check the box at the top stating "Use custom gameplay constants". Now you can edit all this junk you see below.

Now, select any one of the constants and hit "T" TWO times on your keyboard. You should now be on the Techtree - Dependency Equivalents - Hero constant. Double-click on this constant.

Wow! When the hell did this get here? Turns out, Blizzard snuck this little bugger in a few patches ago. So now... just click Add Unit. Find your custom hero, and hit OK.

Now, cool. You have to have a Altar in order to buy this hero, and you can't buy anymore till you Tier up.

Now exactly how did this do that?

Well, you know that Techtree Requirements section of the Unit in the Object Editor? Well, it actually makes use of that. One of the requirements of being a hero is to have some tier / level requirements.

-----

Techtree - Requirements == Any Altar
Techtree - Requirements - Tier 2 == Any Tier 2 Hall, Any Altar
Techtree - Requirements - Tier 3 == Any Tier 3 Hall, Any Altar

-----

If you have more than 3 tiers, this is where you edit it to have more than 3 heroes!

Now, at this point you can buy more than 1 of the Special Heroes still. Time to fix that too.

Load up the Trigger Editor. And copy this code exactly.

Trigger:
NoDoubleHero
Collapse Events
Map initialization
Conditions
Collapse Actions
Player - Limit training of SPECIALHERO1 to 1 for Player 1 (Red)
Player - Limit training of SPECIALHERO1 to 1 for Player 2 (Blue)
Player - Limit training of SPECIALHERO1 to 1 for Player ...
-------- --------
Player - Limit training of SPECIALHERO2 to 1 for Player 1 (Red)
Player - Limit training of SPECIALHERO2 to 1 for Player 2 (Blue)
Player - Limit training of SPECIALHERO2 to 1 for Player ...

Now, just add-on new heroes to this trigger and the Gameplay Constant and BOOM there ya go. No more flippin' multiple heroes!

-Linkmaster23 :emote_thumbup2:

Anitarf 06-05-2005 10:08 AM

As far as NoDoubleHero trigger goes, you could optimize it considerably by using a loop (I know this thread is meant for begginers, but even they should learn to use loops):
Trigger:
NoDoubleHero
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse For each Integer A from 1 to 12 do actions
Collapse Loop - Actions
Player - Limit training of SPECIALHERO1 to 1 for Player (Integer A)
Player - Limit training of SPECIALHERO2 to 1 for Player (Integer A)
BTW, shouldn't this go into the submissions forum? Or perhaps just general development?

johnfn 06-05-2005 01:12 PM

If you wanted to further optimize that loop, you could turn SPECLIAHERO into a unit array and loop through each one of those.

However, linkmaster said that this is mostly for noobs who don't understand much about loops/arrays. But I say if you wanna try it go ahead ;)

Quote:

Originally Posted by Anitarf
BTW, shouldn't this go into the submissions forum? Or perhaps just general development?


Or the FAQ top ten ... ;)

Anitarf 06-05-2005 02:44 PM

Quote:

Originally Posted by johnfn
If you wanted to further optimize that loop, you could turn SPECLIAHERO into a unit array and loop through each one of those.

If you did that, you would still need to initialize the array first, so unless you looped through all the new hero types with some other triggers as well, doing this wouldn't spare you any work.

johnfn 06-05-2005 03:04 PM

Not necessarily, you could always set it to unit types of a unit in a reigon, if you had them all in a certain area for show or something ;)

linkmaster23 06-05-2005 07:19 PM

Let's keep it simple guys.

Vexorian 06-08-2005 11:27 PM

I dunno.

For some people the loop would be simple = Less clicks.

Let's leave it with all the comments and let people choose it.

linkmaster23 06-22-2005 11:04 PM

Quote:

Originally Posted by Lord Vexorian
I dunno.

For some people the loop would be simple = Less clicks.

Let's leave it with all the comments and let people choose it.


Re-stickying for a few. I keep getting IMed about this.

linkmaster23 06-22-2005 11:07 PM

Quote:

Originally Posted by linkmaster23
Re-stickying for a few. I keep getting IMed about this.


WHOA. Why is this in here, this goes in the Trigger Forum. Whoever moved it, this is for spells and stuff. This forums isn't even looked at anymore. Back to the main forum so I can stop getting IMed about this.

Panto 06-23-2005 04:27 PM

This should help to demonstrate the method.

06-24-2005 09:00 AM

ummm....i cant seem to find the "game constants"....am i missing a patch or mod or is it only in frozen thorne....if someone could help id appreciate it, thanks

Keitaro 06-25-2005 12:42 PM

I had that problem too, but then I went and downloaded the newest patch and then suddenly it was there in gameplay constants.

If you are somehow unable to do download it, there's an alternative method.

Click on any standard hero (human if your custom hero is humam, neutral if neutral and etc) and find the field that reads: dependancy equivalent list. Add your hero there and it will have the same dependancy equivalence as the standard hero you chose.
But if you summon one of your custom heroes first, the standard hero dissappears. There are ways around it, but the best way would be to get the newest patch.

07-14-2005 01:45 AM

wouldnt it be simplier to go to triggers - melee - limit one type hero per player?

Panto 07-14-2005 03:13 PM

Quote:

Originally Posted by sunlit56
wouldnt it be simplier to go to triggers - melee - limit one type hero per player?


Oh! He's so smart! Let's all do it his way! This whole thread has been for nothing, because that's all you have to do!

aaaa 08-06-2005 12:45 AM

Quote:

Originally Posted by Panto
Quote:

Originally Posted by sunlit56
wouldnt it be simplier to go to triggers - melee - limit one type hero per player?


Oh! He's so smart! Let's all do it his way! This whole thread has been for nothing, because that's all you have to do!

Nope thats incorrect , see i did that with my map and it works ,execpt for one small but very bad bug. See if one of your hero dies it counts that you don't have that hero and you can pick a different hero. For example lets take archmage and bloodmage. If your archmage dies you can summon your bloodmage and not resummon your archmage , so if you had a map like (lets say) dota and you summoned a guy, while hes dead you could summon another guy (but the taverns fade away so ot doesn't happen in dota).

~Hellzfire74 (account lost cheak my thred called Lost Account and can't log in as Guest)


All times are GMT. The time now is 02:00 AM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services