• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] How do I do a variable rally point system/ is this spawn correct?

Status
Not open for further replies.
Level 4
Joined
Jul 10, 2013
Messages
60
Edit: New Question!

So, I'm getting close to finishing up my map (a spawn based strategy map) and I want to add a rally point system to make things a lot more convenient for the players.

I want to use a variable, setting it equal to the rally point so I can delete is after with a removelocation to help stop leaks. I've tried to completely do one bases spawn, as seen below, to use it as a base for others. Although its still having issues with Newgen when I save.

  • Scourgeholme spawn
    • Events
      • Time - Every 120.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 11 (Dark Green) Food used) Less than or equal to 80
        • Then - Actions
          • Set Point = Scougeholme main spawn <gen>
          • Unit - Create 3 Nerubian Ripper for Player 11 (Dark Green) at (Center of Point) facing Default building facing degrees
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Offense Tier 1 for Player 11 (Dark Green)) Equal to 1
            • Then - Actions
              • Unit - Create 2 Crypt Fiend for Player 11 (Dark Green) at (Center of Point) facing Default building facing degrees
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Offense Tier 1 for Player 11 (Dark Green)) Equal to 2
            • Then - Actions
              • Unit - Create 2 Crypt Seer for Player 11 (Dark Green) at (Center of Point) facing Default building facing degrees
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Offense Tier 1 for Player 11 (Dark Green)) Equal to 3
            • Then - Actions
              • Unit - Create 1 Crypt Lord for Player 11 (Dark Green) at (Center of Point) facing Default building facing degrees
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current research level of Offense Tier 1 for Player 11 (Dark Green)) Equal to 4
            • Then - Actions
              • Unit - Create 1 Crypt Lord for Player 11 (Dark Green) at (Center of Point) facing Default building facing degrees
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Point)
          • Set Point = (Region centered at (Rally-Point of Scougeholme 0179 <gen> as a point) with size (1.00, 1.00))
          • Unit Group - Pick every unit in (Units in Scougeholme main spawn <gen>) and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to Attack-Move To (Center of Point)
          • Custom script: call RemoveLocation(udg_Point)
        • Else - Actions
Was the closest I could get but, when I try to save it, the jasshelper says that both of the removelocations "Cannot Convert rect to location". I am utterly confused.

EDIT:

New question! Is the following the correct way to do the rally point system without leaks?

  • Set Point = (Rally-Point of Scougeholme 0179 <gen> as a point)
  • Set Temp_Group = (Units in Scougeholme main spawn <gen> owned by Player 11 (Dark Green))
  • Unit Group - Pick every unit in Temp_Group and do (Actions)
    • Loop - Actions
      • Unit - Order (Picked unit) to Attack-Move To Point
  • Custom script: call RemoveLocation(udg_Point)
  • Custom script: call DestroyGroup (udg_Temp_Group)
  • Else - Actions
 
Last edited:
Level 22
Joined
Sep 24, 2005
Messages
4,821
It's because you are setting a rect, the rectangular area on World Editor, and not a point which is not generated by World Editor. I don't know the details in GUI triggers but a rect is different from a location.

I don't think you need to remove the location since you are periodically using the same location, why don't you just store the location and reuse it.
 
Level 4
Joined
Jul 10, 2013
Messages
60
Oh wow I feel dumb. I thought it has to be a location variable to work with the trigger. Thank you guys.

DERP

Aside from that though, would the last part work as a rally point system?
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I think it won't, since some units get distracted on their way to the rally point, if it was a TD and the units ignore being attacked then I guess it would be fine, but if your units engage hostile or if they react to hostilities then a higher frequency (lower the timeout, say every 5 seconds) timer would be better, but not the optimal solution.
 
Level 4
Joined
Jul 10, 2013
Messages
60
You pick all units in a region and order them to move/attack a point?
Yes that works. But just test it :wink:

It works! Excellent, so it was just my own derp that was giving the error.

EDIT:

So, new question, is the following the correct way to do the rally point system without leaks?

  • Set Point = (Rally-Point of Scougeholme 0179 <gen> as a point)
  • Set Temp_Group = (Units in Scougeholme main spawn <gen> owned by Player 11 (Dark Green))
  • Unit Group - Pick every unit in Temp_Group and do (Actions)
    • Loop - Actions
      • Unit - Order (Picked unit) to Attack-Move To Point
  • Custom script: call RemoveLocation(udg_Point)
  • Custom script: call DestroyGroup (udg_Temp_Group)
  • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top