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

[Trigger] Custom Unit Training

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2014
Messages
111
I have a question about my trigger.
Recently i've been thinking about unit training system like in the game Battle Realms.
I'm using Bribe's Unit Event.
The simplest trigger i could think is here :

  • Barracks Load
    • Events
      • Game - CargoEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of CargoTransportUnit[UDex]) Equal to Barracks
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UDexUnits[UDex]) Equal to Footman
        • Then - Actions
          • Game - Display to (All players) the text: Unit is loaded!
          • Unit - Order CargoTransportUnit[UDex] to Unload UDexUnits[UDex]
        • Else - Actions

  • Barracks Unload
    • Events
      • Game - CargoEvent becomes Equal to 2.00
    • Conditions
      • (Unit-type of CargoTransportUnit[UDex]) Equal to Barracks
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UDexUnits[UDex]) Equal to Footman
        • Then - Actions
          • Game - Display to (All players) the text: Unit is unloaded!
          • Unit - Hide UDexUnits[UDex]
          • Unit Group - Add UDexUnits[UDex] to UnitTrainingGroup
          • Unit - Order CargoTransportUnit[UDex] to train/upgrade to a Captain
        • Else - Actions

  • Barracks Finish
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barracks
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Trained unit-type) Equal to Captain
        • Then - Actions
          • Game - Display to (All players) the text: Unit is finished tr...
          • Unit Group - Pick every unit in UnitTrainingGroup and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
              • Unit Group - Remove (Picked unit) from UnitTrainingGroup
        • Else - Actions

  • Barracks Cancel
    • Events
      • Unit - A unit Cancels training a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barracks
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Trained unit-type) Equal to Captain
        • Then - Actions
          • Game - Display to (All players) the text: Unit is canceled tr...
          • Unit Group - Pick every unit in UnitTrainingGroup and do (Actions)
            • Loop - Actions
              • Unit - Unhide (Picked unit)
              • Unit Group - Remove (Picked unit) from UnitTrainingGroup
        • Else - Actions

I mean, is this enough? i know is not, especially about how to make it able to train multiple units. I don't know which part i should fix.

Here's the test map if you would.
 

Attachments

  • UnitTrainingEx.w3x
    28.4 KB · Views: 21
Last edited:
Status
Not open for further replies.
Top