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

[Solved] Cancel Unit detect

Status
Not open for further replies.
Level 13
Joined
Oct 28, 2019
Messages
523
  • 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 73
Joined
Aug 10, 2018
Messages
7,866
 
Level 13
Joined
Oct 28, 2019
Messages
523
TY I will try. This dont conflict with Unit Event system?
 
Level 13
Joined
Oct 28, 2019
Messages
523
Srry but I´ve copied all triggers to my map, and get multiple errors
 
Level 13
Joined
Oct 28, 2019
Messages
523
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 13
Joined
Oct 28, 2019
Messages
523
  • 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