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

How to increase acquisition range and one question more

Status
Not open for further replies.
Level 3
Joined
Dec 2, 2018
Messages
11
My unit have 400 attack range and 700 adquisition range

with upgrade 1 is 500 attack range and 700 adquisition range

upgrade 8 is 1200 attack range and 700 adquisition range

how can i increase adquisition range every time i upgrade?

-----------------------------------------
And another question is this trigger

All works fine but then of wait 1.5 seconds it didnt work, what is wrong there?

  • Weaasdasd 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reunir
    • Actions
      • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Triggering unit)) matching (((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and ((Unit-type of (Matching unit)) Equal to Soldier))) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Move To (Position of (Casting unit))
          • Wait 1.50 seconds
          • Unit - Order (Picked unit) to Hold Position
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
Read what the world editor info-box tells you under "unit group - pick every unit...".
-> That you shouldn't use waits inside the loop.

You should be able to use a trigger for the acquisition range.
 
Level 24
Joined
Jun 26, 2020
Messages
1,853
For the first problem
  • Trigger 1
    • Events
      • Unit - A unit finishes investigation
    • Conditions
      • (Researched tech-type) Equal to "Your tech"
    • Actions
      • Set NewRange[(Player number of (Triggering player))] = "Your value" // I heard "Triggering player" works as "Owner of Triggering unit", if not, just change it
  • Trigger 2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Current research level of "Your tech" for (Triggering player)) Greater than 0
      • (Unit-type of (Triggering unit)) Equal to "Your unit"
    • Actions
      • Unit - Set (Entering unit) acquisition range to NewRange[(Player number of (Triggering player))]
But doesn't the same update have the option of increasing the acquisition range? or am I wrong?

For the second problem, the unit group function says "Do not use wait actions into them", and you need to know about memory leak, change it to:
  • Weaasdasd 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reunir
    • Actions
      • Custom script: local group udg_TempGroup
      • Set TempLoc = (Position of (Triggering unit))
      • Set TempGroup =(Units within 500.00 of TempLoc matching (((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and ((Unit-type of (Matching unit)) Equal to Soldier)))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Move To TempLoc
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Wait 1.50 seconds
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Hold Position
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: set udg_TempGroup=null
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,853
For that, just edit the first trigger
  • Trigger 1
    • Events
      • Unit - A unit finishes investigation
    • Conditions
      • (Researched tech-type) Equal to "Your tech"
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set NewRange[TempInt] = "Your value"
      • Set TempGroup = (Units of type "Your unit" owned by (Triggering Player))
      • Unit Group - Pick every unit in TempGroup and then do actions
        • Loop - Actions
          • Unit - Set (Picked unit) acquisition range to NewRange[TempInt]
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Status
Not open for further replies.
Top