¿ "call RemoveLocation (udg_TempPoint[?])" ?

NeosDany

Member
Reaction score
1
Oh my god, I do not know if you will understand what I need, look, I have created a variable point with an array and I use as:
set TempPoint[1] = x point (x point may be a position of an unit)
set TempPoint[2] = x point (x point may be a position of another unit)
and so on,
but when I want to clear it I have to
call RemoveLocation (udg_TempPoint[1])
then call RemoveLocation (udg_TempPoint[2])
then call RemoveLocation (udg_TempPoint[3])
and so on,
It is very exhausting to do.
So, does exist a way shorter to clear many locations with one custom script only?

Also I want to ask why in my map, when the event unit enters region occur, I have many regions with this event, it makes the creep to go to the next region, it is a td map, again to the question, why when there are more than 60 units entering in the players region they do a little lag, like a 0.01 sec lag, but it repeats and it is frustrating for me.
 

chobibo

Level 1 Crypt Lord
Reaction score
48
Trigger:
  • Array Loop
    • Events
    • Conditions
    • Actions
      • -------- Declare the local variables you need for the loop --------
      • Custom script: local integer i=0
      • Custom script: local integer j=10 // How many temporary locations you have.
      • -------- Main code here --------
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • -------- endblock --------
      • -------- Use a loop to remove multiple locations stored on a location array --------
      • Custom script: loop
      • Custom script: exitwhen i==j
      • Custom script: call RemoveLocation(udg_TempPoint<i>)
      • Custom script: set i=i+1
      • Custom script: endloop
    • </i>
 

bajaist

Member
Reaction score
4
Or u could use something like:

a step further
if you have many of those things...
temp_point[1]
temp_point[2]
temp_point[3]
temp_point[etc..]



use call RemoveLocation (udg_temp_point[bj_forLoopAIndex]) instead of removing them one by one...
 

Inflicted

Currently inactive
Reaction score
63
You could mae a loop I guess.

if there are only 1 or 2 variables to be cleared, not worth the effort. Just copy and paste an old one and change the values.

If there are 3-100 variables of the same type and of an array, either reduce your amount used or loop it.

EDIT: Like what chobibo said.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top