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

Is it possible to return a unit that was replaced?

Status
Not open for further replies.
Level 12
Joined
Feb 22, 2010
Messages
1,115
If you use, Unit - Replace action, there is no way, because it removes old unit.Instead of replacing unit, you can try hiding old unit and unhiding it whenever you need.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
IIRC, you can't because the unit is removed from the game. You're referring to the trigger action Replace Unit right?
 
Level 5
Joined
Jan 23, 2014
Messages
152
@Ceday - ok I'll try that, I'll post again soon

@Chobibo - Yep it's that one. I just thought it would be hidden or something. Thanks for that info
 
Level 5
Joined
Jan 23, 2014
Messages
152
I did Ceday's suggestion and it works perfectly. Although the hero icon of the new unit is there, and the replaced unit doesn't get the experience the new unit gains. And I need the old unit to die if the new unit dies. How do I make it like that?

@Rheiko - I cant find a command like that, is it under the "Units"?
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Are you making a meepo-like hero? I think the experience is distributed globally in DotA... try looking on the global constants settings for that.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
I did Ceday's suggestion and it works perfectly. Although the hero icon of the new unit is there, and the replaced unit doesn't get the experience the new unit gains. And I need the old unit to die if the new unit dies. How do I make it like that?

@Rheiko - I cant find a command like that, is it under the "Units"?

Well, then instead of saving old unit, just save old unit's type.When you want old unit back, create a unit with the type of old one, transfer all items, add equal amount of experince.
 
Level 5
Joined
Jan 23, 2014
Messages
152
Not like meepo, it's Ichigo from Bleach vs One Piece. Guess I have to do it the long way hahaha. Thank you for all your help!
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Can't you do that with something like the demon hunter/etc. transformation ability? I'm guessing your ability is the transition from shikai to bankai right?
 
Level 5
Joined
Jan 23, 2014
Messages
152
Its actually Bankai-Vasto Lorde but whenever it does, it gets messed up.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Why don't you save the 1st unit-type as variable... Not rly sure how it looks in your map but I believe it would be something similar:


Some event
Save unit1 as variable, lets call it UNIT
(Save stats of unit if needed)
Replace unit1 with unit2
(Give stats if needed)

Some other event
(Save stats if needed)
Replace unit2 with wnit of type UNIT
(Give stats if needed)
 
Level 5
Joined
Jan 23, 2014
Messages
152
Just discovered the Game Cache commands. Can I use it to store the first unit and restore it after?
 
Level 5
Joined
Jan 23, 2014
Messages
152
Ok thanks for the help. Any things I should know about the game cache? Like destroy/delete it after use?
 
Status
Not open for further replies.
Top