Clone a Hero? Is it possible?

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Hi again :D

This time I want to know if it's possible to clone a hero, and if so, then how.

The idea here is that I have a hero that has an ability called 'replicate'. When he casts it on another hero, he briefly becomes an exact copy of that unit. I thought this was possible by using unit variables, because they store stats, items, abilities etc, but I can't seem to find a way to Create from a unit variable.

Any help is appreciated :D
 

Yoshii

New Member
Reaction score
74
lets say for example that you use banish as base spell.You make a unit type variable to store the "target of ability being cast" then use unit create 1 of unit type variable. its actually pretty simple.

this it how I did it on my map; in my map when the enter a special area the map create a clone of the hero that you need to fight
Trigger:
  • ImageFight
    • Events
      • Unit - A unit enters ImageRegion <gen>
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to User
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Pick every unit in (Units in ImageRegion <gen> owned by Player 11 (Dark Green)) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Unit Group - Pick every unit in (Units in ImageRegion <gen> matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set AttributeImage[1] = (Strength of (Picked unit) (Exclude bonuses))
          • Set AttributeImage[2] = (Agility of (Picked unit) (Exclude bonuses))
          • Set AttributeImage[3] = (Intelligence of (Picked unit) (Exclude bonuses))
          • Unit - Create 1 (Unit-type of (Picked unit)) for Player 11 (Dark Green) at (Center of Cloneposition <gen>) facing Default building facing degrees
          • Set ClonedHero = (Unit-type of (Last created unit))
          • Hero - Modify Strength of (Last created unit): Set to (AttributeImage[1] x 3)
          • Hero - Modify Agility of (Last created unit): Set to (AttributeImage[2] x 3)
          • Hero - Modify Intelligence of (Last created unit): Set to (AttributeImage[3] x 3)
          • Unit - Add Spell Immunity to (Last created unit)
 

Azlier

Old World Ghost
Reaction score
461
You can use Game Cache to clone units rather perfectly. Store the unit (this does not delete the original) and restore it somewhere. An exact replica is born.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
I thought that would be a good way to do it...

Thanks a lot for the quick responses :D, and watch this space, I may need help with those caches...
 

oveRLuckEd

New Member
Reaction score
6
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to <Ability>
    • Actions
      • Unit - Create a Dummy corpse for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast))
      • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
...is that for this thread?

Anyway, i wanted to ask another question. Suppose I did clone the unit, how could I store whatever experience the cloned hero gained, and then give it to the original hero when he returns? I would just store any gained experience into a variable or custom value, right?
 

jackall

You can change this now in User CP.
Reaction score
37
you need to store the experience the hero has when he got cloned then when it dies set another integer variable to the experience he had in that moment and then substract the exp he had when cloned from the one when he died
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top