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

Quick question if I fixed leak properly

Status
Not open for further replies.
Level 8
Joined
Mar 2, 2014
Messages
132
  • CannonWave1
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Set C0 = (Random point in C0 <gen>)
      • Unit - Order Mortar Team 0003 <gen> to Attack Ground C0
      • Custom script: call RemoveLocation (udg_C0)
      • Set C1 = (Random point in C1 <gen>)
      • Unit - Order Mortar Team 0011 <gen> to Attack Ground C1
      • Custom script: call RemoveLocation (udg_C1)
      • Set C2 = (Random point in C2 <gen>)
      • Unit - Order Mortar Team 0044 <gen> to Attack Ground C2
      • Custom script: call RemoveLocation (udg_C2)
      • Set C3 = (Random point in C3 <gen>)
      • Unit - Order Mortar Team 0051 <gen> to Attack Ground C3
      • Custom script: call RemoveLocation (udg_C3)
      • Set C4 = (Random point in C4 <gen>)
      • Unit - Order Mortar Team 0052 <gen> to Attack Ground C4
      • Custom script: call RemoveLocation (udg_C4)
      • Set C5 = (Random point in C5 <gen>)
      • Unit - Order Mortar Team 0053 <gen> to Attack Ground C5
      • Custom script: call RemoveLocation (udg_C5)
      • Set C6 = (Random point in C6 <gen>)
      • Unit - Order Mortar Team 0054 <gen> to Attack Ground C6
      • Custom script: call RemoveLocation (udg_C6)
      • Set C7 = (Random point in C7 <gen>)
      • Unit - Order Mortar Team 0055 <gen> to Attack Ground C7
      • Custom script: call RemoveLocation (udg_C7)
      • Set C8 = (Random point in C8 <gen>)
      • Unit - Order Mortar Team 0056 <gen> to Attack Ground C8
      • Custom script: call RemoveLocation (udg_C8)
      • Set C9 = (Random point in C9 <gen>)
      • Unit - Order Mortar Team 0057 <gen> to Attack Ground C9
      • Custom script: call RemoveLocation (udg_C9)
Also will it lag, if I will have total of 72 mortals working like this in my map?:X
 
Level 8
Joined
Mar 2, 2014
Messages
132
Well, I did not renamed mortals to cannons yet
but each cannon has it´s own sector to fire and I do not know how to make shortcut with interger :X
cannons.jpg
 
Level 8
Joined
Jan 28, 2016
Messages
486
  • Loop (Integer A) from 0 to 9
  • Loop:
    • Set TempPoint = (Random point in C[(Integer A)] <gen>)
    • Unit - Order Mortar Team 0003 <gen> to Attack Ground TempPoint
    • Custom script: call RemoveLocation (udg_TempPoint)

That would work but he is using 10 different, pre-placed Mortar Teams to attack 10 different regions which means he has store the units in an array so they can be used in the loop. Otherwise he is telling the same unit (in this case, Mortar Team 003) to attack all 10 different regions.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
You're removing them just fine, however there is a way more efficient and easier way of doing what you want to do. WereElf had the right idea, but Dehua pointed out an error in WereWelf's example trigger.

  • Map Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set MortarTeam[0] = Mortar Team 0003 <gen>
      • Set AttackRegion[0] = C0 <gen>
      • -------- --------
      • Set MortarTeam[1] = Mortar Team 0011 <gen>
      • Set AttackRegion[1] = C1 <gen>
      • -------- --------
      • Set MortarTeam[2] = Mortar Team 0044 <gen>
      • Set AttackRegion[2] = C2 <gen>
      • -------- --------
      • Set MortarTeam[3] = Mortar Team 0051 <gen>
      • Set AttackRegion[3] = C3 <gen>
      • -------- --------
      • Set MortarTeam[4] = Mortar Team 0052 <gen>
      • Set AttackRegion[4] = C4 <gen>
      • -------- --------
      • Set MortarTeam[5] = Mortar Team 0053 <gen>
      • Set AttackRegion[5] = C5 <gen>
      • -------- --------
      • Set MortarTeam[6] = Mortar Team 0054 <gen>
      • Set AttackRegion[6] = C6 <gen>
      • -------- --------
      • Set MortarTeam[7] = Mortar Team 0055 <gen>
      • Set AttackRegion[7] = C7 <gen>
      • -------- --------
      • Set MortarTeam[8] = Mortar Team 0056 <gen>
      • Set AttackRegion[8] = C9 <gen>
      • -------- --------
      • Set MortarTeam[9] = Mortar Team 0057 <gen>
      • Set AttackRegion[9] = C9 <gen>
  • Cannon Wave
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Loop_Int) from 0 to 9, do (Actions)
        • Loop - Actions
          • Set TempLoc = (Random Point in AttackRegion[Loop_Int])
          • Unit - Order MortarTeam[Loop_Int] to Attack Ground TempLoc
          • Custom script: Call RemoveLocation(udg_TempLoc)
 
Status
Not open for further replies.
Top