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

replacing hero with another hero by text

Status
Not open for further replies.
Level 4
Joined
Nov 24, 2004
Messages
70
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.
 
Level 8
Joined
Jul 3, 2004
Messages
404
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 )
 
Level 9
Joined
Sep 8, 2004
Messages
633
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:


Code:
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.
 
Level 4
Joined
Nov 24, 2004
Messages
70
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
 
Level 4
Joined
Nov 24, 2004
Messages
70
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 :(
 
Status
Not open for further replies.
Top