Warcraft III resources & community, 2003–2006 · archived

replacing hero with another hero by text

9 posts
#1

replacing hero with another hero by text

Umm..well this site has been the best 4 help on creating my new footy map xXx Footmen Wars xXx soon to be released, and thank all of you that have helped me out so far but i got another question. How Can i make it so that when i have a hero that is already selected, be replaced by another hero keeping the same lv by typing a text word. ex: i type -blademaster, and then my existing hero will be replaced by a blademaster keeping the same lv as my previous hero. This might be tricky, but it will be pretty cool i think if it actually works. plz help.
#2
hmm that may take alot of triggers for however many heroes you are going to put or be able to change into.

But would you like the heroes to keep there abilties or get new ones?

Ill tell you the trigger once you answer this!!
#3
Store the heroes LVL inside a vatiable (integer i think)

And when you change hero....Just add that integer instead of a number

Integer (1) = Red
Integer (2) = Blue
Integer (3) = Teal
Integer (4) = orange
Integer (5) = Yellow
Integer (6) = Purple

(I think thats right :P )
#4
i dont think you can but maybe, but there is another way but with bunches of triggers
#5
well, i don't feel like actually coding it for ya, but:
then each player should have only one hero.

Make variables:
An array unit variable, for each player: Hero (x)
An array integer variable, for each hero lvl: Hero_lvl (x)

Triggers:
1- to make the hero variables contain the right heroes
2- when the hero levels up, make the hero_lvl (player number of owner of leveling unit) become itself +1.
3- the triggers for each text command, should look something like this:



Player 1 (red) types message containing -blademaster

Unit type of Hero (Player number of triggering player) is not equal to (blademaster)

Unit - replace Hero (Player number of triggering player) with a (blademaster) using old unit's relative health and mana
Hero - set lvl = hero_lvl(player number of triggering player)



That's the basics, good luck.
#6
jeesh u guys are good with maps lol, but yah thx 4 the help once again! :lol: and who knows maybe if yah'd like i can send u a copy of my map just to check over it and give suggestions , its my first map but im starting to get the hang of it thx to this site. :D
#7
What Angelusz said will work- just make sure that you add to the hero lvl integer everytime your hero levels up, or else it won't work.
#8
MrMaestroWhat Angelusz said will work- just make sure that you add to the hero lvl integer everytime your hero levels up, or else it won't work.


Angelusz2- when the hero levels up, make the hero_lvl (player number of owner of leveling unit) become itself +1.
#9
Event- player(red) types message containing the text:-pred as an exact match.

Con- (Unit-type of Hero[(PLayer # of(triggering player))]) not equal to predator.

Action- unit-replace Hero[((Player # of(triggering player))] With a predator using the old units life and mana.

- Hero - set Hero[hero_lv[(player # of(triggeirng player)))] Hero-level to (player # of(triggering player).

varibles i made: hero_lv integer array (1)
: Hero Unit array(1)



it didn't work 4 me i dont get y.....plz tell me wat i did wrong :(