Unit Enters Region

Smitty

Member
Reaction score
20
I have a trigger which uses the event 'a unit enters a region', and then displays a text message to all players. The problem is that if I enter the region, then leave and go back in, it shows the message the first time, but not any time subsequent to that. Anyone got any idea what gives? Thanks in advance :)
 

Yoww89

New Member
Reaction score
0
It should work just fine. See my attached example.

The problem must be in your trigger. If you could paste it here we'll see what's wrong.
 

Attachments

  • Region.w3x
    16.7 KB · Views: 126

vypur85

Hibernate
Reaction score
803
Because you create and destroyed 'All player'. The player group is not supposed to be destroyed because it doesn't leak. Just a guess.
 

Smitty

Member
Reaction score
20
Doesn't sound right. Here are the triggers... there's quite a lot. Sorry XD

Trigger:
  • Ants Nest Stand on Entry Region
    • Events
      • Unit - A unit enters Region 003 <gen>
      • Unit - A unit enters Region 004 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Triggering unit) to AntsNestMaybe
      • Player Group - Add (Owner of (Triggering unit)) to TempPlayerGroup
      • Game - Display to TempPlayerGroup the text: Do you wish to pay ...
      • Custom script: call DestroyForce(udg_TempPlayerGroup)


Trigger:
  • Ants Nest Leave Entry Region
    • Events
      • Unit - A unit leaves Region 004 <gen>
      • Unit - A unit leaves Region 003 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from AntsNestMaybe


Trigger:
  • Ants Nest Accepted
    • Events
    • Conditions
      • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is in AntsNestMaybe) Equal to True))) Equal to 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current gold) Greater than or equal to 250
        • Then - Actions
          • Set TempGroup = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
          • Set TempPoint = (Center of Region 005 <gen>)
          • Set TempPoint2 = (Center of Region 011 <gen>)
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to TempPoint, facing TempPoint2
              • Unit Group - Remove (Picked unit) from AntsNestMaybe
              • Unit Group - Add (Picked unit) to AntsNestRunners
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Triggering player) is in Sentinel) Equal to True
                • Then - Actions
                  • Unit Group - Add (Picked unit) to AntsNestRunnersSentinel
                • Else - Actions
                  • Unit Group - Add (Picked unit) to AntsNestRunnersScourge
          • Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - 250)
          • Camera - Pan camera for (Triggering player) to TempPoint over 0.00 seconds
          • Set AntsNestHeroCount = (Real((Number of units in AntsNestRunners)))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Custom script: call DestroyGroup (udg_TempGroup)
        • Else - Actions
          • Player Group - Add (Owner of (Triggering unit)) to TempPlayerGroup
          • Game - Display to TempPlayerGroup the text: You do not have eno...
          • Custom script: call DestroyForce(udg_TempPlayerGroup)


Trigger:
  • Ants Nest During Reset
    • Events
      • Unit - A unit enters Region 003 <gen>
      • Unit - A unit enters Region 004 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Player Group - Add (Owner of (Triggering unit)) to TempPlayerGroup
      • Game - Display to TempPlayerGroup the text: Please wait up to a...
      • Custom script: call DestroyForce(udg_TempPlayerGroup)


These are the triggers dealing directly with the regions. The events to the triggers containing chat strings are added at map initialization by another trigger.

Here are the other triggers, since they turn on/off various others. But I'm sure the necessary triggers are left ON at the end.

Trigger:
  • Ants Nest Setup
    • Events
      • Game - AntsNestHeroCount becomes Greater than 0.00
    • Conditions
    • Actions
      • Set TempPoint = (Center of Region 005 <gen>)
      • Set TempPoint2 = (Center of Region 011 <gen>)
      • Unit - Create 1 Queen Ant for Player 11 (Dark Green) at TempPoint2 facing TempPoint
      • AI - Ignore (Last created unit)'s guard position
      • Set QueenAnt = (Last created unit)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Trigger - Turn on Ants Nest AI <gen>
      • Trigger - Turn off (This trigger)


Trigger:
  • Ants Nest Hero Dies or Leaves
    • Events
      • Unit - A unit Dies
      • Unit - A unit leaves Region 009 <gen>
    • Conditions
      • ((Triggering unit) is in AntsNestRunners) Equal to True
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in AntsNestRunnersSentinel) Equal to True
        • Then - Actions
          • Unit Group - Remove (Triggering unit) from AntsNestRunnersSentinel
        • Else - Actions
          • Unit Group - Remove (Triggering unit) from AntsNestRunnersScourge
      • Unit Group - Remove (Triggering unit) from AntsNestRunners
      • Set AntsNestHeroCount = (Real((Number of units in AntsNestRunners)))
      • Set TempGroup = (Units in Region 009 <gen> owned by (Owner of (Triggering unit)))
      • Unit Group - Pick every unit in TempGroup and do (Unit - Kill (Picked unit))
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Unit Group - Pick every unit in Ants and do (Unit - Order (Picked unit) to Attack (Random unit from AntsNestRunners))


Trigger:
  • Ants Nest Reset
    • Events
      • Game - AntsNestHeroCount becomes Equal to 0.00
    • Conditions
    • Actions
      • Trigger - Turn off Ants Nest Victory <gen>
      • Game - Display to (All players) the text: Some bunch of poor ...
      • Trigger - Turn off Ants Nest Stand on Entry Region <gen>
      • Trigger - Turn on Ants Nest During Reset <gen>
      • Trigger - Turn off Ants Nest AI <gen>
      • Set QueenAnt = No unit
      • Set TempGroup = (Units in Region 009 <gen> matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Not equal to Player 11 (Dark Green))))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Wait 60.00 seconds
      • Set TempGroup = (Units in Region 009 <gen> matching ((((Matching unit) is alive) Equal to True) and ((Matching player) Equal to Player 11 (Dark Green))))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Trigger - Turn on Ants Nest AI <gen>
      • Trigger - Turn on Ants Nest Setup <gen>
      • Trigger - Turn on Ants Nest Stand on Entry Region <gen>
      • Trigger - Turn off Ants Nest During Reset <gen>
      • Trigger - Turn on Ants Nest Victory <gen>


Trigger:
  • Ants Nest Victory
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to QueenAnt
    • Actions
      • Trigger - Turn off Ants Nest Stand on Entry Region <gen>
      • Trigger - Turn off Ants Nest Reset <gen>
      • Trigger - Turn on Ants Nest During Reset <gen>
      • Game - Display to (All players) the text: A band of warriors ...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is in AntsNestRunnersSentinel) Equal to True
        • Then - Actions
          • Unit Group - Pick every unit in AntsNestRunnersSentinel and do (Actions)
            • Loop - Actions
              • Player - Set (Owner of (Picked unit)) Current gold to (((Owner of (Picked unit)) Current gold) + 100)
        • Else - Actions
          • Unit Group - Pick every unit in AntsNestRunnersScourge and do (Actions)
            • Loop - Actions
              • Player - Set (Owner of (Picked unit)) Current gold to (((Owner of (Picked unit)) Current gold) + 100)
      • Wait 2.00 seconds
      • Set TempPoint = (Center of Region 003 <gen>)
      • Unit Group - Pick every unit in AntsNestRunnersSentinel and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set TempPoint = (Center of Region 004 <gen>)
      • Unit Group - Pick every unit in AntsNestRunnersScourge and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Unit Group - Remove all units of AntsNestRunners from AntsNestRunners
      • Set QueenAnt = No unit
      • Set TempGroup = (Units in Region 009 <gen> matching ((((Matching unit) is alive) Equal to True) and ((Matching player) Not equal to Player 11 (Dark Green))))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Wait 60.00 seconds
      • Set TempGroup = (Units in Region 009 <gen> matching ((((Matching unit) is alive) Equal to True) and ((Matching player) Equal to Player 11 (Dark Green))))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Trigger - Turn off Ants Nest During Reset <gen>
      • Trigger - Turn on Ants Nest Stand on Entry Region <gen>
      • Trigger - Turn on Ants Nest Reset <gen>


there are others referring to specifics regarding the area, but they don't turn any triggers on or off. So, anyone able to see the problem? :( Thanks for the help ^^

EDIT: I know I destroyed TempGroup twice. Ignore it :p
 

Smitty

Member
Reaction score
20
I know double post, but;

To explain, just in case, what I want is for the trigger 'ants nest stand on entry region' to be on as standard. Ants nest during reset (off at initialisation) should be turned on during Ants Nest victory or reset, whilst stand on entry region is off. But this doesn't seem to be the case. Even just having the first trigger enabled and not the rest, it only occurs once.
 

vypur85

Hibernate
Reaction score
803
You shouldn't add Players into group and destroy them...
Try this:
Code:
    Set TempPlayerGroup = ......
    Game - Display to TempPlayerGroup the text: Please wait up to a...
    Custom script: call DestroyForce(udg_TempPlayerGroup)
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
It is, the problem with adding players/units to player groups / unit groups is that the groups have to exist beforehand in order to work.
if you destroy a group with custom text to prevent leaks you really destroy that group. You cannot add anything to the group afterwards.
You would need to create a new group first by setting the variable to a group.
 
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
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top