• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Create Cursed Gold Mine Trigger

Status
Not open for further replies.
Level 19
Joined
Oct 7, 2014
Messages
2,209
Hello Hive! I'm making an altered melee map where when I select a button in the dialog, for example the Burning Legion, it will create the structures for that race. I first created the Undead race structures so that it will have a Hunted Gold Mine, then after that when I tried to test it it created the Cursed Gold Mine(for the Burning Legion) then created another neutral gold mine. Then I tried to make other triggers for it to work but I still failed. :vw_sad: This last trigger well it doesn't change the gold mine. Really need help here guys.


  • Race Selection Pick 2
    • Events
      • Dialog - A dialog button is clicked for Race_Dialog_2
    • Conditions
    • Actions
      • Set Temp_Integer_1 = (Player number of (Triggering player))
      • Set Temp_Location = ((Triggering player) start location)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Race_Dialog_Buttons_2[0]
        • Then - Actions
          • Melee Game - Create Undead starting units for (Triggering player) at Temp_Location (Include Heroes)
          • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Necropolis
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Hall of Terror using The new unit's default life and mana
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Haunted Gold Mine
                • Then - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Unit Group - Pick every unit in (Units within 1000.00 of ((Picked player) start location)) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Gold Mine
                        • Then - Actions
                          • Unit - Create 1 Cursed Gold Mine for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
                        • Else - Actions
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Acolyte
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Cultist using The new unit's default life and mana
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Ghoul
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Imp using The new unit's default life and mana
                • Else - Actions
        • Else - Actions
 
Level 12
Joined
Oct 16, 2010
Messages
680
  • Unit - Remove (Picked unit) from the game
  • Unit Group - Pick every unit in (Units within 1000.00 of ((Picked player) start location)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Picked unit)) Equal to Gold Mine
        • Then - Actions
          • Unit - Create 1 Cursed Gold Mine for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
        • Else - Actions
(picked player)start loc should be Temp_location
(picked player) should be (owner of (picked unit))
and u should remove the gold mine before making a new on top of it.

like this
  • Unit Group - Pick every unit in (Units within 1000.00 of Temp_Location and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Picked unit)) Equal to Gold Mine
        • Then - Actions
          • Set Temp_u = (picked unit)
          • Set Temp_Point = position of Temp_u
          • Set Temp_player = owner of Temp_u
          • Unit - Remove Temp_u from the game
          • Unit - Create 1 Cursed Gold Mine for Temp_player at Temp_Point facing Default building facing degrees
        • Else - Actions
EDIT: also this part should be out of the other loop
  • Race Selection Pick 2
    • Events
      • Dialog - A dialog button is clicked for Race_Dialog_2
    • Conditions
    • Actions
      • Set Temp_Integer_1 = (Player number of (Triggering player))
      • Set Temp_Location = ((Triggering player) start location)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Race_Dialog_Buttons_2[0]
        • Then - Actions
          • Melee Game - Create Undead starting units for (Triggering player) at Temp_Location (Include Heroes)
          • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of (Picked unit)) Equal to Necropolis
              • Then - Actions
                • Unit - Replace (Picked unit) with a Hall of Terror using The new unit's default life and mana
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of (Picked unit)) Equal to Acolyte
              • Then - Actions
                • Unit - Replace (Picked unit) with a Cultist using The new unit's default life and mana
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of (Picked unit)) Equal to Ghoul
              • Then - Actions
                • Unit - Replace (Picked unit) with a Imp using The new unit's default life and mana
              • Else - Actions
          • Unit Group - Pick every unit in (Units within 1000.00 of Temp_Location and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Gold Mine
                • Then - Actions
                  • Set Temp_u = (picked unit)
                  • Set Temp_Point = position of Temp_u
                  • Set Temp_player = owner of Temp_u
                  • Unit - Remove Temp_u from the game
                  • Unit - Create 1 Cursed Gold Mine for Temp_player at Temp_Point facing Default building facing degrees
                • Else - Actions
        • Else - Actions
 
Level 19
Joined
Oct 7, 2014
Messages
2,209
The haunted gold mine isn't removed
  • Race Selection Pick 2
    • Events
      • Dialog - A dialog button is clicked for Race_Dialog_2
    • Conditions
    • Actions
      • Set Temp_Integer_1 = (Player number of (Triggering player))
      • Set Temp_Location = ((Triggering player) start location)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Race_Dialog_Buttons_2[0]
        • Then - Actions
          • Melee Game - Create Undead starting units for (Triggering player) at Temp_Location (Include Heroes)
          • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Necropolis
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Hall of Terror using The new unit's default life and mana
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Haunted Gold Mine
                • Then - Actions
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Acolyte
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Cultist using The new unit's default life and mana
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Ghoul
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Imp using The new unit's default life and mana
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Haunted Gold Mine
                • Then - Actions
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
          • Unit Group - Pick every unit in (Units within 2000.00 of Temp_Location) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Gold Mine
                • Then - Actions
                  • Set Temp_u = (Picked unit)
                  • Set Temp_Point = (Position of Temp_u)
                  • Set Temp_player = (Owner of Temp_u)
                  • Unit - Remove Temp_u from the game
                  • Unit - Create 1 Cursed Gold Mine for Temp_player at Temp_Point facing Default building facing degrees
                • Else - Actions
        • Else - Actions
 
Level 12
Joined
Oct 16, 2010
Messages
680
add one more line in the conditions

  • (Unit-type of (Picked unit)) Equal to Gold Mine
  • (Unit-type of (Picked unit)) Equal to Haunted Gold Mine
EDIT: or wait... what?
u just forgot to replace
remove this
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Picked unit)) Equal to Haunted Gold Mine
    • Then - Actions
    • Else - Actions
and add the condition as I mentioned
 
Status
Not open for further replies.
Top