Ability freezing unit?

zaqer50

TH.net Regular
Reaction score
3
I have a dummy ability, and when you cast it on a unit, it "tames" them or changes their ownership to you and then removes the ability so you cna only have 1 "pet". For some reason whenever you tame something it freezes your guy. I know whatever is wrong is wrong with the part where it removes the ablility "tame". I just dont know what.

Code:
Tame
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Tame 
    Actions
        Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color
        Unit - Remove Tame  from (Casting unit)
 

TPOX

New Member
Reaction score
10
first of all what is your ability based off of that you are using
secondly add 2 variables, one being CastingUnitTame (unit) and another TargetUnitTame (unit) and set the values to casting unit and target of ability being cast.

makes it cleaner
 

TPOX

New Member
Reaction score
10
and also i dont think that would work once u tame and the tamed unit dies, you cant tame again.

You could do in actions something like:

E: Begins casting an ability

C: Ability being cast = tame

A:Set CastingUnitTame to casting unit
Set TargetUnitTame to target unit of ability being cast

If
TamedUnit = nounit

Then
Change ownership
Set TamedUnit to last changed ownership unit
Else
Do nothing

Then another trigger going

Event a unit dies

Dying unit = tamedunit
tamedunit is equal to nounit = false

set tamedunit to nounit


so basically trigger 1 is doing when u cast tame if there is no unit that is currently tamed tame that unit else do nothing so which in that case u cast it on them nothing will happen... and if it costs mana instead of putting do nothing put (Order castingunittame to stop) so it costs no mana.

Then 2nd trigger is if tamedunit dies it will reset the variable so u can tame again.

Now this is just off the top of my head id have to check editor but also might wanna ask about begins casting an ability but i think its impossible to abuse.
 

zaqer50

TH.net Regular
Reaction score
3
But this answer my question, why does it freeze when it removes the ability? thats where the problem is.
 
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