Trigger Based Ability doesnt work with autocast?

cstorm

New Member
Reaction score
1
Hello, I've been working with warcraft 3 editor for a few years now, slowly gotten better, learned how to create some new abilities using triggers ect. But now i've run into a problem with an autocasting-Arrow ability not triggering the AOE implemented using triggers. If the ability auto-casts the trigger will not occur, although if I target a unit the trigger will occur. I know why this is happening (Because auto-cast selects the nearest most dangerous target without actually "Player manipulated targetting" per say.
Here is the code for the ability, if anyone knows a way to help please do.

Code:
Actions
    Set AbilitiesPointOriginExplodArro[(Player number of (Owner of (Casting unit)))] = ((Target point of ability being cast) offset by (0.00, 0.00))
    Set AbilitiesExplodeArrowUnits[(Player number of (Owner of (Casting unit)))] = (Units within 250.00 of AbilitiesPointOriginExplodArro[(Player number of (Owner of (Casting unit)))])
    Special Effect - Create a special effect at AbilitiesPointOriginExplodArro[(Player number of (Owner of (Casting unit)))] using Abilities\Spells\Other\Doom\DoomDeath.mdl
    Unit Group - Pick every unit in AbilitiesExplodeArrowUnits[(Player number of (Owner of (Casting unit)))] and do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Owner of (Picked unit)) Not equal to (Owner of (Casting unit))
                Then - Actions
                    Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 42.00)
                    Unit - Wake up (Triggering unit)
                Else - Actions
 

cstorm

New Member
Reaction score
1
Code:
Events
    Unit - A unit Begins casting an ability
Conditions
    (Ability being cast) Equal to Magic Arrow 
    (Level of Magic Arrow  for (Casting unit)) Equal to 4

didnt see that did post haha. I dont have a buff yet, but am adding code right now to create a buff.
 

tommerbob

Minecraft. :D
Reaction score
110
Well if it is based on an orb effect like frost arrows or poison arrows or something like that, you can simply detect when teh target takes damage and if it has the correct buff or not.
 

cstorm

New Member
Reaction score
1
Code:
Events
    Unit - A unit Is attacked
Conditions
    ((Attacked unit) has buff Exploding Arrow ) Equal to True
Actions
    Set AbilitiesPointOriginExplodArro[(Player number of (Owner of (Attacking unit)))] = ((Position of (Attacked unit)) offset by (0.00, 0.00))
    Set AbilitiesExplodeArrowUnits[(Player number of (Owner of (Attacking unit)))] = (Units within 250.00 of AbilitiesPointOriginExplodArro[(Player number of (Owner of (Attacking unit)))])
    Special Effect - Create a special effect at AbilitiesPointOriginExplodArro[(Player number of (Owner of (Attacking unit)))] using Abilities\Spells\Other\Doom\DoomDeath.mdl
    Unit Group - Pick every unit in AbilitiesExplodeArrowUnits[(Player number of (Owner of (Attacking unit)))] and do (Actions)
        Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Owner of (Picked unit)) Not equal to (Owner of (Attacking unit))
                Then - Actions
                    Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 42.00)
                    Unit - Wake up (Triggering unit)
                Else - Actions
I attempted to used this but it doesn't work, I'm not sure what to do. The ability leaves a buff, which is supposed to be the event trigger.
 

tommerbob

Minecraft. :D
Reaction score
110
You need to use a damage detection system instead of an "attacked" event. The reason is that the event "a unit is attacked" fires before any damage is received. There are multiple problems with this, but the one that concerns you at this point is that the event will fire before the buff is applied. If you use a damage detection, the buff applies before the damage is received, so it can properly detect when the ability is used.

Use Weep's GDD, you can find it here: Damage Detection
 

SanKakU

Member
Reaction score
21
what i don't get is you can easily trigger curse and frost armor stuff for if the hero is attacked but that's not something that works for arrow abilities at all for if the hero attacks a unit.
 
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