• 🏆 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!

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