• 🏆 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] Need system in Castle Fight

Status
Not open for further replies.
Level 11
Joined
Jul 7, 2010
Messages
709
I am wondering if anyone could help me make a system in Castle Fight the system how it Auto Trains units I have gone blank and dont know what to do , I need it so like its only one trigger that every 30 seconds it tells all buildings to train units to spawn and attack the base...
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Periodic training:
  • Untitled Trigger 055
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Barracks)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to train/upgrade to a Footman
Automatic attack order:
  • Untitled Trigger 056
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Triggering unit))) Equal to 1
        • Then - Actions
          • Set p1 = (Center of Region 000 <gen>)
          • Unit - Order (Triggering unit) to Attack-Move To p1
          • Custom script: call RemoveLocation(udg_p1)
        • Else - Actions
Or you can pre-set the point an use it over and over again. You might not need to set/remove it in this trigger every time.
 
Level 3
Joined
Apr 17, 2008
Messages
41
If each building only trains one type of unit (like in castle fight) then I have exactly what you're looking for. Unfortunately I don't have it with me right now, so you'll need to wait until later. I'll post back here later.
 
Level 3
Joined
Dec 9, 2009
Messages
35
You can do it with 3 triggers :
  • Buildings
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set NumberOfBuilding = (NumberOfBuilding + 1)
      • Set BuildingType[NumberOfBuilding] = Barracks
      • Set UnitType[NumberOfBuilding] = Footman
      • -------- - --------
      • Set NumberOfBuilding = (NumberOfBuilding + 1)
      • Set BuildingType[NumberOfBuilding] = Blacksmith
      • Set UnitType[NumberOfBuilding] = Rifleman
      • -------- - --------
  • Train First
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • For each (Integer loop) from 1 to NumberOfBuilding, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Constructed structure)) Equal to BuildingType[loop]
            • Then - Actions
              • Unit - Order (Constructed structure) to train/upgrade to a UnitType[loop]
              • Unit - Order (Constructed structure) to train/upgrade to a UnitType[loop]
            • Else - Actions
  • Loop Training
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to train/upgrade to a (Unit-type of (Trained unit))
      • Set p = (Position of Castle 0000 <gen>)
      • Unit - Order (Trained unit) to Attack-Move To p
      • Custom script: call RemoveLocation(udg_p)
 
Status
Not open for further replies.
Top