• 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.

[Solved] Cancel every training and research in building

Status
Not open for further replies.
I think i've got a solution for this one. :)

As we know, there are 7 slots in each building for either unit training, researches or hero revivals.
So we need to order each building to Cancel whatever it's doing 7 times.

I looked up the order ID for the Cancel order. So now we can order the building to cancel whatever it's doing.


  • Unit Group - Pick every unit in (GroupBuildings) and do (Actions) //The group of the buildings that you want to cancel whatever they're doing!
    • Loop - Actions
      • Set VariableSet Building = (Picked unit) //A Temp variable cuz the dumbass custom script needs it as an argument!
      • For each (Integer A) from 1 to 7, do (Actions) //Loop that sumbitch 7 times, as my lucky number!
        • Loop - Actions
          • Custom script: call IssueImmediateOrderById(udg_Building, 851976) //Order the dumb building to cancel //equal to pressing ESC 1 time
I tested this already and it worked. :)
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
If you wanna do that for just one player, if @MN Lahmar said is true, just do this.
  • Set Temp_Group=Units Owned by "Your Player"
  • Unit Group - Pick every unit in Temp_Group and do (Actions)
    • Loop - Actions
      • Set Temp_Unit=(Picked Unit)
      • If (All conditions are true) then do (Then actions) else do (Else Actions)
        • If - Conditions
          • Temp_Unit is a structure Equal to true
        • Then - Actions
          • For each "Your integer" from 1 to 7, do (Actions)
            • Loop - Actions
              • Custom script: call IssueImmediateOrderById(udg_Temp_Unit, 851976)
        • Else - Actions
  • Custom script: call DestroyGroup(udg_Temp_Group)
 
Status
Not open for further replies.
Top