Region Array Spawning Method

Julian4life

New Member
Reaction score
7
Hey guys, I'm trying to spawn units from 16 different regions at the same time, but triggering each of the with many different spawns would take forever...

So, I thought of trying to create an array of regions, and use a loop to spawn them.

Problem is, I dont how i can find something to create units in the different regions...

Some stuff i've set up currently:

Trigger:
  • Low Spawn Arrays
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set LowSpawns[1] = LowCreepSpawn1 <gen>
      • Set LowSpawns[2] = LowCreepSpawn2 <gen>
      • Set LowSpawns[3] = LowCreepSpawn3 <gen>
      • Set LowSpawns[4] = LowCreepSpawn4 <gen>
      • Set LowSpawns[5] = LowCreepSpawn5 <gen>
      • Set LowSpawns[6] = LowCreepSpawn6 <gen>
      • Set LowSpawns[7] = LowCreepSpawn7 <gen>
      • Set LowSpawns[8] = LowCreepSpawn8 <gen>
      • Set LowSpawns[9] = LowCreepSpawn9 <gen>
      • Set LowSpawns[10] = LowCreepSpawn10 <gen>
      • Set LowSpawns[11] = LowCreepSpawn11 <gen>
      • Set LowSpawns[12] = LowCreepSpawn12 <gen>
      • Set LowSpawns[13] = LowCreepSpawn13 <gen>
      • Set LowSpawns[14] = LowCreepSpawn14 <gen>
      • Set LowSpawns[15] = LowCreepSpawn15 <gen>
      • Set LowSpawns[16] = LowCreepSpawn16 <gen>


and I tried to find a trigger to spawn units at all 16 points... but couldnt find it...

Trigger:
  • Low Spawn
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 60.00 seconds
      • For each (Integer A) from 1 to 16, do (Actions)
        • Loop - Actions
    • ........what now?.......



If you can help... +REP! :thup:
 

Julian4life

New Member
Reaction score
7
Hmm, could someone design a trigger n show it for me? ._.

I'm having a hard time finding it. 0o

both +rep'd :D
 
Reaction score
341
Trigger:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 60.00 seconds
      • For each (Integer A) from 1 to 16, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at LocSpawns[(Integer A)] facing Default building facing degrees
 

Julian4life

New Member
Reaction score
7
oh i see. i made the variable a region, not a integer, which is why i couldnt put it in as the variable.
 
Reaction score
341
oh i see. i made the variable a region, not a integer, which is why i couldnt put it in as the variable.

Wrong... Just make the variable a point-type or to a Reigon2Location Conversion.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Didn't read the whole thread;
So sorry if this is useless.

This is what I use for my TD spawning:
Trigger:
  • Do Multiple ActionsFor each (Integer A) from 1 to creepSpawnCount[levelCount], do (Actions)
    • Loop - Actions
      • Wait 0.75 seconds
      • Player Group - Pick every player in inGamePlayers and do (Actions)
        • Loop - Actions
          • Set tempPoint = ((Picked player) start location)
          • Unit - Create 1 creepArray[levelCount] for hostileCreeps at tempPoint facing 0.00 degrees
          • Custom script: call RemoveLocation(udg_tempPoint)

creepSpawnCount = Number of creeps in that wave
levelCount = An integer counter to know what level is currently spawning
creepArray = An array to hold the Unit Type of creeps

Hope this helps ;) .
 

Julian4life

New Member
Reaction score
7
Ahhhhhhh. lol. I see.

+rep wolfie. and i rep'd you already trigger. 0o



EDIT: Hey trigger, the private message saying i didnt rep you... i did, i tried to rep you again and it says to spread some rep... 0o
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Well you seem happy;
So I'm assuming it helped at least a little ;) .
Glad to help,
And good luck with your map!
 

Julian4life

New Member
Reaction score
7
Haha thanks so much trigger. that really helped. lol. Couldnt have figured it out myself.

And wolfie, a small question tho, create the hostile creeps at player start location? Just wondering. Confused me a little bit.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Oh sorry.
Place the players start locations where the creeps are supposed to spawn.
That way, you spawn the creeps at the players starting location.

hostileCreeps = the player that the creeps belong to [in my TD, it's Player 12 (Brown)]

Picture:
arrowedtdterrainaf6.jpg
 

Julian4life

New Member
Reaction score
7
Hey, found one other problem.

I can't make it actually loop, like it'll spawn once, but not again.

My current setup:
Low Spawn Arrays
Events
Map initialization
Conditions
Actions
Set LowSpawns[1] = (Center of LowCreepSpawn1 <gen>)
Set LowSpawns[2] = (Center of LowCreepSpawn2 <gen>)
Set LowSpawns[3] = (Center of LowCreepSpawn3 <gen>)
Set LowSpawns[4] = (Center of LowCreepSpawn4 <gen>)
Set LowSpawns[5] = (Center of LowCreepSpawn5 <gen>)
Set LowSpawns[6] = (Center of LowCreepSpawn6 <gen>)
Set LowSpawns[7] = (Center of LowCreepSpawn7 <gen>)
Set LowSpawns[8] = (Center of LowCreepSpawn8 <gen>)
Set LowSpawns[9] = (Center of LowCreepSpawn9 <gen>)
Set LowSpawns[10] = (Center of LowCreepSpawn10 <gen>)
Set LowSpawns[11] = (Center of LowCreepSpawn11 <gen>)
Set LowSpawns[12] = (Center of LowCreepSpawn12 <gen>)
Set LowSpawns[13] = (Center of LowCreepSpawn13 <gen>)
Set LowSpawns[14] = (Center of LowCreepSpawn14 <gen>)
Set LowSpawns[15] = (Center of LowCreepSpawn15 <gen>)
Set LowSpawns[16] = (Center of LowCreepSpawn16 <gen>)


Low Spawn
Events
Map initialization
Conditions
Actions
Wait 60.00 seconds
For each (Integer A) from 1 to 16, do (Actions)
Loop - Actions
Unit - Create 1 Ghoul for Player 12 (Brown) at LowSpawns[(Integer A)] facing Default building facing degrees
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Instead of Map Initialization, do this;
NOTE: This if freehand:
Trigger:
  • Low Spawn
    • Events
      • Elapsed game time is 60.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 16, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Ghoul for Player 12 (Brown) at LowSpawns[(Integer A)] facing...
 

Julian4life

New Member
Reaction score
7
I tried it, it only spawned once, but not again.
Am i doing anything wrong?

Low Spawn
Events
Time - Elapsed game time is 60.00 seconds
Conditions
Actions
For each (Integer A) from 1 to 16, do (Actions)
Loop - Actions
Unit - Create 1 Ghoul for Player 12 (Brown) at LowSpawns[(Integer A)] facing Default building facing degrees


To be precise, i want this to spawn 12 times (from each spawn point)
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Try this:
Trigger:
  • Low Spawn
    • Events
      • Elapsed game time is 60.00 seconds
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 16, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Ghoul for Player 12 (Brown) at LowSpawns[(Integer B)] facing...
 
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