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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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