• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Cancel Unit detect

Status
Not open for further replies.
Level 14
Joined
Oct 28, 2019
Messages
536
  • CancelElvenSwordman
    • Events
      • Unit - A unit Cancels training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Elven Swordman
    • Actions
      • Set VariableSet IntegerLeatherTOTAL = (IntegerLeatherTOTAL + 20)
      • Leaderboard - Change the value for Player 22 (Snow) in (Last created leaderboard) to (IntegerLeatherTOTAL + 20)
An Elven swordman costs custom resource (leather) I need a system that replace the custom resource, but im not getting dindt find anyplace
 
 
TY I will try. This dont conflict with Unit Event system?
 
Srry but I´ve copied all triggers to my map, and get multiple errors
 
You can use "Trained Unit Type" in unit type comparison instead "Unit Type of <Unit>". Unit does not exist yet, so latter does not work.
NICE, worked, but I got other problem now,

Im using
  • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851976)
to cancel orders that don´t has enough resources, and this is triggering the trigger. Any ideia?

[SOLVED]
I´ve add a system with boolean variables to seek if theres enough resource.
 
Last edited:
  • CostsElvenSwordman
    • Events
      • Unit - A unit owned by Player 1 (Red) Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(Elven Swordman))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntegerLeatherTOTAL Greater than or equal to 20
        • Then - Actions
          • Leaderboard - Change the value for Player 22 (Snow) in (Last created leaderboard) to (IntegerLeatherTOTAL - 20)
          • Set VariableSet IntegerLeatherTOTAL = (IntegerLeatherTOTAL - 20)
          • Set VariableSet BoleanCostElvenSwordman = False
        • Else - Actions
          • Set VariableSet BoleanCostElvenSwordman = True
          • Game - Display to (All players) the text: Not enough |cffd45e...
          • Wait 0.01 seconds
          • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851976)
  • CancelElvenSwordman
    • Events
      • Unit - A unit Cancels training a unit
    • Conditions
      • (Trained unit-type) Equal to Elven Swordman
      • BoleanCostElvenSwordman Equal to False
    • Actions
      • Leaderboard - Change the value for Player 22 (Snow) in (Last created leaderboard) to (IntegerLeatherTOTAL + 20)
      • Set VariableSet IntegerLeatherTOTAL = (IntegerLeatherTOTAL + 20)
 
Status
Not open for further replies.
Back
Top