Spawn Triggers.

Saintbob

New Member
Reaction score
2
Hey Guys, im trying to create a map with spawning creeps from 8 points on the edges of my map. Ive done that, but ive only been able to put them on a Time elapsed event.

so as you can imagine i have alot of triggers for my waves, and i only have 5 waves so far and have over 50 triggers.

can anyone explain how i get the waves to spawn after my timer of 60 seconds has got to 0, then for the timer to start again once all creeps are dead, then the 2nd wave to start when the time reaches 0 again.

Any ideas? ive got the leaderboard, ive got the timer working, i've got the regions and the movement in place, its just these darn waves.

Please help someone, or if you can point me in the right direction.

Thanks.
P.S this is a screeny of my Triggers so far...
http://i383.photobucket.com/albums/oo275/Cdawson001/Triggers1.jpg

as you can see i have triggers in Wave 1-40 ghouls
the first trigger spawns 1 ghouls at 8 regions at 60 seconds elapsed game time.
then the 2nd one does the same put at 65 seconds game time.
This continues all the way through the game and waves.

Just so you can see how ive laid it out.
Thanks :D
 

denmax

You can change this now in User CP.
Reaction score
155
And idea that comes to my mind is that as soon as those units are spawned, you add every unit to a unit group. So you should spawn units using the loop action and add them to your unit group via "Add (Last Created Unit). As to why we should use the loop instead of instantly just creating like 50 units in one "spawn trigger" is the fact that (Last Created Unit) will not work on them.

Now that you have that unit group, I think that you'd need another trigger to check every half a second or somesuch if the unit group contains any unit or not. If it doesn't, then the timer restarts and the new units spawn.

You'll only need one unit group variable for this. Heck, no need for arrays.
 

Saintbob

New Member
Reaction score
2
And idea that comes to my mind is that as soon as those units are spawned, you add every unit to a unit group. So you should spawn units using the loop action and add them to your unit group via "Add (Last Created Unit). As to why we should use the loop instead of instantly just creating like 50 units in one "spawn trigger" is the fact that (Last Created Unit) will not work on them.

Now that you have that unit group, I think that you'd need another trigger to check every half a second or somesuch if the unit group contains any unit or not. If it doesn't, then the timer restarts and the new units spawn.

You'll only need one unit group variable for this. Heck, no need for arrays.

Thanks for you're reply, but i didnt understand any of that lol. :(
Everything that ive created so far has been from watching videos on youtube.

How to i go about putting units into a unit group, and getting them to spawn when the time reaches 0?

Thanks once again
 

denmax

You can change this now in User CP.
Reaction score
155
Thanks for you're reply, but i didnt understand any of that lol. :(
Everything that ive created so far has been from watching videos on youtube.

How to i go about putting units into a unit group, and getting them to spawn when the time reaches 0?

Thanks once again

I'm really sorry, I lost my original copy of WCIII (nor do I play it anymore), so I don't have my map editor.

Do you know what variables are? If not, I suggest you read the tutorials about them.

The "unit group" I am talking about is a variable type. Your units should be added to this unit group. It should be an action called "Unit - Add (Last Created Unit) to [yourunitgroup]" every after a unit is created.

And look at your "Trigger 1". You seem to have repeated your "spawn actions", but you can simply just do it with the loop action. If I remember correctly, the action is "For each and every *blahblah* from 1 to [the number of repetitions], do actions"

Let's have an example.

Suppose you want to spawn 10 Moonstahs.
We should now use "

Trigger:
  • Actions
    • For each and every *iforgotwhatwaswrittenhere* from 1 to 10, do actions
      • Do - Actions
        • Unit - Create 1 Moonstah for .....
        • Unit - Add (Last Created Unit) to whateveristhenameofyourunitgroup
    • Game - Display to (All players) the text: "OMIGOD TEN MOONSTAHS!!!!1!1!!!!eleven!!!
 

Saintbob

New Member
Reaction score
2
hey thanks once again for getting back to me, Yeah i know what varibles are.
But im just no good at putting it all together.

I need someone to show me how to do it, or be able to do it for me.
lol.

Thanks for you're help i will see if i can use what you've said and try it out.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Less freehand but still freehand xD
Trigger:
  • Actions
    • For each Integer A from 1 to 10, do actions
      • Loop - Actions
        • Unit - Create 1 footmen for (Player 1 - Red)
        • Unit - Add (Last Created Unit) to (Temp_Group)
 

Saintbob

New Member
Reaction score
2
ok this is way beyond me guys, thanks for you're help.
But i think im going to create another thread asking for someone to help do the triggers, by me sending them the map.

lol i dont have the IQ for it :D
 

Seprest

New Member
Reaction score
15
Don't make a new thread, just repose your question/request.

Make a variable:

AliveCreeps - Unit Group - Empty Unit Group

Trigger:
  • CreepCounter-Add
    • Events
      • Unit - A unit enters Spawn#1
    • Conditions
    • Actions
      • Unit Group - Add (Triggering unit) to (AliveCreeps)

Trigger:
  • CreepCounter-Remove
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in (AliveCreeps)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Units in (Playable map area)) is empty) Equal to True
        • Then - Actions
          • Countdown Timer - Start (CreepCounter1) as a One-shot timer that will expire in 60.00 seconds
        • Else - Actions


This would work for each player, just copy for each player and change the region to the respective spawn sites, and change the timer to the correct one too.


If you want the timer to start once ALL creeps are dead (not just the ones spawned for a specific player), then add more lines to the
Trigger:
  • Events
    • Unit - A unit enters Spawn#1


And the timer can just be any counter you use to time that 60 seconds till the next spawn.
 

SanKakU

Member
Reaction score
21
i think you should probably use the unit indexing system called AIDS by Jesus4Lyf. i think at one point i was making a map kindof like yours...it was called king of the hill, or king of the forest or something like that. that was so long ago, back when i knew almost nothing about coding. i'll see about using AIDS in that map and give you a report on how it works out.
 
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