"Capturing" a region. Need help!

B0ndo

New Member
Reaction score
4
Hi folks

I'd like to know if it's possible (and if, how) to make a trigger that will display a text to all players sayning "Team 1 has captured the middle" (example). If a certain region no longer contains a unit from team 2.

But as soon a unit from team 2 enters the region when no units from team 1 is currently within the region it will display a text saying "Team 2 has captured the middle" (example)

I hope someone gets my point and can help me out here :)

Cheers in advance
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Trigger:
  • Capture Region
    • Events
      • Unit - A unit leaves Region 1 <gen>
    • Conditions
    • Actions
      • Set TempUnitGroup = (Units in Region 1<gen> matching ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempUnitGroup) Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: Team 2 has captured Region 1!
        • Else - Actions
          • Set TempUnitGroup = (Units in Region 1 <gen> matching ((((Matching unit) belongs to an ally of Player 7 (Green)) Equal to True) and (((Matching unit) is alive) Equal to True)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempUnitGroup) Equal to 0
            • Then - Actions
              • Game - Display to (All players) the text: Team 1 has captured Region 1!
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempUnitGroup)


Are you looking for something like this? That is, assuming Player 1 is the first player of Team 1 and Player 7 is the first player of Team 2.
 

B0ndo

New Member
Reaction score
4
Yup that should in theory work, I'll report back to you later when I've tested it, cheers :)
 

B0ndo

New Member
Reaction score
4
When saying "Belongs to an ally of Player 1 (Red) does that include red himself? Or only his allies?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
It checks if the unit is considered an ally by Red. This includes his own units.
 

B0ndo

New Member
Reaction score
4
Well the trigger works, but it needs some tweaking, because everytime a unit of team 1 leaves the region it sends the text. So if no units from team 2 is currently in the region and 10 units from team 1 leaves the region at the same time it displays the text 10 times.

I guess I have to chance the event to... Unit - A unit dies perhabs?
 

B0ndo

New Member
Reaction score
4
No wait I'll make a variable and another condition and see if that works out. Brb.
 

B0ndo

New Member
Reaction score
4
This is my code, i added another variable and thought that might fix it, but it doesn't, now it doesn't even send any game txts.

I need help here!

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit leaves Center Reg <gen>
    • Conditions
    • Actions
      • Set TempUnitGroup = (Units in Center Reg <gen> matching ((((Matching unit) belongs to an ally of Player 11 (Dark Green)) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempUnitGroup) Equal to 0
          • CaptureChecker Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: Team 1 has captured...
          • Set CaptureChecker = 1
        • Else - Actions
          • Set TempUnitGroup = (Units in Center Reg <gen> matching ((((Matching unit) belongs to an ally of Player 12 (Brown)) Equal to True) and (((Matching unit) is alive) Equal to True)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempUnitGroup) Equal to 0
              • CaptureChecker Equal to 1
            • Then - Actions
              • Game - Display to (All players) the text: Team 2 has captured...
              • Set CaptureChecker = 0
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
What you want is to Turn Off this trigger whenever the region is captured, then have a separate trigger turned on at the same time. The other trigger will run whenever the region is (uncaptured, I guess?), turn itself off and turn this one on again.
 

B0ndo

New Member
Reaction score
4
So shall i seperate the trigger into 2 triggers 1 for each team and turn the trigger off after it has displayed the text? But i don't see how that'll help so I might need a demonstration if you got time? :)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I wish I could. But exams around the corner, and a bunch of projects to rush. Basically you want this trigger to turn itself off whenever there are no units of a certain team in it. You also want another trigger that runs whenever a unit leaves the region, and if there are no more units inside, then turn this trigger back on.
 

B0ndo

New Member
Reaction score
4
Alright np mate, good luck with those projects and exams, I'll try myself, and thanks for your help! +rep
 

NeuroToxin

New Member
Reaction score
46
Just a quick thing B0ndo.
Don't triple or double post, both of which you did above.
Just edit your most recent reply.
 

B0ndo

New Member
Reaction score
4
Oh okay, I appoligize.

OFF-TOPIC: Is that because of the massive traffic on thehelper.net? To like keep the posts down to the minimum?

You don't have to answer btw :)
 

NeuroToxin

New Member
Reaction score
46
No, it's mainly to stop users from "bumping" their thread, and that, but at the same time, you can't post three times, as it keeps pushing your thread up to the top of the unread threads.
 

educator

New Member
Reaction score
9
umm, maybe instead of on unit entry, how bout a "capture" abilty, (prob instant cast) that if cast by a unit in the region does the stuffs u want. just suggesting this coz iv had triggers bug out on me with "unit enters region"
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top