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

How to Order Hall to stop building Peasant by Trigger?

Status
Not open for further replies.
Level 7
Joined
Dec 14, 2012
Messages
192
Hmm.. Could you post under what circumstances the training should be cancelled?

Anyway, I think the action: Order unit to stop could work out. (It's found under "Issue order with no target")
Probably the "pause unit" option could also work out.
Try it out, maybe one of these two would work.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Hmm.. Could you post under what circumstances the training should be cancelled?

Anyway, I think the action: Order unit to stop could work out. (It's found under "Issue order with no target")
Probably the "pause unit" option could also work out.
Try it out, maybe one of these two would work.

they have their own order ID

  • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851976)
  • Test Map
    • Events
      • Unit - A unit Begins training a unit
    • Conditions
    • Actions
      • Custom script: set udg_u = GetTrainedUnitType()
      • Set tempPoint = (Position of (Triggering unit))
      • Unit - Create 1 u for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • u Equal to Peasant
        • Then - Actions
          • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851976)
        • Else - Actions
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation (udg_tempPoint)
here is a test map
 

Attachments

  • Training Unit.w3x
    17.2 KB · Views: 86
Last edited:
Status
Not open for further replies.
Top