Building that spawns

your dog

New Member
Reaction score
0
Im making a map and i need a building that can spawn units like in Footman Frenzy. Does anybody know how to do it?:)
 

Bankde

Member
Reaction score
20
Try This

Event - Every ... sec of game time
Condition nothing
Action - Pick everyunit in playable map area
-If unit picked = Barrack Action spawn footman at picked unit Else Nothing
-If unit picked = castle Action spawn knight at picked unit Else Nothing
 

Bankde

Member
Reaction score
20
Trigger:
  • Spawn Unit
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • If ((Unit-type of (Picked unit)) Equal to Farm) then do (Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees) else do (Do nothing)
              • If ((Unit-type of (Picked unit)) Equal to Barracks) then do (Unit - Create 1 Knight for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees) else do (Do nothing)
            • Else - Actions
              • Do nothing


Here you may change the bold letter to your building/unit.

If ((Unit-type of (Picked unit)) Equal to Farm) then do (Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees) else do (Do nothing)

If you want to create like footman frenzy, you should create the 1 action for each building.

Here the map View attachment Helpable Map.w3x
 

PooBucket

New Member
Reaction score
12
Don't put Do Nothing :rolleyes:

Trigger:
  • Spawn Unit
    • Events
    • Time - Every few seconds of game time
    • Conditions
    • Actions
    • Unit Group - Pick every unit in (Units in (Entire Map matching [Matching unit = Barracks)) and do (Actions)
    • Loop - Actions
    • (Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees)
 

Stringel

New Member
Reaction score
12
Don't put Do Nothing :rolleyes:

Trigger:
  • Spawn Unit
    • Events
    • Time - Every few seconds of game time
    • Conditions
    • Actions
    • Unit Group - Pick every unit in (Units in (Entire Map matching [Matching unit = Barracks)) and do (Actions)
    • Loop - Actions
    • (Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees)

leaky afaik, instead create variables for the position of picked unit aswell as a temp unit group.
 

your dog

New Member
Reaction score
0
i dont understand what you guys are talking about, im not a pro at triggers and never actually done one. how do i get the icon thingy with a ?
 

Bankde

Member
Reaction score
20
Here trigger without creating the memory leak (I think it make you confuse but someone ask me to do this)

Trigger:
  • Spawn Unit
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Building_Spawn = (Units in (Playable map area))
      • Unit Group - Pick every unit in Building_Spawn and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set Building_Spawn_Location = (Position of (Picked unit))
              • If ((Unit-type of (Picked unit)) Equal to Farm) then do (Unit - Create 1 Footman for (Owner of (Picked unit)) at Building_Spawn_Location facing Default building facing degrees) else do (Do nothing)
              • If ((Unit-type of (Picked unit)) Equal to Barracks) then do (Unit - Create 1 Knight for (Owner of (Picked unit)) at Building_Spawn_Location facing Default building facing degrees) else do (Do nothing)
            • Else - Actions
      • Custom script: call DestroyGroup (udg_Building_Spawn)
      • Custom script: call RemoveLocation (udg_Building_Spawn_Location)


The best way to understand/learn trigger is "Try it yourself".
Here the map. (Recommend you to open and study it) View attachment Helpable Map.w3x
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top