Timer Spawn Guys

R

r2yneth

Guest
Alright - I still can't get it right and I don't think anyone knows what I'm talking about - I will elaborate

Survival Game -
>The game starts off with a timer that shows its counting down from 2 minutes

>After the two minutes, waves of creatures will SPAWN and go and attack the players

>After all the creatures have been wiped out, a 2minute timer will start again (shows)

>Repeat

Please help me if you have any idea how to do this - (Its like those zombie survival maps :) )
Thanks in advance!
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
Well, you would use two triggers like this:

Code:
Timer
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Countdown Timer - Create a timer window for TimerVariable with title Spawn
        Set TimerWindowVariable = (Last created timer window)
        Countdown Timer - Show TimerWindowVariable
        Countdown Timer - Start TimerVariable as a Repeating timer that will expire in 120.00 seconds

Code:
Timer Spawn
    Events
        Time - TimerVariable expires
    Conditions
    Actions
        Unit - Create 5 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
 
R

r2yneth

Guest
:) Cool - All i do not understand is "TimerVariable" How do I make this?

-Thanks in advance
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
Variable Editor. When in the Trigger Editor, click on the yellow X at the top. There, you can create variables.
 
R

r2yneth

Guest
Cool - So far the timer works perfectly! (thanks) - but right now I'm trying to make it so that the timer will end and then a wave of creeps will come out and attack
- after the wave of creeps, another timer will begin (2 mins again) until the next wave

-Thanks in advance! :)
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
That's exactly what I did.
ShockedEmoticon.gif


If you're having trouble, post your triggers.
 
R

r2yneth

Guest
oh no! :banghead:

I mean it like this:

> Timer starts from 2 minutes
(2 minutes end)
> Timer disappears
> Wave of creeps spawn from a place
> Creeps attack the players
> When all creeps are killed - Timer appears and starts from 2 minutes again

I just thought about a map thats exactly like that

- Element TD!

- But I don't have any idea how to do that :(
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
Aha! Now I understand! These triggers should work for you:

Code:
Timer
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Countdown Timer - Create a timer window for TimerVariable with title Spawn
        Set TimerWindowVariable = (Last created timer window)
        Countdown Timer - Show TimerWindowVariable
        Countdown Timer - Start TimerVariable as a One-shot timer that will expire in 120.00 seconds

Code:
Restart Timer
    Events
    Conditions
    Actions
        Countdown Timer - Show TimerWindowVariable
        Countdown Timer - Start TimerVariable as a One-shot timer that will expire in 120.00 seconds


Code:
Timer Spawn
    Events
        Time - TimerVariable expires
    Conditions
    Actions
        Countdown Timer - Hide TimerWindowVariable
        Unit - Create 5 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees

Code:
End Spawn
    Events
        Player - <Owner of Creeps>'s Food used becomes Equal to 0.00
    Conditions
    Actions
        Trigger - Run Restart Timer <gen> (checking conditions)

> Element TD

No offense intended, but Element TD is out of your league. (At least for now. ;) )
 
R

r2yneth

Guest
No offense taken =P Thanks a lot! I'll get back to my map now :)

Uh oh! A problem :(

I cannot make TimeVariable thing as Time - TimeVariable Expires
> It doesn't act as a variable :banghead:

Right now the TimeVariable is

Name: TimerVariable
Type: Time Window
[ ] Array Size [1 ]
Initial Value: None

Clear Value OK Cancel

Is there something wrong with my variable?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
> Type: Time Window

That should be Type: Timer. Not Timer Window. That's what the TimerWindowVariable is for. Also, don't use an array.

As a side note, don't double post. Edit your existing posts. ;)
 
R

r2yneth

Guest
Hmmm

> How do I make it so that the waves will now attack random players instead of standing at spawn :)

Also, I was wondering how I could make it so that once one wave is done it will not appear again and the next level with be a different wave

Thanks a lot! :eek:
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
> How do I make it so that the waves will now attack random players instead of standing at spawn

Well, when you create them, order them to attack to a random player's starting location or something similar.

> Also, I was wondering how I could make it so that once one wave is done it will not appear again and the next level with be a different wave

Different creeps? You just keep getting more advanced, don't you? :p You should use an Integer variable to track which level of creeps it is, then you can store all of your creep types into a unit-type array variable, then you can use the integer as the index of the variable to spawn the right type of unit.
 
R

r2yneth

Guest
lol :)

Sounds extremely difficult

I was just thinking of it like a Tower Defense where after Level One has ended a timer will appear and then Level Two will start etc

Is that super hard to make? :(
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
> Is that super hard to make?

It depends. It depends on how good you want it to be. I make a TD not too long ago. This is my main timer trigger:

Code:
Timer 2
    Events
        Player - Player 12 (Brown)'s Food used becomes Equal to 0.00
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Level_Number Equal to 25
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        FinalComparison Equal to True
                    Then - Actions
                        Set FinalComparison = False
                    Else - Actions
                        Set FinalComparison = True
            Else - Actions
        Set Player_Count = (Number of players in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User))))
        Set Level_Number = (Level_Number + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                FinalComparison Equal to True
            Then - Actions
                Set Level_Number = 25
                Wait 0.50 seconds
                For each (Integer A) from 1 to 4, do (Actions)
                    Loop - Actions
                        Set PlayerEscCount[(Integer A)] = 0
                Set CinematicOn = True
                Set Tempgroup = (Units in (Playable map area))
                Unit Group - Pick every unit in Tempgroup and do (Actions)
                    Loop - Actions
                        Unit - Pause (Picked unit)
                Custom script:   call DestroyGroup (udg_Tempgroup)
                Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 1.00 seconds
                Cinematic - Send transmission to (All players) from a Player 12 (Brown) Al Capone (1) named Al Capone at (Center of (Playable map area)): Play No sound and display So, my men didn't s....  Modify duration: Add 11.00 seconds and Wait
                Wait 13.00 seconds
                Set CinematicOn = False
                Wait 0.50 seconds
                Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 1.00 seconds
                Cinematic - Clear the screen of text messages for (All players)
                Set Tempforce = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
                Player Group - Pick every player in Tempforce and do (Actions)
                    Loop - Actions
                        Player - Add (10 x Level_Number) to (Picked player) Current gold
                Game - Display to (All players) the text: (The Final Level will start in  + ((String(Time_Left)) +  seconds!))
                Countdown Timer - Change the title of Spawn_Time_Window to Final Level in: 
                Countdown Timer - Show Spawn_Time_Window
                Countdown Timer - Start Spawn_Time as a One-shot timer that will expire in Time_Left seconds
                Custom script:   call DestroyForce (udg_Tempforce)
                Set Tempgroup = (Units in (Playable map area))
                Unit Group - Pick every unit in Tempgroup and do (Actions)
                    Loop - Actions
                        Unit - Unpause (Picked unit)
                Custom script:   call DestroyGroup (udg_Tempgroup)
                For each (Integer A) from 1 to 4, do (Actions)
                    Loop - Actions
                        Multiboard - Minimize TowerInfoBoard[(Integer A)]
                        Multiboard - Maximize TowerInfoBoard[(Integer A)]
                Trigger - Run Update Leaderboard <gen> (checking conditions)
                Trigger - Turn off (This trigger)
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Level_Number Equal to 26
            Then - Actions
                Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
                    Loop - Actions
                        Game - Victory (Picked player) (Show dialogs, Show scores)
                Skip remaining actions
            Else - Actions
        Set Tempforce = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
        Player Group - Pick every player in Tempforce and do (Actions)
            Loop - Actions
                Player - Add (10 x Level_Number) to (Picked player) Current gold
        Game - Display to (All players) the text: (Level  + ((String(Level_Number)) + ( will start in  + ((String((Integer(Time_Left)))) +  seconds!))))
        Countdown Timer - Change the title of Spawn_Time_Window to (Level  + ((String(Level_Number)) +  in:))
        Countdown Timer - Show Spawn_Time_Window
        Countdown Timer - Start Spawn_Time as a One-shot timer that will expire in Time_Left seconds
        Custom script:   call DestroyForce (udg_Tempforce)
        For each (Integer A) from 1 to 4, do (Actions)
            Loop - Actions
                Multiboard - Minimize TowerInfoBoard[(Integer A)]
                Multiboard - Maximize TowerInfoBoard[(Integer A)]
        Trigger - Run Update Leaderboard <gen> (checking conditions)
        Trigger - Turn off (This trigger)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Level_Number Equal to 5
            Then - Actions
                Set GoldBounty = (GoldBounty + 3)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Level_Number Equal to 10
            Then - Actions
                Set GoldBounty = (GoldBounty + 3)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Level_Number Equal to 15
            Then - Actions
                Set GoldBounty = (GoldBounty + 3)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Level_Number Equal to 20
            Then - Actions
                Set GoldBounty = (GoldBounty + 3)
            Else - Actions

Ridiculous, right? Well, yes. Because it deals with a lot of stuff. You want a different creep type for each level, right? Here's my spawning trigger:

Code:
Spawn
    Events
        Time - Spawn_Time expires
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                FinalComparison Equal to True
            Then - Actions
                Countdown Timer - Hide Spawn_Time_Window
                Set Temppoint = (Center of Spawn Region <gen>)
                Unit - Create 1 Al Capone (1) for Player 12 (Brown) at Temppoint facing Default building facing degrees
                Unit - Set life of (Last created unit) to (25.00 x (Real(Player_Count)))%
                Trigger - Add to Teleportation Ability <gen> the event (Unit - (Last created unit) Takes damage)
                Trigger - Add to Critical Strike Ability <gen> the event (Unit - (Last created unit) Takes damage)
                Custom script:   call RemoveLocation (udg_Temppoint)
                Trigger - Turn on Timer 2 <gen>
                Skip remaining actions
            Else - Actions
        Countdown Timer - Hide Spawn_Time_Window
        For each (Integer SpawnLoop) from 1 to Player_Count, do (Actions)
            Loop - Actions
                Set Temppoint = (Center of Spawn Region <gen>)
                Unit - Create (Difficulty_Level x 2) Creatures1[Level_Number] for Player 12 (Brown) at Temppoint facing Default building facing degrees
                Set Tempgroup = (Last created unit group)
                Unit Group - Pick every unit in Tempgroup and do (Actions)
                    Loop - Actions
                        Trigger - Add to Teleportation Ability <gen> the event (Unit - (Picked unit) Takes damage)
                        Trigger - Add to Critical Strike Ability <gen> the event (Unit - (Picked unit) Takes damage)
                Custom script:   call DestroyGroup (udg_Tempgroup)
                Unit - Create (Difficulty_Level x 2) Creatures2[Level_Number] for Player 12 (Brown) at Temppoint facing Default building facing degrees
                Set Tempgroup = (Last created unit group)
                Unit Group - Pick every unit in Tempgroup and do (Actions)
                    Loop - Actions
                        Trigger - Add to Teleportation Ability <gen> the event (Unit - (Picked unit) Takes damage)
                        Trigger - Add to Critical Strike Ability <gen> the event (Unit - (Picked unit) Takes damage)
                Custom script:   call DestroyGroup (udg_Tempgroup)
                Unit - Create (Difficulty_Level x 2) Creatures3[Level_Number] for Player 12 (Brown) at Temppoint facing Default building facing degrees
                Set Tempgroup = (Last created unit group)
                Unit Group - Pick every unit in Tempgroup and do (Actions)
                    Loop - Actions
                        Trigger - Add to Teleportation Ability <gen> the event (Unit - (Picked unit) Takes damage)
                        Trigger - Add to Critical Strike Ability <gen> the event (Unit - (Picked unit) Takes damage)
                Custom script:   call DestroyGroup (udg_Tempgroup)
                Custom script:   call RemoveLocation (udg_Temppoint)
                Wait 3.00 seconds
        For each (Integer A) from 1 to Player_Count, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Level_Number Equal to Level_Comparison
                        Level_Number Not equal to 25
                    Then - Actions
                        Set Temppoint = (Center of Spawn Region <gen>)
                        Unit - Create Difficulty_Level Bosses[(Level_Number / 5)] for Player 12 (Brown) at Temppoint facing Default building facing degrees
                        Set Tempgroup = (Last created unit group)
                        Unit Group - Pick every unit in Tempgroup and do (Actions)
                            Loop - Actions
                                Trigger - Add to Teleportation Ability <gen> the event (Unit - (Picked unit) Takes damage)
                                Trigger - Add to Critical Strike Ability <gen> the event (Unit - (Picked unit) Takes damage)
                        Custom script:   call DestroyGroup (udg_Tempgroup)
                        Custom script:   call RemoveLocation (udg_Temppoint)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Integer A) Equal to Player_Count
                            Then - Actions
                                Set Level_Comparison = (Level_Comparison + 5)
                            Else - Actions
                    Else - Actions
        Trigger - Turn on Timer 2 <gen>

The thing is, this is the ONLY spawning trigger. It's all there. Now, there is an easier way to do what you want. You still need the Integer so you know what level you are on, but then you could just use a simple If/Then/Else. If LevelVariable Equal to 1, then spawn <This Type>. If LevelVariable Equal to 2, then spawn <Other Type>. If you wish, here's a Tower Defense tutorial:

http://www.thehelper.net/forums/showthread.php?t=45616

It's very detailed. I suggest you take a look.
 
R

r2yneth

Guest
whoa! thanks so much!!! :)

I'm really bad at this :(

My Trigger for spawning/attacking is like this

Code:
Spawn Videem
    Events
        Time - TimerVariable expires
    Conditions
    Actions
        Countdown Timer - Hide TimerWindowVariable
        Unit - Create 15 F for Player 12 (Brown) at (Center of Region 008 <gen>) facing Default building facing degrees
        Unit - Create 15 F for Player 12 (Brown) at (Center of Region 008 Copy <gen>) facing Default building facing degrees
        Unit - Create 15 F for Player 12 (Brown) at (Center of Region 008 Copy 2 <gen>) facing Default building facing degrees
        Unit - Create 15 F for Player 12 (Brown) at (Center of Region 008 Copy 3 <gen>) facing Default building facing degrees
        Unit - Create 15 Ffor Player 12 (Brown) at (Center of Region 008 Copy 4 <gen>) facing Default building facing degrees
        Unit - Create 15 F for Player 12 (Brown) at (Center of Region 008 Copy 5 <gen>) facing Default building facing degrees
        Unit - Create 15 F for Player 12 (Brown) at (Center of Region 008 Copy 6 <gen>) facing Default building facing degrees
        Unit - Create 15 F for Player 12 (Brown) at (Center of Region 008 Copy 6 <gen>) facing Default building facing degrees
        Unit Group - Order (Units owned by Player 12 (Brown)) to Attack-Move To ((Random player from (All allies of Player 1 (Red))) start location)

Is there a solution to order to attack a random player instead of a start location? Thanks in advance! :)
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
> Is there a solution to order to attack a random player instead of a start location? Thanks in advance!

It depends. What do you want the creeps to attack? You can order them to attack about anything you want. Though, you may want to read up on leaks since those kinds of things usually use Unit Groups and Points, which leak.

Also, don't bump your thread more than once per 24 hours.
 
R

r2yneth

Guest
Oh sorry / Didn't know :(

How do you make the units attack a random player?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
891
> How do you make the units attack a random player?

'Player' is not very specific. This could possibly indicate hundreds of locations. Do players have specific bases that the creeps should attack?
 
R

r2yneth

Guest
Nope, its like a maze and everybody is running around while creeps spawn from the corners - Wondering how to make the creeps attack all players randomly
 
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