• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Region and unit spawn

Status
Not open for further replies.
Level 30
Joined
Sep 30, 2008
Messages
1,460
Sure do! If you mean the GUI editor in warcraft 3, you'd want to have the event:

Unit enters region x

Condition:

Unit equals (unit of your choosing)

or leave the condition blank if you want any unit type to trigger this function :)

Then in the actions you can have:

Spawn x units at centre of region y

-------------------------------------------

hope this helps!
 
if one by one the easiest way is local variable and a wait. first set units in array that u want to spawn if u want lvls to get higher as the waves are spawned.

then do this.
if a unit enters region 2 this will spawn a unit[1] the first time unit enters region. when a new unit enters the region it will spawn unit[2] and so on. if u dont want this to happen use the second trigger.
  • wave spawning
    • Events
      • Unit - A unit enters Region 2 <gen>
    • Conditions
    • Actions
      • Custom script: local unit udg_tempUnit = GetTriggerUnit()
      • Custom script: local integer udg_tempInt = 1
      • Custom script: local integer udg_tempInt2 = 1
      • Custom script: local location udg_tempPoint = Location(GetRectCenterX( gg_rct_Region_1), GetRectCenterY( gg_rct_Region_1))
      • Custom script: local integer udg_tempInt3
      • Set waveCounter = (waveCounter + 1)
      • Custom script: set udg_tempInt3 = udg_waveCounter
      • For each (Integer tempInt) from 1 to tempInt2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Region 2 <gen> contains tempUnit) Equal to True
            • Then - Actions
              • Unit - Create 1 unitTypeArray[tempInt3] for Player 1 (Red) at tempPoint facing Default building facing degrees
              • Set tempInt2 = (tempInt2 + 1)
            • Else - Actions
          • Wait 2.00 seconds
      • Custom script: set udg_tempUnit = null
      • Custom script: call RemoveLocation( udg_tempPoint)
      • Custom script: set udg_tempPoint = null
second trigger.
this will spawn the same unit whenever a unit is in region 2
  • wave spawning
    • Events
      • Unit - A unit enters Region 2 <gen>
    • Conditions
    • Actions
      • Custom script: local unit udg_tempUnit = GetTriggerUnit()
      • Custom script: local integer udg_tempInt = 1
      • Custom script: local integer udg_tempInt2 = 1
      • Custom script: local location udg_tempPoint = Location(GetRectCenterX( gg_rct_Region_1), GetRectCenterY( gg_rct_Region_1))
      • For each (Integer tempInt) from 1 to tempInt2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Region 2 <gen> contains tempUnit) Equal to True
            • Then - Actions
              • Unit - Create 1 urUnitType for Player 1 (Red) at tempPoint facing Default building facing degrees
              • Set tempInt2 = (tempInt2 + 1)
            • Else - Actions
          • Wait 2.00 seconds
      • Custom script: set udg_tempUnit = null
      • Custom script: call RemoveLocation( udg_tempPoint)
      • Custom script: set udg_tempPoint = null
 
Level 2
Joined
Apr 23, 2013
Messages
10
Sorry if I didn't make it more explicit. It is something like a mission where 1 of your unit manage to make it to that region. Then from there onwards, units will keep spawning to help you to defeat the evil people. It does not need to have a unit always stationed at that area.

I'm not very sure how to do it, but I split this into 2 parts, where:

Trigger 1
Event: Unit enters region X
Condition: (Owner of (Triggering unit)) Equal to Player 1 (Red)
Action: Turn Trigger 2 on

Trigger 2
Event: Every 5 seconds of game time
Condition: NIL
Action: Spawn 5 footman at region Y

Is this right? Nothing spawns even when a unit enters region X. Or I can just combine both triggers?
 
Status
Not open for further replies.
Top