Many simple triggers, or one complex one?

Wolf_Soldier

New Member
Reaction score
0
I have just made this trigger for my map. During the game, it starts to mess up, at the fourth check point, and they start to bunch up and block. An suggestions, or is the only way just to simplify the whole lot?

I would be grateful for the help :D Thx


Trigger:
  • Check Points
    • Events
      • Unit - A unit enters Zombie Spawn <gen>
      • Unit - A unit enters Check Point 1 <gen>
      • Unit - A unit enters Check Point 2 <gen>
      • Unit - A unit enters Check Point 3 <gen>
      • Unit - A unit enters Check Point 4 <gen>
      • Unit - A unit enters Check Point 5 <gen>
      • Unit - A unit enters Zombie Split <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 12 (Brown)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Entering unit)) Equal to Player 12 (Brown)
          • (Zombie Spawn <gen> contains (Position of (Entering unit))) Equal to True
        • Then - Actions
          • Set Move_Group_Spawn = (Units in Zombie Spawn <gen> owned by Player 12 (Brown))
          • Set Check_Point_1 = (Random point in Check Point 1 <gen>)
          • Unit Group - Pick every unit in Move_Group_Spawn and do (Unit - Order (Picked unit) to Move To Check_Point_1)
          • Custom script: call RemoveLocation (udg_Check_Point_1)
          • Custom script: call DestroyGroup (udg_Move_Group_Spawn)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Entering unit)) Equal to Player 12 (Brown)
              • (Check Point 1 <gen> contains (Position of (Entering unit))) Equal to True
            • Then - Actions
              • Set Move_Group_CP1 = (Units in Check Point 1 <gen> owned by Player 12 (Brown))
              • Set Check_Point_2 = (Random point in Check Point 2 <gen>)
              • Unit Group - Pick every unit in Move_Group_CP1 and do (Unit - Order (Picked unit) to Move To Check_Point_2)
              • Custom script: call RemoveLocation (udg_Check_Point_2)
              • Custom script: call DestroyGroup (udg_Move_Group_CP1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Entering unit)) Equal to Player 12 (Brown)
                  • (Check Point 2 <gen> contains (Position of (Entering unit))) Equal to True
                • Then - Actions
                  • Set Move_Group_CP2 = (Units in Check Point 2 <gen> owned by Player 12 (Brown))
                  • Set Check_Point_3 = (Random point in Check Point 3 <gen>)
                  • Unit Group - Pick every unit in Move_Group_CP2 and do (Unit - Order (Picked unit) to Move To Check_Point_3)
                  • Custom script: call RemoveLocation (udg_Check_Point_3)
                  • Custom script: call DestroyGroup (udg_Move_Group_CP2)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Entering unit)) Equal to Player 12 (Brown)
                      • (Check Point 3 <gen> contains (Position of (Entering unit))) Equal to True
                    • Then - Actions
                      • Set Move_Group_CP3 = (Units in Check Point 3 <gen> owned by Player 12 (Brown))
                      • Set Check_Point_4 = (Random point in Check Point 4 <gen>)
                      • Unit Group - Pick every unit in Move_Group_CP3 and do (Unit - Order (Picked unit) to Move To Check_Point_4)
                      • Custom script: call RemoveLocation (udg_Check_Point_4)
                      • Custom script: call DestroyGroup (udg_Move_Group_CP3)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Entering unit)) Equal to Player 12 (Brown)
                          • (Check Point 4 <gen> contains (Position of (Entering unit))) Equal to True
                        • Then - Actions
                          • Set Move_Group_CP4 = (Units in Check Point 4 <gen> owned by Player 12 (Brown))
                          • Set Check_Point_5 = (Random point in Check Point 5 <gen>)
                          • Unit Group - Pick every unit in Move_Group_CP4 and do (Unit - Order (Picked unit) to Move To Check_Point_5)
                          • Custom script: call RemoveLocation (udg_Check_Point_5)
                          • Custom script: call DestroyGroup (udg_Move_Group_CP4)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Owner of (Entering unit)) Equal to Player 12 (Brown)
                              • (Check Point 5 <gen> contains (Position of (Entering unit))) Equal to True
                            • Then - Actions
                              • Set Move_Group_CP5 = (Units in Check Point 5 <gen> owned by Player 12 (Brown))
                              • Set Zombie_Split_Point = (Center of Zombie Split <gen>)
                              • Unit Group - Pick every unit in Move_Group_CP5 and do (Unit - Order (Picked unit) to Move To Zombie_Split_Point)
                              • Custom script: call RemoveLocation (udg_Zombie_Split_Point)
                              • Custom script: call DestroyGroup (udg_Move_Group_CP5)
                            • Else - Actions
                              • Do nothing


Also ive got another query. How would you make a trigger, to order a unit which stops moving, on it's own to go find a random enemy unit, or return to a region where it could be ordered to do that.

E.g. Also i couldn't find how to fix a region leak.

Trigger:
  • Auto Enemy Find
    • Events
      • Unit - A unit owned by Player 12 (Brown) Is issued an order with no target
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Owner of (Ordered unit)) Equal to Player 12 (Brown)
          • (Issued order) Equal to (Order(stop))
    • Actions
      • Set Playable_Map_Area = (Playable map area)
      • Set Auto_Find_Group = (Units owned by Player 12 (Brown) matching ((Current order of (Ordered unit)) Equal to (Order(stop))))
      • Unit Group - Pick every unit in (Units in Playable_Map_Area matching ((Unit-type of (Picked unit)) Equal to Builder)) and do (Unit Group - Add (Picked unit) to Builder_Group)
      • Unit Group - Pick every unit in (Units in Playable_Map_Area matching ((Unit-type of (Picked unit)) Equal to (Unit-type of (Ordered unit)))) and do (Unit Group - Add (Picked unit) to Auto_Find_Group)
      • Unit Group - Pick every unit in Auto_Find_Group and do (Unit - Order (Picked unit) to Attack (Random unit from Builder_Group))
      • Custom script: call DestroyGroup (udg_Auto_Find_Group)
      • Custom script: call DestroyGroup (udg_Builder_Group)



It would be a great help if anyone could help me, Thx yet again.
 

Zurtrogx

Active Member
Reaction score
24
To remove region leaks you use:
call RemoveRect( udg_Your_Variable )
However, I don't think Playable map area causes any leaks since it is preset.

And, personally, I feel it would be better to have one complex trigger instead of heaps of simple ones.
And with that trigger you've got there, I believe it isn't necessary to have everything under the "Else" part. And, also, it is not necessary to have "Do Nothing" at the end.
 

Wolf_Soldier

New Member
Reaction score
0
:p hmmm thanks

When you say it's not necessary to have it under the else part, in what other way can i do it, so that each region is addressed in this trigger.

I think i know the problem with this trigger to. That is that once you start getting units entering 3 different regions at the same time, this trigger, cant handle that so it is never able to reach the actions for the fourth checkpoint.

That do nothing was just to make it look neat :p

To remove region leaks you use:
call RemoveRect( udg_Your_Variable )
However, I don't think Playable map area causes any leaks since it is preset.

And, personally, I feel it would be better to have one complex trigger instead of heaps of simple ones.
And with that trigger you've got there, I believe it isn't necessary to have everything under the "Else" part. And, also, it is not necessary to have "Do Nothing" at the end.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Yup no need to set the playable map area. And your leaking unit groups a lot.
 

Wolf_Soldier

New Member
Reaction score
0
? where are the leaking groups

Yup no need to set the playable map area. And your leaking unit groups a lot.

? i don't know where they are, if your talking about the random unit attack, i can't see where, as i delete the only two unit groups which are used in the trigger.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
All those unit group - pick every in bla bla. All of them leaks
 

Komaqtion

You can change this now in User CP.
Reaction score
469
They don't really leak, since he neither just uses it to add and remove units to it... That's actually better than destroying and creating new groups all the time :D
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
They do leak. The game will remember that group in the group to which he adds
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, meaning that if he only uses that group it'll only use 1 groups memory for the entire game, instead of creating and destroying units all the time :D
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
No no. Leaks must be destroyed all of them. Hence the word all
 

HydraRancher

Truth begins in lies
Reaction score
197
They don't really leak, since he neither just uses it to add and remove units to it... That's actually better than destroying and creating new groups all the time :D

Adding / Removing units does NOT leak, but picking every unit inside it does.
 

Wolf_Soldier

New Member
Reaction score
0
Leaks

Umm so how then do i get rid of that leak, with the picking all units function. By the way i have destroyed that big trigger, and broken it down into individual ones. The problem with that was that it was trying to be used at four times and as such wouldn't do what it was supposed to do for the unit group further down the trigger line. I.e. checkpoints 4,5 and 6.

Something interesting though, is that i have made a multiboard, which is only as big as the number of people playing, and only the people playing are shown on the multiboard. it also works when say Red and Teal are playing while Blue is Closed and as such is empty, all that will happen is that Teal will be below Red, instead of being below blue if blue was playing. All with GUI coding. :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top