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

Unit train crafting system

Status
Not open for further replies.
Level 4
Joined
May 24, 2017
Messages
93
  • Smelt Rock
    • Events
      • Unit - A unit Begins training a unit
    • Conditions
      • (Trained unit-type) Equal to Smelt Stone
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Stone) Equal to True
          • (Charges remaining in (Item carried by (Triggering unit) of type Stone)) Greater than or equal to 5
          • ((Triggering unit) has an item of type Wood) Equal to True
          • (Charges remaining in (Item carried by (Triggering unit) of type Wood)) Greater than or equal to 5
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Stone) to ((Charges remaining in (Item carried by (Triggering unit) of type Stone)) - 5)
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Wood) to ((Charges remaining in (Item carried by (Triggering unit) of type Wood)) - 5)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Charges remaining in (Item carried by (Triggering unit) of type Wood)) Equal to 0
              • Then - Actions
                • Item - Remove (Item carried by (Triggering unit) of type Wood)
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Charges remaining in (Item carried by (Triggering unit) of type Stone)) Equal to 0
              • Then - Actions
                • Item - Remove (Item carried by (Triggering unit) of type Stone)
              • Else - Actions
        • Else - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffff0000You need ...
          • Wait 0.01 seconds
          • Custom script: call IssueImmediateOrderById( GetTriggerUnit(), 851976 )
I want to use this trigger to create a smelting system hat can be queued up. This trigger works but it has two issues that I hope can be fixed.
1. This only triggers on the first training order, so it wont check the conditions when it queues up the second training. How do I make it work on more then one training?
2. Is there a way to remove the wait at the end? I guessed that it happened before the training happened which is why it would not cancel before I added the wait. Just the way "A unit takes damage " happens.

Any help is good. Thank you
 
Status
Not open for further replies.
Top