• 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] Problem with the Sacrificial Pit

Status
Not open for further replies.
So, I made a trigger that replaces the shade into a militia. My problem is, when the user is out of resources, it still trains. Fix the trigger plox.

  • peasant to militia
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barracks
      • (Unit-type of (Trained unit)) Equal to Shade
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Current gold) Less than 30
          • ((Owner of (Triggering unit)) Current lumber) Less than 30
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Unit - Replace (Trained unit) with a Peasant using The new unit's default life and mana
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: We don't have enoug...
        • Else - Actions
          • Player - Add -30 to (Owner of (Triggering unit)) Current gold
          • Player - Add -30 to (Owner of (Triggering unit)) Current lumber
          • Unit - Replace (Trained unit) with a Militia using The new unit's default life and mana
What i want is to stop the barracks in training the shade when the user has a resources of below 30



also, if someone had sparetime, can someone make me a.....
use farm as dummy unit
every 20 seconds, peasant will spawn in the farm
and when town hall is built, it will be reduced into 15 seconds
 
Last edited:
Level 16
Joined
Mar 3, 2006
Messages
1,564
Issue unit to stop doesn't cancel training; it cancels orders and since training isn't an order so it won't cancel training. I have done something else but its a bit crappy.

And BTW, your condition needs OR.

  • Training
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barracks
      • (Unit-type of (Trained unit)) Equal to Footman
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • ((Owner of (Triggering unit)) Current gold) Less than 30
              • ((Owner of (Triggering unit)) Current lumber) Less than 30
        • Then - Actions
          • For each (Integer A) from 1 to 7, do (Actions)
            • Loop - Actions
              • Game - Force (Owner of (Triggering unit)) to press Escape/Cancel
          • Unit - Replace (Trained unit) with a Peasant using The new unit's default life and mana
        • Else - Actions
          • Unit - Replace (Trained unit) with a Knight using The new unit's default life and mana
 
Status
Not open for further replies.
Top