Spawn Trigger help needed!

Lord_of_RP

New Member
Reaction score
4
I'm working on a map in which the players can build portals. Every 10 seconds monsters should spawn from the portals... however... I don't know how to set it up.

Say theirs 3 whelp portals. Every 10 seconds 1 whelp should spawn at each portal.

I don't even know where to begin on this trigger.
 

Skippy

Active Member
Reaction score
39
For spawning unit every 10 seconds at center of some region, use this:

Trigger:
  • Spawning
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Point = (Center of Your_Region)
      • Unit - Create 1 Whelp for Player 1 (Red) at Temp_Point facing 0.00 degrees
      • Custom script: call RemoveLocation(udg_Temp_Point)
 

Lord_of_RP

New Member
Reaction score
4
Won't that always make it only one unit though? What I need is so the spawn is equal to the amount of building of that type. So if theirs 10 portals, 10 whelps spawn, 1 at each portal. If theres 30, then 30 spawn, 1 at each portal.
 

Guest3z

New Member
Reaction score
22
Trigger:
  • Portal
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set UnitGroup_Variable = (Units of type Portal)
      • Unit Group - Pick every unit in UnitGroup_Variable and do (Actions)
        • Loop - Actions
          • Set Point_Variable = (Position of (Picked unit))
          • Unit - Create 1 YourUnit for (Owner of (Picked unit)) at Point_Variable facing Default building facing degrees
          • Custom script: call RemoveLocation( udg_Point_Variable )
      • Custom script: call DestroyGroup( udg_UnitGroup_Variable )


Just set a unit group equal to all the portals and spawn one of your units for each unit in that group every 10 seconds.
 

Skippy

Active Member
Reaction score
39
So "portal" is a building, right? Then you can make it like this:
Trigger:
  • Spawning
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Group = (Units of type Portal)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Position of (Picked unit))
          • Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing 0.00 degrees
          • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_Temp_Group)

EDIT: You are faster :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top