(TD) Not spawning NEXT level.

KvickaN

TH.net Regular
Reaction score
24
Spawns the first level perfectly but not the second... I think it has something to do with player 12 brown's food... But I can't see whats the problem :S

Code:
SetLevels
    Events
        Map initialization
    Conditions
    Actions
        Set CreepLevels[1] = Stag Level [1]
        Set SpawnLevels[1] = 10
        Set CreepLevels[2] = Stag Level [2]
        Set SpawnLevels[2] = 10

Code:
WavesStart
    Events
        Time - AttackTimer expires
    Conditions
    Actions
        Set LVL = (LVL + 1)
        For each (Integer A) from 1 to SpawnLevels[LVL], do (Actions)
            Loop - Actions
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at (Center of Red Start <gen>) facing Default building facing degrees
                Game - Display to (All players) for 5.00 seconds the text: (Name of (Last created unit))
                Wait 0.70 seconds
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at (Center of Blue Start <gen>) facing Default building facing degrees
                Wait 0.70 seconds
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at (Center of Teal Start <gen>) facing Default building facing degrees
                Wait 0.70 seconds
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at (Center of Purple Start <gen>) facing Default building facing degrees

Code:
Countdown to dummy attack
    Events
        Time - Elapsed game time is 5.00 seconds
        Player - Player 12 (Brown)'s Food used becomes Equal to 0.00
    Conditions
    Actions
        Countdown Timer - Create a timer window for AttackTimer with title Next level in...
        Countdown Timer - Show AttackTimerWindow
        Countdown Timer - Start AttackTimer as a One-shot timer that will expire in 30.00 seconds
        Wait 30.00 seconds
        Countdown Timer - Hide AttackTimerWindow
        Countdown Timer - Destroy AttackTimerWindow

Code:
Set Countdown
    Events
        Time - Every 0.02 seconds of game time
    Conditions
    Actions
        Set AttackTimerWindow = (Last created timer window)

+rep to helpers :)
 

hi_im_bob

......and you are?
Reaction score
44
Does the timer show up before the second level? Might want to delete action Delete - AttackTimerWindow
 

Romek

Super Moderator
Reaction score
963
if you think its something to do with the food, Make a periodic test trigger which displays Browns food every 10 seconds or so. Then after you've finished the first wave, see what the food is.
 

Mittsies

New Member
Reaction score
24
instead of using food, use variables. Food can be very limiting and possibly not work well with triggers.

Set CreepLevels[0] = Footman (or some random unit you'll never use)

Code:
Untitled Trigger 001
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Set Count_Living_Units = (Number of living CreepLevels[LVL] units owned by Player 12 (Brown))

This will be your new countdown trigger

Code:
Countdown to dummy attack
    Events
        Time - Every 5.00 seconds of game time
    Conditions
        Count_Living_Units = 0
    Actions
        Countdown Timer - Create a timer window for AttackTimer with title Next level in...
        Countdown Timer - Show AttackTimerWindow
        Countdown Timer - Start AttackTimer as a One-shot timer that will expire in 30.00 seconds
        Wait 30.00 seconds
        Countdown Timer - Hide AttackTimerWindow
        Countdown Timer - Destroy AttackTimerWindow

Bam.
 

KvickaN

TH.net Regular
Reaction score
24
Hmm... It shows every 1 second that his food is 0 all the time...

Edit: Ah thanks :) I'll try, if I don't get it to work I'll post here again.

Edit: for some reason I can't do this: "
Code:
Set Count_Living_Units = (Number of living CreepLevels[LVL] units owned by Player 12 (Brown))
" I suck at variables...

PLEASE HELP!
 

Mittsies

New Member
Reaction score
24
Hmm... It shows every 1 second that his food is 0 all the time...

Edit: Ah thanks :) I'll try, if I don't get it to work I'll post here again.

Edit: for some reason I can't do this: "
Code:
Set Count_Living_Units = (Number of living CreepLevels[LVL] units owned by Player 12 (Brown))
" I suck at variables...

PLEASE HELP!

The Variable type of "Count_Living_Units" is an Integer.

Use the "Set Variable = ___" Action. Select Count_Living_Units, and scroll down to "Unit - Count living units owned by player".

Here's a screenshot...


2001751595637168518_rs.jpg


Hope this helps.
 

Mittsies

New Member
Reaction score
24
Let me know if my way works, or if you're still experiencing the same problem. Either way using variables versus food cap is much more simple and probably less laggy.
 

KvickaN

TH.net Regular
Reaction score
24
This is how it looks now:

Code:
Point Declaration
    Events
        Time - Elapsed game time is 0.02 seconds
    Conditions
    Actions
        Set Points[1] = (Center of Red Start <gen>)
        Set Points[2] = (Center of Blue Start <gen>)
        Set Points[3] = (Center of Teal Start <gen>)
        Set Points[4] = (Center of Purple Start <gen>)

Code:
SetLevels
    Events
        Map initialization
    Conditions
    Actions
        Set CreepLevels[1] = Stag Level [1]
        Set SpawnLevels[1] = 10
        Set CreepLevels[2] = Rabbit Level [2]
        Set SpawnLevels[2] = 10
        Set CreepLevels[3] = Rat Level [3]
        Set SpawnLevels[3] = 10
        Set CreepLevels[4] = Seal Level [4]
        Set SpawnLevels[4] = 10
        Set CreepLevels[5] = Sheep Level [5] (FAST)
        Set SpawnLevels[5] = 10

Code:
WavesStartRed
    Events
    Conditions
        (Number of living CreepLevels[LVL] units owned by Player 12 (Brown)) Less than or equal to 0
        (Player 1 (Red) slot status) Equal to Is playing
    Actions
        Set LVL = (LVL + 1)
        For each (Integer A) from 1 to SpawnLevels[LVL], do (Actions)
            Loop - Actions
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at Points[1] facing Default building facing degrees
                Game - Display to (All players) for 5.00 seconds the text: (Name of (Last created unit))
                Wait 0.70 seconds
                Do nothing

Code:
WavesStartBlue
    Events
    Conditions
        (Number of living CreepLevels[LVL] units owned by Player 12 (Brown)) Less than or equal to 0
        (Player 2 (Blue) slot status) Equal to Is playing
    Actions
        Set LVL = (LVL + 1)
        For each (Integer A) from 1 to SpawnLevels[LVL], do (Actions)
            Loop - Actions
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at Points[2] facing Default building facing degrees
                Wait 0.70 seconds
                Do nothing

Code:
WavesStartTeal
    Events
    Conditions
        (Number of living CreepLevels[LVL] units owned by Player 12 (Brown)) Less than or equal to 0
        (Player 3 (Teal) slot status) Equal to Is playing
    Actions
        Set LVL = (LVL + 1)
        For each (Integer A) from 1 to SpawnLevels[LVL], do (Actions)
            Loop - Actions
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at Points[3] facing Default building facing degrees
                Wait 0.70 seconds
                Do nothing

Code:
WavesStartPurple
    Events
    Conditions
        (Number of living CreepLevels[LVL] units owned by Player 12 (Brown)) Less than or equal to 0
        (Player 4 (Purple) slot status) Equal to Is playing
    Actions
        Set LVL = (LVL + 1)
        For each (Integer A) from 1 to SpawnLevels[LVL], do (Actions)
            Loop - Actions
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at Points[4] facing Default building facing degrees
                Wait 0.70 seconds
                Do nothing

Code:
StartWavesStart
    Events
        Time - Every 10.00 seconds of game time
    Conditions
    Actions
        Trigger - Run WavesStartRed <gen> (checking conditions)
        Trigger - Run WavesStartBlue <gen> (checking conditions)
        Trigger - Run WavesStartTeal <gen> (checking conditions)
        Trigger - Run WavesStartPurple <gen> (checking conditions)
 

KvickaN

TH.net Regular
Reaction score
24
Yeah it works now :) Oh and the animals is for the low levels :) Just so it looks easy in the beginning...
 

KvickaN

TH.net Regular
Reaction score
24
I thought it worked but the thing that Doesn't work now is that the creeps don't spawn on blue teal and purples spawn. I'll just upload the map and you who feel like it can have a look... =)
 

Exide

I am amazingly focused right now!
Reaction score
448
You can start by removing the 'Do nothing' functions from your triggers:

Code:
WavesStartRed
    Events
    Conditions
        (Number of living CreepLevels[LVL] units owned by Player 12 (Brown)) Less than or equal to 0
        (Player 1 (Red) slot status) Equal to Is playing
    Actions
        Set LVL = (LVL + 1)
        For each (Integer A) from 1 to SpawnLevels[LVL], do (Actions)
            Loop - Actions
                Unit - Create 1 CreepLevels[LVL] for Player 12 (Brown) at Points[1] facing Default building facing degrees
                Game - Display to (All players) for 5.00 seconds the text: (Name of (Last created unit))
                Wait 0.70 seconds
[COLOR="Red"]                Do nothing[/COLOR]

Also, you set LVL to (LVL + 1), each time you run the trigger, but then you do the same thing with next trigger (WavesStartBlue, WavesStartTeal, WavesStartPurple) - which SHOULD set LVL to level 4, after ten seconds. (I don't think you want that to happen.)
 

KvickaN

TH.net Regular
Reaction score
24
Also, you set LVL to (LVL + 1), each time you run the trigger, but then you do the same thing with next trigger (WavesStartBlue, WavesStartTeal, WavesStartPurple) - which SHOULD set LVL to level 4, after ten seconds. (I don't think you want that to happen.)

No I do not :)
 

worldeditors

Cool Member
Reaction score
1
this would be a better trigger.
Mine is for 1 player onli. You can add in more players if you want.

Code:
Spawn level1
    Events
        Time - Timer expires
    Conditions
    Actions
        Set LVL = (LVL + 1)
        Leaderboard - Change the value for Player 10 (Light Blue) in (Last created leaderboard) to LVL
        Game - Display to (All players) the text: Wave 1 of 50
        Countdown Timer - Destroy Timer_window
        If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 15 Footman for Player 1 (Red) at (Center of Region 000 <gen>) facing 0.00 degrees) else do (Do nothing)
        Trigger - Turn off (This trigger)
        Trigger - Run SPawn point lvl 1 <gen> (checking conditions)

Code:
SPawn point lvl 1
    Events
        Time - Every 1.00 seconds of game time
    Conditions
        (Number of units in (Units owned by Player 12 (Brown))) Equal to 0
    Actions
        Game - Display to (All players) the text: Wave 2 of 50
        Set LVL = (LVL + 1)
        Leaderboard - Change the value for Player 10 (Light Blue) in (Last created leaderboard) to LVL
        If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 15 Rifleman for Player 1 (Red) at (Center of Region 000 <gen>) facing 0.00 degrees) else do (Do nothing)
        Trigger - Turn off (This trigger)
 
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