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

[Trigger] unit group moving problem

Status
Not open for further replies.
Level 1
Joined
Mar 9, 2009
Messages
2
What I want to do is move the units after they are spawned from point A to point B. Now I'm not great with triggers...but..I've tried a few ways of trying to move them, but the unit group only moves the first time and then after that they just keep slowly spawning and refusing to move. It may be a problem with a variable not destroyed or cleared some where else but I'm pretty sure I got them all that would need it. Would really like any help if possible. Can also attach the map if needed.

Trigger that turns on the trigger with the problem.
  • Farm take over
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Villager (Male 2) 0192 <gen> is alive) Equal to False
          • (Villager (Male) 0180 <gen> is alive) Equal to False
          • (Villager (Male) 0179 <gen> is alive) Equal to False
          • (Villager (Male) 0181 <gen> is alive) Equal to False
          • (Villager (Male) 0182 <gen> is alive) Equal to False
    • Actions
      • Set region1 = Farm area <gen>
      • Environment - Create Blight for Player 11 (Dark Green) across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 2 (Blue) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 4 (Purple) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 5 (Yellow) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 6 (Orange) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 8 (Pink) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 9 (Gray) emitting Visibility across region1
      • Visibility - Create an initially Enabled visibility modifier for Player 10 (Light Blue) emitting Visibility across region1
      • Trigger - Turn on Shadow Spawn plus <gen>
      • Trigger - Turn on Farm take over repeat <gen>
      • Trigger - Run Farm take over repeat <gen> (checking conditions)
      • Custom script: call RemoveRect(udg_region1)
      • Trigger - Turn off (This trigger)

The trigger that won't work properly. Now the first actions are only different from the others because I was just trying a different way of moving them. Didn't make a difference.
  • Farm take over repeat
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
      • (Dark Portal 0170 <gen> is alive) Equal to True
    • Actions
      • Set Region[1] = Spawn point <gen>
      • Set Region[2] = 3rd blight expansion <gen>
      • Set Region[3] = 3rd takeover1 <gen>
      • Set Region[4] = sage death <gen>
      • Set Region[5] = top right village <gen>
      • Set Region[6] = Mayor House Front <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Region[1] owned by Player 11 (Dark Green))) Less than or equal to 35
          • (Blacksmith 0172 <gen> is alive) Equal to True
          • (Gate (Horizontal) 4612 <gen> is alive) Equal to True
          • (Master Sage 0177 <gen> is alive) Equal to True
        • Then - Actions
          • Unit - Create (2 + Int_Shadow_Spawn) Shadow Spawn for Player 11 (Dark Green) at (Position of Dark Portal 0170 <gen>) facing Default building facing degrees
          • Set Unit_Group_Array[1] = (Units in Region[1] owned by Player 11 (Dark Green))
          • Unit Group - Pick every unit in Unit_Group_Array[1] and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to Attack-Move To (Center of Region[2])
          • Unit Group - Remove all units from Unit_Group_Array[1]
          • Custom script: call RemoveRect(udg_Region[1])
          • Custom script: call RemoveRect(udg_Region[2])
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units in Region[1] owned by Player 11 (Dark Green))) Less than or equal to 35
              • (Gate (Horizontal) 4612 <gen> is alive) Equal to True
              • (Blacksmith 0172 <gen> is alive) Equal to False
              • (Master Sage 0177 <gen> is alive) Equal to True
            • Then - Actions
              • Unit - Create (4 + Int_Shadow_Spawn) Shadow Spawn for Player 11 (Dark Green) at (Position of Dark Portal 0170 <gen>) facing Default building facing degrees
              • Set Unit_Group_Array[1] = (Units in Region[1] owned by Player 11 (Dark Green))
              • Unit Group - Order Unit_Group_Array[1] to Attack-Move To (Center of Region[5])
              • Unit Group - Remove all units from Unit_Group_Array[1]
              • Custom script: call RemoveRect(udg_Region[1])
              • Custom script: call RemoveRect(udg_Region[5])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units in Region[1] owned by Player 11 (Dark Green))) Less than or equal to 35
                  • (Gate (Horizontal) 4612 <gen> is alive) Equal to True
                  • (Blacksmith 0172 <gen> is alive) Equal to False
                  • (Blacksmith 0172 <gen> is alive) Equal to False
                • Then - Actions
                  • Unit - Create (4 + Int_Shadow_Spawn) Shadow Spawn for Player 11 (Dark Green) at (Position of Dark Portal 0170 <gen>) facing Default building facing degrees
                  • Set Unit_Group_Array[1] = (Units in Region[1] owned by Player 11 (Dark Green))
                  • Unit Group - Order Unit_Group_Array[1] to Attack-Move To (Center of Region[6])
                  • Unit Group - Remove all units from Unit_Group_Array[1]
                  • Custom script: call RemoveRect(udg_Region[1])
                  • Custom script: call RemoveRect(udg_Region[6])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units in Region[1] owned by Player 11 (Dark Green))) Less than or equal to 35
                      • (Gate (Horizontal) 4612 <gen> is alive) Equal to False
                      • (Blacksmith 0172 <gen> is alive) Equal to False
                      • (Blacksmith 0172 <gen> is alive) Equal to False
                    • Then - Actions
                      • Unit - Create (4 + Int_Shadow_Spawn) Shadow Spawn for Player 11 (Dark Green) at (Position of Dark Portal 0170 <gen>) facing Default building facing degrees
                      • Set Unit_Group_Array[1] = (Units in Region[1] owned by Player 11 (Dark Green))
                      • Wait 2.00 seconds
                      • Unit Group - Order Unit_Group_Array[1] to Attack High Priest 0173 <gen>
                      • Unit Group - Remove all units from Unit_Group_Array[1]
                      • Custom script: call RemoveRect(udg_Region[1])
                    • Else - Actions
 
Last edited:
Level 17
Joined
Jun 17, 2010
Messages
2,275
Delete the conditions, and the leak fixes, and anything that isn't absolutely nessesary, and see if u can get them to move, if u can then u know the problem. I cant see from first examine whats wrong, but thats what id do, isolate the problem by making it work first.

Edit: I see whats wrong, you create the units at the position of the portal (which leaks) but you should create the units in Region[1] because thats where your unit group variable picks units.
 
Level 1
Joined
Mar 9, 2009
Messages
2
Now I know the portal leaks I did it on purpose cause when I chose Region[1] it would spawn them right the first time and move them. Then after that it would spawn them in a completely different location from then on and well...even if they moved it wouldn't matter but they still don't.

Which I mean the location isn't even listed as a variable in these triggers. It is in another trigger but it's not even turned on at the time this one is.(Turned on way after this one). Also the position of the portal is in Region[1] or the unit/building is I mean.

This is the most screwy map I've ever created and I mean as far as triggers being so odd...Example, 100% of the units hp x 220= like 60 or so percent...variables or no variables it does that..But I worked around that problem.


Uh..I'm not entirely sure why and I guess maybe I should of tried that idea before posting..but just clearing the leak fixes in the trigger fixed it. Now they move and spawn at the right location every time. Thank you so much for the help. I finally put leak fixes in one of my maps(don't make maps often..) and it comes back to bite me..
 
Last edited:
Status
Not open for further replies.
Top