• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] strange issue

Status
Not open for further replies.
Level 10
Joined
Sep 29, 2006
Messages
447
ok so i made these trigger so that when a unit enter a region a building will start constructing. for some reason only the trigger for the middle works and i dont know why can anyone figure it out?

  • mid point init
    • Events
      • Unit - A unit enters Region 022 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • MidBoolean Equal to False
    • Actions
      • Set MidBoolean = True
      • Set TempPoint = (Center of Region 022 <gen>)
      • Set TempPoint2 = ((Center of Region 022 <gen>) offset by 200.00 towards ((Facing of (Triggering unit)) - 180.00) degrees)
      • Unit - Move (Triggering unit) instantly to TempPoint2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
        • Then - Actions
          • Unit - Create 1 dummy unit (builder) for Player 11 (Dark Green) at TempPoint facing Default building facing degrees
          • Unit - Add a 25.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to build a Control Tower at TempPoint
        • Else - Actions
          • Unit - Create 1 dummy unit (builder) for Player 12 (Brown) at TempPoint facing Default building facing degrees
          • Unit - Add a 25.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to build a Control Tower at TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
  • bottom point init
    • Events
      • Unit - A unit enters Region 023 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • BotBoolean Equal to False
    • Actions
      • Set BotBoolean = True
      • Set TempPoint = (Center of Region 023 <gen>)
      • Set TempPoint2 = ((Center of Region 023 <gen>) offset by 200.00 towards ((Facing of (Triggering unit)) - 180.00) degrees)
      • Unit - Move (Triggering unit) instantly to TempPoint2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
        • Then - Actions
          • Unit - Create 1 dummy unit (builder) for Player 11 (Dark Green) at TempPoint facing Default building facing degrees
          • Unit - Add a 25.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to build a Control Tower at TempPoint
        • Else - Actions
          • Unit - Create 1 dummy unit (builder) for Player 12 (Brown) at TempPoint facing Default building facing degrees
          • Unit - Add a 25.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to build a Control Tower at TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
  • top point init
    • Events
      • Unit - A unit enters Region 024 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • TopBoolean Equal to False
    • Actions
      • Set TopBoolean = True
      • Set TempPoint = (Center of Region 024 <gen>)
      • Set TempPoint2 = ((Center of Region 024 <gen>) offset by 200.00 towards ((Facing of (Triggering unit)) - 180.00) degrees)
      • Unit - Move (Triggering unit) instantly to TempPoint2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
        • Then - Actions
          • Unit - Create 1 dummy unit (builder) for Player 11 (Dark Green) at TempPoint facing Default building facing degrees
          • Unit - Add a 25.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to build a Control Tower at TempPoint
        • Else - Actions
          • Unit - Create 1 dummy unit (builder) for Player 12 (Brown) at TempPoint facing Default building facing degrees
          • Unit - Add a 25.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to build a Control Tower at TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)


does anybody know why only the first trigger is working and not the rest? all of the regions and such are correct because the unit is moved instantly, but the tower is never built

==EDIT==

I just did some testing and it only works if i create the builder for the owner of the triggering unit and i have no idea why. does anyone have any idea?
 
Last edited:
Level 17
Joined
Apr 27, 2008
Messages
2,455
I think i got it.
A 200 offset is a short distance, maybe the collision of the build is too big.
If you move the unit and create a dummy unit for the owner, then the triggering unit will move if the build can't be done, but if it's not the same player the order fails.
 
Level 10
Joined
Sep 29, 2006
Messages
447
the map is in my signature, just open it and look at the trigger folder that says "control points"

then youll notice that there are 4 disabled triggers for each of the three control points, the one that says "mid init" or something along those lines is what i need to get working, the others work. but make sure you disable the enabled ones before testing otherwise youll run into problems. so for an example you get

Enabled
Disabled
Disabled
Disabled
Enabled

you have to change it to

Disabled
Enabled
Enabled
Enabled
Enabled

I may have added an extra one in by accident
 
Level 10
Joined
Sep 29, 2006
Messages
447
i thought about using a neutral player and then changing ownership when the tower completed but then units would not auto acquire the tower to destroy it before its built. and changing ownership during the process doesnt work because then the dummy unit stops building
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
  • mid point init
    • Evénements
      • Unité - A unit enters Region 022 <gen>
    • Conditions
      • ((Entering unit) is Un héros) Egal à TRUE
      • MidBoolean Egal à FALSE
    • Actions
      • Set MidBoolean = TRUE
      • Set TempPoint = (Center of Region 022 <gen>)
      • Set TempPoint2 = ((Center of Region 022 <gen>) offset by 200.00 towards ((Facing of (Entering unit)) - 180.00) degrees)
      • Unité - Move (Triggering unit) instantly to TempPoint2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ((Entering unit) belongs to an ally of Joueur 11 (Vert foncé)) Egal à TRUE
        • Alors - Actions
          • Unité - Create 1 dummy unit (builder) for Neutre Passif at TempPoint facing Orientation bâtiment par défaut degrees
          • Unité - Set the custom value of (Last created unit) to 1
          • Unité - Order (Last created unit) to build a Control Tower at (TempPoint offset by (500.00, 500.00))
          • Unité - Add a 25.00 second Générique expiration timer to (Last created unit)
        • Sinon - Actions
          • Unité - Create 1 dummy unit (builder) for Neutre Passif at TempPoint facing Orientation bâtiment par défaut degrees
          • Unité - Set the custom value of (Last created unit) to 2
          • Unité - Order (Last created unit) to build a Control Tower at TempPoint
          • Unité - Add a 25.00 second Générique expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
  • mid point change owner
    • Evénements
      • Unité - A unit Finit la construction
    • Conditions
      • (Constructed structure) Egal à MidControlTower
      • MidBoolean Egal à TRUE
    • Actions
      • Set TempPoint = (Position of (Constructed structure))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (Custom value of MidControlTower) Equal to 1
        • Alors - Actions
          • Set MidDGBoolean = TRUE
          • Unité - Change ownership of Cercle de puissance (grand) 0003 <gen> to Joueur 11 (Vert foncé) and Changer couleur
          • Unité - Change ownership of Factory 0017 <gen> to Joueur 11 (Vert foncé) and Changer couleur
          • Unité - Change ownership of Factory 0015 <gen> to Joueur 11 (Vert foncé) and Changer couleur
          • Effet spécial - Create a special effect at TempPoint using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
          • Effet spécial - Destroy (Last created special effect)
        • Sinon - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • (Custom value of MidControlTower) Equal to 2
            • Alors - Actions
              • Set MidBrownBoolean = TRUE
              • Unité - Change ownership of Cercle de puissance (grand) 0003 <gen> to Joueur 12 (Marron) and Changer couleur
              • Unité - Change ownership of Factory 0015 <gen> to Joueur 12 (Marron) and Changer couleur
              • Unité - Change ownership of Factory 0017 <gen> to Joueur 12 (Marron) and Changer couleur
              • Effet spécial - Create a special effect at TempPoint using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
              • Effet spécial - Destroy (Last created special effect)
            • Sinon - Actions
      • Custom script: call RemoveLocation(udg_TempPoint)
 
Level 10
Joined
Sep 29, 2006
Messages
447
thanks for the help but i know i can change the ownership after the tower has completed. i can do that but then i want unit to auto acquire the tower while its being built and that cant happen since its being built by neutral passive. i need to figure out why it doesnt work for the computer controlled characters, i feel like theres a conflicting trigger somewhere but im not sure. + rep for all the help man
 
Level 10
Joined
Sep 29, 2006
Messages
447
no, there's only three neutral players, and im already using neutral passive and neutral hostile in the map, so that levaes only neutral victim and it will be a problem to constantly switch that alliance, especially if the two teams are trying to capture a control point at the same time. there has to be another trigger in there that's conflicting with the one that builds units, i need to find it.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
no, there's only three neutral players, and im already using neutral passive and neutral hostile in the map, so that levaes only neutral victim and it will be a problem to constantly switch that alliance, especially if the two teams are trying to capture a control point at the same time. there has to be another trigger in there that's conflicting with the one that builds units, i need to find it.

There are 4 neutral.

JASS:
    call DisplayTextToForce( GetPlayersAll(), GetPlayerName(Player(PLAYER_NEUTRAL_AGGRESSIVE)) )
    call DisplayTextToForce( GetPlayersAll(), GetPlayerName(Player(bj_PLAYER_NEUTRAL_VICTIM)) )
    call DisplayTextToForce( GetPlayersAll(), GetPlayerName(Player(bj_PLAYER_NEUTRAL_EXTRA)) )
    call DisplayTextToForce( GetPlayersAll(), GetPlayerName(Player(PLAYER_NEUTRAL_PASSIVE)) )

And i had ever heard about other issues with using a computer slot.
Maybe you can fix then but if you don't need it , just why ?
 
Status
Not open for further replies.
Top