hel pme with control hero

Love-Nature

New Member
Reaction score
7
I just made an ability that controls an enemy hero for a short duration, well i can control it but then i want it to return back to the previous owner, i tried using this but it didnt work

Trigger:
  • Charm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Charm
    • Actions
      • Set CharmCastUnit = (Casting unit)
      • Set CharmTargetUnit = (Target unit of ability being cast)
      • Unit - Change ownership of CharmTargetUnit to (Owner of CharmCastUnit) and Retain color
      • Trigger - Run FloTex Target3 <gen> (checking conditions)
      • Countdown Timer - Start Timer13 as a One-shot timer that will expire in (3.00 + ((Real((Level of Charm for CharmCastUnit))) x 1.00)) seconds


It works
_____________________________________

It doesnt

Trigger:
  • Charm Expire
    • Events
      • Time - Timer13 expires
    • Conditions
    • Actions
      • Unit - Change ownership of CharmCastUnit to (Previous owner) and Retain color
      • Trigger - Run FloTex Target3e2 <gen> (checking conditions)


Also i will have to check if unit is dead during this process while controlled, how to turn it back to previous owner before it revives, so just when it actually dies.

Here i also used CharmTarget Charm Target / CharmCast CharmCast / cast target / target cast etc! omg :(
Unit - Change ownership of CharmCastUnit to (Previous owner) and Retain color
 

gameman

It's been a long, long time.
Reaction score
95
I hope this helps.

Add this in, instead of the "previous owner"
Trigger:
  • Set Charmunitowner = (Owner of CharmTargetUnit)


And as for the death, I belive this would work.
Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to CharmTargetUnit
      • (Elapsed time for Timer13) Less than 10.00
    • Actions
      • Unit - Change ownership of CharmTargetUnit to Charmunitowner and Change color



Forgive me if I am no help, but I am trying.
 

Love-Nature

New Member
Reaction score
7
I hope this helps.

Add this in, instead of the "previous owner"
Trigger:
  • Set Charmunitowner = (Owner of CharmTargetUnit)


And as for the death, I belive this would work.
Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to CharmTargetUnit
      • (Elapsed time for Timer13) Less than 10.00
    • Actions
      • Unit - Change ownership of CharmTargetUnit to Charmunitowner and Change color



Forgive me if I am no help, but I am trying.

I dont understand, what Variable is charmunitowner?
 

gameman

It's been a long, long time.
Reaction score
95
Its the original owner of the unit that you are taking control of.

EDIT:
Trigger:
  • Actions
    • Set CharmCastUnit = (Triggering unit)
    • Set CharmTargetUnit = (Target unit of ability being cast)
    • Set Charmunitowner = (Owner of CharmTargetUnit)
    • Unit - Change ownership of CharmTargetUnit to (Owner of CharmCastUnit) and Change color
 

Love-Nature

New Member
Reaction score
7
Its the original owner of the unit that you are taking control of.

EDIT:
Trigger:
  • Actions
    • Set CharmCastUnit = (Triggering unit)
    • Set CharmTargetUnit = (Target unit of ability being cast)
    • Set Charmunitowner = (Owner of CharmTargetUnit)
    • Unit - Change ownership of CharmTargetUnit to (Owner of CharmCastUnit) and Change color

I still dont know what variable you used for charmunitowner, it isnt Unit varibale.
I cant understand it guys please help :(
 

Bigheaded

New Member
Reaction score
4
I would have thought it would be a "unit" variable, as you're talking about one specific unit.

I am not sure how many of these units are on the field, can multiple charms be active? what happens if the hero dies after it's taken over? this doesn't solve these problems but it will change the target back

Trigger:
  • Charm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Charm
    • Actions
      • Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Triggering unit)) and Change color
      • Wait (3.00 + ((Real((Level of Charm for CharmCastUnit))) x 1.00)) seconds
      • Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Target unit of ability being cast)) and Change color

Any use to you?

edit: just looked at it again and it might not work (sorry, the other ways are probably much better tbh), and i need to go to bed. will look at tommorrow if unsolved.
 

Love-Nature

New Member
Reaction score
7
I would have thought it would be a "unit" variable, as you're talking about one specific unit.

I am not sure how many of these units are on the field, can multiple charms be active? what happens if the hero dies after it's taken over? this doesn't solve these problems but it will change the target back

Trigger:
  • Charm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Charm
    • Actions
      • Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Triggering unit)) and Change color
      • Wait (3.00 + ((Real((Level of Charm for CharmCastUnit))) x 1.00)) seconds
      • Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Target unit of ability being cast)) and Change color

Any use to you?

edit: oh heck, gimme a sec, won't work atm.

Ok but i'd prefer to use Variables and timers, anyways i just need to solve one action, not the whole trigger, there must be a way....

I need to solve this
Trigger:
  • Unit - Change ownership of (Picked unit) to (???) and Change color


Used picked unit because i changed trigger,

this is the one i used because that control might be too op

Trigger:
  • Control
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Control
    • Actions
      • Set ControlPoint = (Target point of ability being cast)
      • Set ControlTarget = (Target unit of ability being cast)
      • Set ControlTriggering = (Triggering unit)
      • Set Temp_Group = (Units within (100.00 + ((Real((Level of Control for ControlTriggering))) x 25.00)) of ControlPoint matching ((((Matching unit) belongs to an enemy of (Owner of ControlTriggering)) Equal to (==) True) and ((((Matching unit) is alive) Equal to (==) True) and
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to (Owner of ControlTriggering) and Change color
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Countdown Timer - Start Timer12 as a One-shot timer that will expire in (3.00 + ((Real((Level of Control for ControlTriggering))) + 1.00)) seconds


and this for expire

Trigger:
  • Control Expire
    • Events
      • Time - Timer12 expires
    • Conditions
    • Actions
      • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) belongs to an enemy of (Owner of ControlTriggering)) Equal to (==) True) and ((((Matching unit) is alive) Equal to (==) True) and (((Matching unit) is A Hero) Equal to (==) False))))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to (Previous owner) and Change color
      • Custom script: call DestroyGroup(udg_Temp_Group)


The same problem, it controls but doesnt turn back.
 

merlinds

Member
Reaction score
15
Why don`t you save the player number of the owner of the target of the abvility being cast in a Ingeter variable?? isnt it easyer?? the you just load it as a player index!
 

Love-Nature

New Member
Reaction score
7
Why don`t you save the player number of the owner of the target of the abvility being cast in a Ingeter variable?? isnt it easyer?? the you just load it as a player index!

Dude, im not that advanced with the world editor...i just want to fix my problem, may you please focus on it ? :s

Unit - Change ownership of (Picked unit) to (???) and Change color

Nevermind i dont need this anymore, thank you anyways :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top