Remove location

koeienboei

Member
Reaction score
4
Code:
Leak
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Set Point = (Random point in (Playable map area))
        Unit - Create 1 Footman for Player 1 (Red) at Point facing Default building facing (270.0) degrees


Should i remove this point every time the trigger runs? Doesnt it just overwrite the point every 2 sec?
 

Razed

New Member
Reaction score
44
You should 'Set Point = ...' in a trigger that just runs at 0.00 sec Elapsed (or Map Ini.) and then let this trigger run every 2 sec without having to set the variable everytime.

It never has to be destroyed, and because you set it once, it won't leak.

EDIT:

Code:
Set Variable    
     Events
        Map Ini.
     Conditions
     Actions
        Set Point = (Random point in (Playable map area))

Code:
Leak
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Unit - Create 1 Footman for Player 1 (Red) at Point facing Default building facing (270.0) degrees
 

Razed

New Member
Reaction score
44
If you set it once to a 'Random' location it will sent you to random locations, not to the same one, dooh :p
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Should i remove this point every time the trigger runs? Doesnt it just overwrite the point every 2 sec?
You should remove it. Locations are in-game objects just as much as units or destructables are. The game doesn't know how to destroy unreferenced objects by itself.

If you set it once to a 'Random' location it will sent you to random locations, not to the same one, dooh
No.

Points don't carry attributes like that.
 

koeienboei

Member
Reaction score
4
No it does not. It sets the point to a random location and then it remains the same. I just tested it.


So every time i change a point i have to remove the old one? Can i also use "Point - move"
 

Razed

New Member
Reaction score
44
In that case just simply do this:

Code:
Leak
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Set Point = (Random point in (Playable map area))
        Unit - Create 1 Footman for Player 1 (Red) at Point facing Default building facing (270.0) degrees
        Custom Script: call RemoveLocation(udg_Point)

Done.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
The points do get overwritten, and that's a bad mistake. The game doesn't 'delete' the overwritten points; they are strored in the game memory and as they pile up, can cause a serious lag.

Hence you need to remove the location, just as how Razed as written.
 

koeienboei

Member
Reaction score
4
Alright now i get it. But can i also move the point to somewhere else, instead of removing the old one and making a new point?
 

UndeadDragon

Super Moderator
Reaction score
447
You need to remove it before you set it to somewhere else.
 
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