HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hero related problem...

11-07-2003, 05:08 AM#1
QuatreDan
:bgrun: Hey, everyone. I'm suffering from a bit of a dilemna. You know how after making a hero, you require an upgraded town hall (castle, etc. and so forth) in order to be able to make a second and third, etc. ? Well, how would I go about removing that requirement? Is it even possible? Help, I've looked at everything in the editor that I could think of, including the constants. I'd really appreciate your help, thx. :D
11-07-2003, 07:20 AM#2
AllPainful
That requirement does not apply to custom heroes... so just copy your hero and paste it so that it is listed as a "Custom Unit" in the object editor.

NOTE: Hero limits do not apply to custom heroes either....

So if you want the other limits to exist then try the following:

I set a trigger that stops people from having more than 1 of my custom hero, And a trigger so they can't have more that 3 heroes. Works great.
Code:
Event
    Map Initialization
Condtions
Actions
    Player group - Pick every player in (all players)
        Do loop
            Player - Limit training of Heroes to 3 for player(picked player)
            player - limit training of ([color=blue]****[/color]) to 1 for player(picked player)


To limit it to 3 heroes per player INCLUDING my custom heroes:

Events
    Unit - A unit Sells a unit
Conditions
    Or - Any (Conditions) are true
        Conditions
            ((Sold unit) is in (Units of type [color=blue]****[/color])) Equal to True
Actions
    Set CustHeroNum[slot number of player(owner of sold unit)] = (CustHeroNum[slot number of player(owner of sold unit)] + 1)
    Player - Limit training of Heroes to (3 - CustHeroNum[slot number of player(owner of sold unit)]) for Player(owner of sold unit)


where **** is my custom hero type.

In the first trigger add the following for each of your custom heroes in the loop:
player - limit training of (****) to 1 (picked player)

In the second trigger add the following for each of your custom heroes in the conditions:
((Sold unit) is in (Units of type ****)) Equal to True

NOTE: Change Sold Unit to Trained unit if you put your heroes in an alter, my heroes were sold at a tavern.

NOTE2: CustHeroNum is an integer array.
11-07-2003, 03:11 PM#3
QuatreDan
I think it may just be that action that I was searching for (the Player-Limit training of Heroes to # for Player). Is there a way to remove the limit all-together? I would search around the triggers myself right now, but I'm in school >_< . Thx! :D
11-07-2003, 11:36 PM#4
AllPainful
I don't think there is a way to remove the limits... but I do believe that you could set the limit to like 200....

BTW, if a player has 7 heroes, then the left side will have all thier images, but if they get an eighth 1 then the 8th one won't show.

Also note: if a building can normally resurrect units, and a player has lost 5 of thier heroes, they will only be able to resurrect 4 of them, the 5th one is gone PERMANENTLY. Unless resurrected via triggers, because the building will not let them resurrect there.
11-08-2003, 08:52 PM#5
QuatreDan
Well, thx all the same, but I already know all of that. I tried using that action that you brought to my attention, but it didn't help. It still restricted the training of heroes unless you built a castle. There has to be a way, something I can do that will keep this from happening. HELP! :( emote_confused
11-08-2003, 09:12 PM#6
AllPainful
You copied the heroes and then pasted them so that they were in the "Custom" area of the editor, and then made sure to direct your buildings to the custom version and it still had that problem?

Ok, well I know I had this problem once before and was able to get around it, so I will look into it.. but I thought all I did was make my heroes into custom...
11-08-2003, 10:10 PM#7
QuatreDan
Well, I was lazy, and I hadn't tried the copying and pasting to custom units. I thought I would've had to do it with every hero unit in the game, but it seems to only happen when you create normal melee hero units. So, I only copied them over, and it worked! :ggani: But, now I have another problem, and it has something to do with what you said about heroes after 7 not being tracked, so to say. I'm gonna try and test something first to see if it fixes it, but if it doesn't, I'll give you details to see if you can help. Thx again! :D
11-08-2003, 10:27 PM#8
AllPainful
Glad to be of assistance. And I will surely try to help if you have any further problems. :D
11-08-2003, 11:01 PM#9
QuatreDan
:( It didn't work. Ok, here's the thing. I have a map where certain players can spawn a lot of units at will. They can also kill a lot of units at will. Now, I made a trigger that will automatically revive their fallen heroes, but if more than 7 die at the same time, only seven will be revived. I'm not even sure how it picks which seven; sometimes it picks the first seven, but then sometimes it doesn't. It's weird, and I'd really appreciate it if I could prevent this from happening if possible. :D
11-08-2003, 11:18 PM#10
AllPainful
Are you storing the Heroes in a unit array when they die, and calling appon said array when you want to resurrect them?

As for which 7, it might be picking the 7 strongest... Or it might be picking the 7 that are listed on the left side of the screen..

Sorry, that is one particular problem I haven't come across yet...
11-09-2003, 01:43 AM#11
QuatreDan
Ok, here's the trigger:


The first action is to remove the hero from the game if the owner is no longer in the game, and it's not the problem, cuz I already disabled it to check if it was. So, pretty much it just revives the hero when it becomes reviveable. Yes, it could be that it can't be determined as reviveable because it isn't listed on the left, but sometimes other heroes will fail to be revived and previously unlisted heroes take their place. It's weird. Also, I noticed that it seems to happen with more than 7 of the same type of hero. It hasn't thouroughly been confirmed yet, though. Anything? emote_confused
11-09-2003, 02:32 AM#12
AllPainful
Instead of "Become revivable" why not do "Hero Dies" and do a "Wait 10 seconds" then revive the hero, see if that works.