• 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] Order Unit to cancel unit production..

Status
Not open for further replies.
Level 12
Joined
Feb 22, 2010
Messages
1,115
Show your whole trigger, by it doesn't work you mean it gives u an error or just doesn't work in game?
 
Level 8
Joined
Sep 30, 2012
Messages
205
sry for the late reply..
__________________________________________

Error while map saving: Generating Map scripts:
reads: invalid argument type (integer)
(only occurs when i enable trigger 2)
___________________________________________

so the idea here is that i want to get my auto start to work.
Auto start means that as soon as the game starts the "workers" start mining gold and the "main-building" starts with the production of an extra worker.

As seen in Trigger 1.

but i also want to give the night elf players the option to choose the new naga faction. so the workers get replaced and the main building is getting changed via the "chaos" ability, since replacing buildings is quite problematic (they wander around, since they got collision size and so on)

Anyway the problem now is: the ability chaos won't trigger when the main building is currently training the extra worker, so i would need to cancel that beforehand so that the transition to naga is running smoothly.

  • egt0
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Dialog - Clear PlayNaga
      • Dialog - Change the title of PlayNaga to Would You like to p...
      • Dialog - Create a dialog button for PlayNaga labelled Play Naga
      • Set PlayNagaB[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for PlayNaga labelled Play Night Elves
      • Set PlayNagaB[2] = (Last created dialog Button)
      • Dialog - Clear Ready
      • Dialog - Change the title of Ready to Night Elven Players...
      • Dialog - Create a dialog button for Ready labelled Yes
      • Set ReadyB[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Ready labelled No
      • Set ReadyB[2] = (Last created dialog Button)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Picked player)) Equal to Night Elf
            • Then - Actions
              • Dialog - Show PlayNaga for (Picked player)
            • Else - Actions
              • Dialog - Show Ready for (Picked player)
      • Custom script: set bj_wantDestroyGroup = true
      • Set GroupVar = (Units in (Playable map area))
      • Unit Group - Pick every unit in GroupVar and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A peon-type unit) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to Harvest Nearby Gold
            • 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 - Order (Picked unit) to Harvest Nearby Lumber
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Town Hall
                    • Then - Actions
                      • Unit - Order (Picked unit) to train/upgrade to a Peasant
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Great Hall
                        • Then - Actions
                          • Unit - Order (Picked unit) to train/upgrade to a Peon
                        • Else - 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 - Order (Picked unit) to train/upgrade to a Acolyte
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Unit-type of (Picked unit)) Equal to Tree of Life
                                • Then - Actions
                                  • Unit - Order (Picked unit) to train/upgrade to a Wisp
                                • Else - Actions
      • Custom script: call DestroyGroup(udg_GroupVar)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
  • N
    • Events
      • Dialog - A dialog button is clicked for PlayNaga
    • Conditions
      • (Clicked dialog button) Equal to PlayNagaB[1]
    • Actions
      • Game - Display to (All players) the text: ((Name of (Triggering player)) + changed to Naga.)
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Triggering player)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Entangled Gold Mine
                • Then - Actions
                  • Unit - Kill (Picked unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Tree of Life
                    • Then - Actions
                      • Custom script: call IssueImmediateOrder(GetEnumUnit(), 851976 )
                      • Unit - Add Chaos *Well of Life=Na to (Picked unit)
                      • Wait 0.00 seconds
                      • Unit - Order (Picked unit) to train/upgrade to a Mur'gul Slave
                    • Else - Actions
            • Else - Actions
      • Wait 0.00 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Triggering player)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Wisp
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Mur'gul Slave using The old unit's relative life and mana
                  • Unit - Order (Last replaced unit) to Harvest Nearby Gold
                • Else - Actions
            • Else - Actions
_________________________________

was able to safe with this code:
  • call IssueImmediateOrderById(GetEnumUnit(),(851976))
but the unit production isn't canceled..
 

Attachments

  • Error.png
    Error.png
    54.7 KB · Views: 116
Last edited:
Status
Not open for further replies.
Top