• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Modifying Max Range with Acquisition Range

Status
Not open for further replies.
Level 5
Joined
Feb 8, 2015
Messages
93
I was trying to make a (relatively simple, I thought) spell.
When used; it applies a buff to the User which gradually improves range over its duration.

I used the trick of setting the unit's range to 190000000, and simply limiting the acquisition range to 550 (default max range).

However; changing the unit's acquisition range with triggers has no effect; the range remains 550.


(The ability is based off of Berserk, and the buff is definitely applied properly)
  • Arcane Horizon Initiate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mech: Arcane Horizon
    • Actions
      • Set ArcHori_cast = (Triggering unit)
      • Unit Group - Add ArcHori_cast to ArcHori_Group
      • Set ArcHori_Growth = (60.00 + (20.00 x (Real((Level of (Ability being cast) for ArcHori_cast)))))
      • Set ArcHori_Max = 1200.00
      • Trigger - Turn on Arcane Horizon Loop <gen>
  • Arcane Horizon Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ArcHori_Group) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in ArcHori_Group and do (Actions)
            • Loop - Actions
              • Set ArcHori_cast = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ArcHori_cast has buff Arcane Horizon (Berserk)) Equal to True
                • Then - Actions
                  • Game - Display to (All players) the text: Has Buff... Running...
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Integer((Current acquisition range of ArcHori_cast))) Less than (Integer(ArcHori_Max))
                    • Then - Actions
                      • Game - Display to (All players) the text: (Acquisition range increased to: + (String((Current acquisition range of ArcHori_cast))))
                      • Unit - Set ArcHori_cast acquisition range to ((Current acquisition range of ArcHori_cast) + ArcHori_Growth)
                    • Else - Actions
                      • Game - Display to (All players) the text: Acquisition range m...
                      • Unit - Set ArcHori_cast acquisition range to ArcHori_Max
                • Else - Actions
                  • Unit - Set ArcHori_cast acquisition range to (Default acquisition range of ArcHori_cast)
                  • Unit Group - Remove ArcHori_cast from ArcHori_Group
                  • Game - Display to (All players) the text: Acquisition range d...
        • Else - Actions
          • Trigger - Turn off (This trigger)
          • Game - Display to (All players) the text: Trigger turned off

The truly strange thing is that the World Editor reports that the unit's current Acquisition range is properly modified. The Game Messages state perfectly well that the range increases; but the unit remain incapable of attacking enemies further than 550 range away.

Not even this worked...
  • Arcane Horizon Initiate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mech: Arcane Horizon
    • Actions
      • Unit - Set (Triggering unit) acquisition range to 1200.00
 
Acquisition range isn't attack range in trigger editor, only in object editor is it that. You'll have to use web/ensnare with melee attack and a projectile system of some type or a specialized system to obtain this. Neither option is hard however they often require a few days of your time to complete bug testing.

Edit: You could also use upgrade spam however make sure to apply the right optimizers to reduce the amount of trouble this method causes.
 
Level 5
Joined
Feb 8, 2015
Messages
93
Acquisition range isn't attack range in trigger editor, only in object editor is it that. You'll have to use web/ensnare with melee attack and a projectile system of some type or a specialized system to obtain this. Neither option is hard however they often require a few days of your time to complete bug testing.

Edit: You could also use upgrade spam however make sure to apply the right optimizers to reduce the amount of trouble this method causes.
Well thanks for clarifying.

Sadly upgrades won't work, as the buff is temporary.

I'll figure something else out, thanks for the assist.
 
Level 13
Joined
Jul 15, 2007
Messages
763
I think this is an expected behaviour because many hero defenses/survivals give you a -range command which you typically use to set your heroes acqusition range to 0 (to prevent them from auto-attacking). Naturally, if you set a hero with 550 range to 0 acquisition range, they wont acquire targets, but they can (when manually ordered) attack at 550 range.

The only way to (temporarily) increase the attack range of a unit is to morph it into a unit with more range, i think. But this wont give you the "range over time" effect.
 
Status
Not open for further replies.
Top