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.

      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