Help me with SpawnTimer

velnias

New Member
Reaction score
13
Code:
Events
Conditions
Actions
    Wait 1.00 seconds
    Countdown Timer - Create a timer window for SpawnTimer with title Next Spawn in:
    Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in 45.00 seconds
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            (Number of units in (Units in (Playable map area) owned by Player 12 (Brown))) Greater than 0
        Then - Actions
            Countdown Timer - Pause SpawnTimer
        Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Number of units in (Units in (Playable map area) owned by Player 12 (Brown))) Less than or equal to 3
                Then - Actions
                    Countdown Timer - Resume SpawnTimer
                Else - Actions
                    Player Group - Pick every player in (All players) and do (Actions)
                        Loop - Actions
                            Countdown Timer - Show (Last created timer window)

Wat i do wrong my spawntimer dont resume :banghead:
 

n[u]ll

You can change this now in User CP.
Reaction score
93
What are you trying to do? And what's the problem?
 

velnias

New Member
Reaction score
13
This trigger - spawn new wave. And i wana make pause.
example
First wave start. Then no more enemy units, starts spawntimer and after 45 sec. spawn new wave but my spawntimer dont resume after pause.

Now then enter the last unit in start region spawntimer start at one. No time for killing units.

Sry for bad english :p


.
 

cleeezzz

The Undead Ranger.
Reaction score
268
i don't think the Less than or equal to 3 thing will work because,

above it you have a Greater than 0

if its less than or equal to 3
3 2 1 0

except for the 0, the 3 other numbers are greater than 0 so the timer will only start when theres 0 units left

EDIT: now that i look at it, it depends, i cant tell cuz you didnt put any indentations

is the 2nd If then else under the ELSE actions
or its a separate action

(dont double post) you can only bump once a day.
 

cleeezzz

The Undead Ranger.
Reaction score
268
no i said dont put it under the Else action

Code:
Events
Conditions
Actions
    Wait 1.00 seconds
    Countdown Timer - Create a timer window for SpawnTimer with title Next Spawn in:
    Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in 45.00 seconds
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        If - Conditions
            (Number of units in (Units in (Playable map area) owned by Player 12 (Brown))) Greater than 0
        Then - Actions
            Countdown Timer - Pause SpawnTimer
        Else - Actions
            Do Nothing
   

     If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Number of units in (Units in (Playable map area) owned by Player 12 (Brown))) Less than or equal to 3
                Then - Actions
                    Countdown Timer - Resume SpawnTimer
                Else - Actions
                    Player Group - Pick every player in (All players) and do (Actions)
                        Loop - Actions
                            Countdown Timer - Show (Last created timer window)

so are you sure brown doesn't have like spawning buildings? those count as units too.

and whats the event?

post the trigger that adds the event
 

velnias

New Member
Reaction score
13
my spawn triger start this spawntimer then he need start next wave so dont need event and player brown have only start location.
 

Sooda

Diversity enchants
Reaction score
318
> Wat i do wrong my spawn timer dosn' t resume ?

Timers never resume you can only pause them. Then you have to restart them again. They can' t be resumed but only restarted with new values. Instead try doing this:
Code:
Create Spawn Timer
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    Actions
        Unit Group - Remove all units from tempGroup
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Unit Group - Add (Picked unit) to tempGroup)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in tempGroup) Less than or equal to 3
            Then - Actions
                Countdown Timer - Create a timer window for SpawnTimer with title Next Spawn in:
                Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in 45.00 seconds
            Else - Actions
Code:
Spawn Timer Expires
    Events
        Time - SpawnTimer expires
    Conditions
    Actions
        Game - Display to (All players) the text: New wave!
Variables used:
"tempGroup" is unit group variable with default starting value.

For inspiration:
Tower Defense Tutorial by Andrewgosu
 

velnias

New Member
Reaction score
13
Conditions
(Owner of (Dying unit)) Equal to Player 12 (Brown)


(Number of units in TempGroup) Less than or equal to 1
if number = 3 start 2 spawntimers :D

but big thanks sooda its work :)

For example if i trying to make new spawn then no units in tempGroup useing (Number of units in tempGroup) equal to 0 but its dont work (dont create spawntimer).

Code:
Create Spawn Timer
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (dying)) Equal to Player 12 (Brown)
    Actions
        Unit Group - Remove all of (Units in (Playable map area) from tempGroup
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Unit Group - Add (Picked unit) to tempGroup)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
              [U]  (Number of units in tempGroup) equal to 0[/U]            Then - Actions
                Countdown Timer - Create a timer window for SpawnTimer with title Next Spawn in:
                Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in 45.00 seconds
            Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top