• 🏆 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!

Can acquisition range be changed?

Status
Not open for further replies.
Level 5
Joined
Sep 10, 2006
Messages
185
I set the A range to 1 for a certain unit in the editor. I then did this:

  • Unit - Set (Attacked unit) acquisition range to ((Current acquisition range of (Attacked unit)) + 1.00)
After it is attacked, I had it print out the range, and it is unchanged.

What did I do wrong?

Edit: Here's the whole trigger

  • Phase Disrupter
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Night Elf Fishing Village (4)
      • ((Attacked unit) has buff Phased Out ) Equal to False
    • Actions
      • Set PhasePos = (Position of (Attacked unit))
      • Set PhasePos = (PhasePos offset by 200.00 towards ((Facing of (Attacked unit)) - 180.00) degrees)
      • Unit - Move (Attacked unit) instantly to PhasePos
      • Unit - Set (Attacked unit) acquisition range to ((Current acquisition range of (Attacked unit)) + 1.00)
      • Game - Display to (All players) the text: (AQ Range - + (String((Current acquisition range of (Attacked unit)))))
      • Special Effect - Create a special effect at PhasePos using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Current acquisition range of (Attacked unit)))) Greater than or equal to 6
        • Then - Actions
          • Game - Display to (All players) the text: (AQ Range - + (String((Current acquisition range of (Attacked unit)))))
          • Unit - Set (Attacked unit) acquisition range to 0.00
          • Unit - Create 1 Tharifas for (Owner of (Attacking unit)) at PhasePos facing Default building facing degrees
          • Unit - Hide (Last created unit)
          • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Attacked unit)
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_PhasePos)
Prints out 1.00.
 
Level 5
Joined
Sep 10, 2006
Messages
185
Are you wanting the attacking unit's range changed or the unit being attacked to have his range changed. It seems you've got a few conflicting references

The attacked unit.

If I make the attacker attack a unit with default acq range, it works.

But if I attack a unit with an acq range of 1, it does not change.
 
Level 3
Joined
May 3, 2008
Messages
44
  • (Integer((Current acquisition range of (Attacked unit)))) Greater than or equal to 6
That's the only thing I can think of that might bug this, you said using a default AQ range unit lets the trigger work, well a normal AQ range is over 6. Also, once a unit has been through the "then" section of your if/then/else, his acquisition range is 0, which wont allow him to pass the above condition anymore.

So if the units AQ range is below 6, then it would be directed to the "else" section of the trigger, which has nothing listed (I'd put Do Nothing there, seems like a good idea)

have you tried removing that condition and then running the unit through the trigger again?
 
Level 5
Joined
Sep 10, 2006
Messages
185
  • (Integer((Current acquisition range of (Attacked unit)))) Greater than or equal to 6
That's the only thing I can think of that might bug this, you said using a default AQ range unit lets the trigger work, well a normal AQ range is over 6. Also, once a unit has been through the "then" section of your if/then/else, his acquisition range is 0, which wont allow him to pass the above condition anymore.

So if the units AQ range is below 6, then it would be directed to the "else" section of the trigger, which has nothing listed (I'd put Do Nothing there, seems like a good idea)

have you tried removing that condition and then running the unit through the trigger again?

Just a little FYI, do nothing wastes processing time when leaving it blank results with the same results. :)

and I guess I'll try your suggestion.
 
Level 3
Joined
May 3, 2008
Messages
44
Just a little FYI, do nothing wastes processing time when leaving it blank results with the same results. :)


Really? Visual basic used to yell at me all the time for not putting in an "else" command, so it just became second nature I guess.

anyway, I don't see anything else that could be wrong with your triggers unless it's a bug in the editor itself (Flamestrike = most evil ability in W editor ever =\) Anything different after removing that condition?
 
Status
Not open for further replies.
Top