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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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