Triggers don't seem to work. . .

Curuinor

New Member
Reaction score
7
I have four triggers to automatically build outposts in my map. All variables going in are supplied. Why don't these work?

Code:
Control Shifted
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 10 (Light Blue)
            Then - Actions
                Set temppoint = (Center of Fortressspawn <gen>)
                Unit - Create 1 Nerghuzian for Player 10 (Light Blue) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Dragon Pool at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Dragon Pool at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Nerghuzian Farm at temppoint2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 11 (Dark Green)
                enemyunitupgradetrue Equal to False
            Then - Actions
                Set temppoint = (Center of AllianceSpawn <gen>)
                Unit - Create 1 Peasant for Player 12 (Brown) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Guard Tower at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                If ((Random integer number between 1 and 2) Equal to 1) then do (Unit - Order tempunit to build a Cannon Tower at temppoint2) else do (Unit - Order tempunit to build a Arcane Tower at temppoint2)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Farm at temppoint2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 11 (Dark Green)
                enemyunitupgradetrue Equal to True
            Then - Actions
                Set temppoint = (Center of AllianceSpawn <gen>)
                Unit - Create 1 Wisp for Player 12 (Brown) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Moon Well at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Ancient Protector at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Moon Well at temppoint2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 12 (Brown)
                enemyunitupgradetrue Equal to False
            Then - Actions
                Set temppoint = (Center of HordeSpawn <gen>)
                Unit - Create 1 Acolyte for Player 12 (Brown) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Ziggurat at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Spirit Tower at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Spirit Tower at temppoint2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 12 (Brown)
                enemyunitupgradetrue Equal to True
            Then - Actions
                Set temppoint = (Center of HordeSpawn <gen>)
                Unit - Create 1 Peon for Player 12 (Brown) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Orc Burrow at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Watch Tower at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Watch Tower at temppoint2
            Else - Actions

Code:
Control Build Point Check
    Events
    Conditions
    Actions
        Set temppoint2 = (Random point in tempreg)
        Set tempreg = (Region centered at temppoint2 with size (60.00, 60.00))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Random destructible in tempreg) Not equal to No destructible
                        (Terrain pathing at temppoint2 of type Buildability is off) Equal to True
            Then - Actions
                Trigger - Run (This trigger) (ignoring conditions)
            Else - Actions
                Set buildpointcheckdone = True

Also, my WE has a graphical bug that's quite annoying. Checkboxes and radio buttons display as plain white or black boxes that don't change. I found that restarting my computer is a good remedy, but is there a permanent solution?
 

Curuinor

New Member
Reaction score
7
I trigger them manually in the check trigger. I'm not that stupid. . .

Check trigger, for reference:

Code:
Control Disputed
    Events
        Unit - A unit Dies
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Dying unit)) Equal to Guard Tower
                (Unit-type of (Dying unit)) Equal to Cannon Tower
                (Unit-type of (Dying unit)) Equal to Arcane Tower
                (Unit-type of (Dying unit)) Equal to Farm
                (Unit-type of (Dying unit)) Equal to Orc Burrow
                (Unit-type of (Dying unit)) Equal to Watch Tower
                (Unit-type of (Dying unit)) Equal to Ziggurat
                (Unit-type of (Dying unit)) Equal to Spirit Tower
                (Unit-type of (Dying unit)) Equal to Nerubian Tower
                (Unit-type of (Dying unit)) Equal to Moon Well
                (Unit-type of (Dying unit)) Equal to Ancient Protector
                (Unit-type of (Dying unit)) Equal to Nerghuzian Farm
                (Unit-type of (Dying unit)) Equal to Nerghuzian Farm
    Actions
        Set tempunit = (Killing unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempunit Equal to No unit
            Then - Actions
                Set tempplayer = (Owner of (Dying unit))
                Set temppoint = (Position of (Dying unit))
                Special Effect - Create a special effect at temppoint using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Unit - Create 1 (Unit-type of (Dying unit)) for tempplayer at temppoint facing Default building facing degrees
                Custom script:   call RemoveLocation(udg_temppoint)
                Custom script:   call DestroyPlayer(udg_tempplayer)
                Skip remaining actions
            Else - Actions
        Trigger - Run Control Dispute Check <gen> (checking conditions)

Code:
Control Dispute Check
    Events
    Conditions
    Actions
        For each (Integer A) from 1 to 7, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (humancontrolreg[(Integer A)] contains tempunit) Equal to True
                        (Number of units in (Units in humancontrolreg[(Integer A)] matching (((Matching unit) is A structure) Equal to True))) Equal to 0
                    Then - Actions
                        Set tempreg = humancontrolreg[(Integer A)]
                        Set tempplayer = (Owner of tempunit)
                        Trigger - Run Control Shifted <gen> (ignoring conditions)
                        Skip remaining actions
                    Else - Actions
        For each (Integer A) from 1 to 7, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (udcontrolreg[(Integer A)] contains tempunit) Equal to True
                        (Number of units in (Units in udcontrolreg[(Integer A)] matching (((Matching unit) is A structure) Equal to True))) Equal to 0
                    Then - Actions
                        Set tempreg = udcontrolreg[(Integer A)]
                        Set tempplayer = (Owner of tempunit)
                        Trigger - Run Control Shifted <gen> (ignoring conditions)
                    Else - Actions
 

SFilip

Gone but not forgotten
Reaction score
634
1. What's supposed to happen?
2. What exactly happens ATM?
 

Curuinor

New Member
Reaction score
7
Changed, still doesn't work. It occasionally spawns the builder when the buildings are killed, but the builder doesn't get off his fat ass to build. Past post:

Actually, I just realized that tempplayer shouldn't be set to owner of killing unit, since I haven't got any settings for the actual players(players 10-12 are comps)

In case if this solution doesn't work,
The third trigger executes the string of triggers, setting tempunit and temppoint in the way. Then, I find out which of 14 regions the dying unit was in. This works because no regions overlap. I found out 2nd trigger worked by debugging, so that isn't the problem. The first I also have a question with.

If I overlap build orders like that, will they queue? If so, I have to put wait actions on those. . .
 

Sooda

Diversity enchants
Reaction score
318
I have four triggers to automatically build outposts in my map. All variables going in are supplied. Why don't these work?

Code:
Control Shifted
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 10 (Light Blue)
            Then - Actions
                Set temppoint = (Center of Fortressspawn <gen>)
                Unit - Create 1 Nerghuzian for Player 10 (Light Blue) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Dragon Pool at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Dragon Pool at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Nerghuzian Farm at temppoint2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 11 (Dark Green)
                enemyunitupgradetrue Equal to False
            Then - Actions
                Set temppoint = (Center of AllianceSpawn <gen>)
                Unit - Create 1 Peasant for Player 12 (Brown) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Guard Tower at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                If ((Random integer number between 1 and 2) Equal to 1) then do (Unit - Order tempunit to build a Cannon Tower at temppoint2) else do (Unit - Order tempunit to build a Arcane Tower at temppoint2)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Farm at temppoint2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 11 (Dark Green)
                enemyunitupgradetrue Equal to True
            Then - Actions
                Set temppoint = (Center of AllianceSpawn <gen>)
                Unit - Create 1 Wisp for Player 12 (Brown) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Moon Well at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Ancient Protector at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Moon Well at temppoint2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 12 (Brown)
                enemyunitupgradetrue Equal to False
            Then - Actions
                Set temppoint = (Center of HordeSpawn <gen>)
                Unit - Create 1 Acolyte for Player 12 (Brown) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Ziggurat at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Spirit Tower at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Spirit Tower at temppoint2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                tempplayer Equal to Player 12 (Brown)
                enemyunitupgradetrue Equal to True
            Then - Actions
                Set temppoint = (Center of HordeSpawn <gen>)
                Unit - Create 1 Peon for Player 12 (Brown) at temppoint facing Default building facing degrees
                Unit - Make (Last created unit) Invulnerable
                Set tempunit = (Last created unit)
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Orc Burrow at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Watch Tower at temppoint2
                Trigger - Run Control Build Point Check <gen> (ignoring conditions)
                Wait until (buildpointcheckdone Equal to True), checking every 0.50 seconds
                Set buildpointcheckdone = False
                Unit - Order tempunit to build a Watch Tower at temppoint2
            Else - Actions

Code:
Control Build Point Check
    Events
    Conditions
    Actions
        Set temppoint2 = (Random point in tempreg)
        Set tempreg = (Region centered at temppoint2 with size (60.00, 60.00))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Random destructible in tempreg) Not equal to No destructible
                        (Terrain pathing at temppoint2 of type Buildability is off) Equal to True
            Then - Actions
                Trigger - Run (This trigger) (ignoring conditions)
            Else - Actions
                Set buildpointcheckdone = True

Also, my WE has a graphical bug that's quite annoying. Checkboxes and radio buttons display as plain white or black boxes that don't change. I found that restarting my computer is a good remedy, but is there a permanent solution?

Just posting all of your triggers and asking what' s wrong dosn' t help much. Looking through them all is real pain. YOu know it isn' t MUI so it will mess up badly when two units activate that trigger at same time.
Maybe remove skip all actions from first trigger. When killing unit equal to no unit ? Does that mean unit has to be killed with ability ? But I doubt in it, there is always killing unit. So that action is useless. Run trigger checking conditions when there aren' t any, ood. Just run the without condition check or you have added new conditions somehow to your triggers ? Explain what you want to achive, creating mess of triggers isn' t wise when you got TFT. Write what you want and mabe we can shorten it up.
 

Curuinor

New Member
Reaction score
7
I want a builder to spawn when the last building in a region is killed and then builld a new base over there.
 
S

Sunny_D

Guest
you should try to work with game messages to find out where a trigger stops working. that helps in most cases to find the mistake.

i.e: "Trigger X fired", "Check startet", "Check completed" etc...
 
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
  • 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

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top