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

Changing a unit/hero into another unit/hero

Status
Not open for further replies.
Level 4
Joined
Jun 8, 2008
Messages
59
Hello once more...
I got a new question for you guys.

I have seen in some games that people have made some sort of spell, that transforms the unit/hero into another form of unit/hero... But still with the same exp, and abilities...

I would very much like to know how they do this, and I will of course +rep to those who help me :wink:
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
maybe with abilities like "chaos (grom)" ability
it has
Data - new unit type

(go to Edit>Find and type "chaos (grom)" )

if its not working on that way than you will have to

-store all stats of your hero/unit
-unit - replace unit
-set last replaced unit´s stats to stored stats
 
Level 19
Joined
Apr 10, 2010
Messages
2,789
Create variables for storing all the stats, experience, and the level and just use the action Hero - Set (Last Created Unit) Hero-Level to HeroLevel, Hide level up graphics. And for the stats, Hero - Modify Strength of Hero, Set to HeroStat. For the experience, use Hero - Set (Casting Unit) experience to Exp, Hide level-up graphics.
 
Level 3
Joined
Oct 9, 2008
Messages
61
If you are new to Variables I think you should try to do something easier first, cause this is pretty advanced.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It's actually really not advanced xD
But variables are just a very baisc thing, you need them for every game (apart from melee maps).

  • Actions
    • Set ExperienceVariable = (Hero experience of (Unit))
    • Unit - Replace (Unit) with a (Hero) using The old unit's relative life and mana
    • Hero - Set (Last replaced unit) experience to ExperienceVariable, Hide level-up graphics
Something like that should work, but it's not the best method.
 
Level 4
Joined
Jun 8, 2008
Messages
59
It's actually really not advanced xD
But variables are just a very baisc thing, you need them for every game (apart from melee maps).

  • Actions
    • Set ExperienceVariable = (Hero experience of (Unit))
    • Unit - Replace (Unit) with a (Hero) using The old unit's relative life and mana
    • Hero - Set (Last replaced unit) experience to ExperienceVariable, Hide level-up graphics
Something like that should work, but it's not the best method.

Sorry to sound even more noobish.... But I can't seem to find;
Set ExperienceVariable = (Hero experience of (Unit))
I mean the experience part.. ;)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Sorry to sound even more noobish.... But I can't seem to find;
Set ExperienceVariable = (Hero experience of (Unit))
I mean the experience part.. ;)
That is called a variable :D

Inside the trigger editor, press CTRL + B, a new screen will pop up.
Here you click the green X with the little arrow (Create new variable).
As type, select "Integer" (since experience is an integer) and as name "ExperienceVariable" (name doesn't really matter, but it's the example I have chosen so it might be easier).
The menu should look like this:
createvariable.jpg



Then just click Okay all the way 'till you're back in the trigger editor.
Now you can use the action "Set Variable" (in "All") and choose the one you just created ^^

This is how it should look once you're done:
variablemenu.jpg


And the action:
actionvariable.jpg


I hope this helped.
 
Status
Not open for further replies.
Top