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

[Solved] Cancel Unit detect

Status
Not open for further replies.
Level 12
Joined
Oct 28, 2019
Messages
475
  • 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
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
 
Level 12
Joined
Oct 28, 2019
Messages
475
TY I will try. This dont conflict with Unit Event system?
 
Level 12
Joined
Oct 28, 2019
Messages
475
Srry but I´ve copied all triggers to my map, and get multiple errors
 
Level 12
Joined
Oct 28, 2019
Messages
475
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:
Level 12
Joined
Oct 28, 2019
Messages
475
  • 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.
Top