Ping nearest bases

Asdfblah1

New Member
Reaction score
10
[RESOLVED] Apparently, if you set a temp_point based off a point that already exists, and then remove it, BOTH points are removed! In this trigger, notice that I never set the Base_Locations. When I set the temp_point to equal one of them and remove the temp_point, both points are gone. I fixed it by changing the cinematic to:
Trigger:
  • Cinematic - Ping minimap for (Player group((Triggering player))) at Base_Locations[(Integer B)] for 5.00 seconds
and removing the temp_point setting entirely in the last for loop.

If someone needs a 'get nearest point' in GUI, here ya go.

This trigger supposedly pings the nearest 4 bases (listed in base_locations[]) relative to the player's footman.
It's suppose to set all of the base distances in base_unsorted, find the smallest number (nearest), stick it in base_pinger[], set the chosen base_unsorted to some ridiculous value so it won't be picked again, and do it again 3 more times. Base_unsorted values are reset so the original base_location can be found and pinged.

Currently, the command pings the 4 nearest bases flawlessly but after consecutive uses of the command, all unpinged bases are pinged eventually. When there are no bases left, it just pings the center of the map. What am I doing wrong?
Trigger:
  • Bases
    • Events
      • Player - Player 1 (Red) types a chat message containing -base as An exact match
    • Conditions
    • Actions
      • Set Temp_Group = (Units owned by (Triggering player) of type Footman)
      • Set Temp_Point = (Position of (Random unit from Temp_Group))
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • For each (Integer A) from 1 to 23, do (Actions)
        • Loop - Actions
          • Set Base_Unsorted[(Integer A)] = (Distance between Temp_Point and Base_Locations[(Integer A)])
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Temp_Real = (Min(Base_Unsorted[(23 - 1)], Base_Unsorted[23]))
          • For each (Integer B) from 0 to 22, do (Actions)
            • Loop - Actions
              • Set Temp_Real = (Min(Base_Unsorted[(23 - (Integer B))], Temp_Real))
          • Set Base_Pinger[(Integer A)] = Temp_Real
          • For each (Integer B) from 1 to 23, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_Real Equal to Base_Unsorted[(Integer B)]
                • Then - Actions
                  • Set Base_Unsorted[(Integer B)] = 100000.00
                • Else - Actions
                  • Do nothing
      • For each (Integer A) from 1 to 23, do (Actions)
        • Loop - Actions
          • Set Base_Unsorted[(Integer A)] = (Distance between Temp_Point and Base_Locations[(Integer A)])
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 23, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Base_Pinger[(Integer A)] Equal to Base_Unsorted[(Integer B)]
                • Then - Actions
                  • Set Temp_Point = Base_Locations[(Integer B)]
                  • Cinematic - Ping minimap for (Player group((Triggering player))) at Temp_Point for 5.00 seconds
                  • Custom script: call RemoveLocation(udg_Temp_Point)
                • Else - Actions
                  • Do nothing
 
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