Detecting Defend/Undefend

bananaHUNT

You can change this now in User CP
Reaction score
55
Hiya, I've been trying to make an ability based on the Defend ability (from footmen). However I can't make it detect when defend is on/off.
I tried 'A unit starts the effect of an ability' first, but that didn't work at all. Then I searched some and a guy said to do this; but it still doesn't work..
The saddest thing is that he had made a testmap for it, but it's back from 2007 and no longer available. :(

What I have now:
Code:
Essence
    Events
        Unit - A unit Is issued an order with no target
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Issued order) Equal to (Order(defend))
                (Issued order) Equal to (Order(undefend))
    Actions
        Set EssenceCaster = (Casting unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Issued order) Equal to (Order(defend))
            Then - Actions
                Unit - Create 1 Dummy for (Owner of EssenceCaster) at (Position of EssenceCaster) facing (Facing of EssenceCaster) degrees
                Unit - Order (Last created unit) to Human Priest - Inner Fire EssenceCaster
                Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
            Else - Actions
                Unit - Remove Essence  buff from EssenceCaster
ps; everything with the dummy unit and ability is fine, i checked it with a different ability. just the defend detection is flawed.
thanks for your help! :)
 

Jagan

New Member
Reaction score
30
Casting unit? Change to Triggering Unit

I think that's the problem too. But if that somehow fails as well, try making two separate triggers. One detecting the order defend and the other, undefend.

Something like:

Trigger 1:
Code:
Essence Activate
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        Ability being cast equal to 'Your Ability'
    Actions
        Set EssenceCaster = (Triggering unit)
        Unit - Create 1 Dummy for (Owner of EssenceCaster) at (Position of EssenceCaster) facing (Facing of   EssenceCaster) degrees
        Unit - Order (Last created unit) to Human Priest - Inner Fire EssenceCaster
        Unit - Add a 5.00 second Generic expiration timer to (Last created unit)

Trigger 2:
Code:
Essence Deactivate
    Events
        Unit - A unit is issued an order with no target
    Conditions
        (Issued order) Equal to (Order(undefend))
    Actions
        Set EssenceCaster = (Triggering unit)
        Unit - Remove Essence  buff from EssenceCaster
 
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