Tower Defence Problem

xKxIxNxGx

New Member
Reaction score
3
ok, well i was making a TD, and well im stuck.. im trying to spawn my creeps... but only the first wave comes but, the rest dont..

here is all the triggers i think would matter to this question:

Code:
rounds
    Events
        Game - numberunits becomes Equal to 0.00
    Conditions
    Actions
        Game - Display to Player Group - Player 1 (Red) the text: (Congradulations for completing Level  + (String(level)))
        Player - Add ((level x 5) x 5) to Player 1 (Red) Current gold
        Set level = (level + 1)
        Game - Display to Player Group - Player 1 (Red) the text: The next round will...
        Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in 30.00 seconds
Code:
lvl1
    Events
        Time - SpawnTimer expires
    Conditions
        level Equal to 1
    Actions
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees

Code:
lvl2
    Events
        Time - SpawnTimer expires
    Conditions
        level Equal to 2
    Actions
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees
        Wait 1.00 seconds
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Timber Wolf for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees

the lvls continue as so... any ideas on how to make it better/fix/or completelly change everything for a much simplier way...
 

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
Try this:
Code:
For each (Integer A) from 1 to [COLOR="Blue"][B]<Your Number Of Waves>[/B][/COLOR], do (Actions)
    Loop - Actions
        Wait 1.00 seconds
        Unit - Create 1 Level_Units[Level] for Player 2 (Blue) at (Center of Region 000 <gen>) facing Default building facing degrees
        Unit - Create 1 Level_Units[Level] for Player 2 (Blue) at (Center of Region 012 <gen>) facing Default building facing degrees

Variables used
Level_Units (Array) = Unit Type
Level (Non-Array) = Integer

Level_Units[1] = Footman
Level_Units[2] = Rifleman
Level_Units[3] = Knight
And so on...

When the trigger runs when it will create Level_Units[Level].
So if Level equels to 1 when make Level_Units[1] (Footman)
If Level equels to 2 when make Level_Units[2] (Rifleman)
Etc...

Hope it helps :)
 

Exide

I am amazingly focused right now!
Reaction score
448
You don't have a trigger which checks if all creeps owned by Player 2 (blue) are dead or not?

What I did was to make a trigger which counts number of kills of the Evil Team (the computer). And spawn 60 units per level (30 in each spawn area)
Then check the death_count variable. And if it is equal to 60 then start countdown for level 2.

I dunno if you understood what I meant. But I'll try to make it clearer when I get home. (I can post my triggers then)
Also, You spawn 1 unit per second. Why not cut it down a little and spawn 10 units of *type* for *player*?

Code:
Actions
        Unit - Create 10 Spider for Player 2 (Blue) at (Center of Region 000 <gen>) facing 270       [I](270 if the spawn area is north, and you want creeps to go south. -Doesn't really matter I guess :P)[/I]
        Unit - Create 10 Spider for Player 2 (Blue) at (Center of Region 012 <gen>) facing 270

You should also rename your regions to something easier to associate with spawn areas. (For example; 'Spawn_Area1' and 'Spawn_Area2')

Hope it helped :p

EDIT: I wasn't trying to copy Mr Zero. He simply finished his post before I finished mine :p
 

xKxIxNxGx

New Member
Reaction score
3
ok 1) i did spawn my creeps every second because it reduces lag, if any.. and also it doesnt bunch in alot of creeps at once, because 1 for every lvl there are 2 waves of the same unit.. which is good because if the units go to this one section in the maze the second wave will meet the little of the first wave in a different spot, so you will have to organize your towers in a way it benifets the setup.. not sure if you understand but ya.. i will get going on that array thinger what ever.. i never understood what arrays were ment for, but i hope that will help.. but im going to bed.. its pretty late 1:03 am.... i have to get up in 4 and a half hours
 

Exide

I am amazingly focused right now!
Reaction score
448
It's not wrong to have the spawn trigger such as you do. But I thought it looked like an awful lot of work :p
Anyhow.
Arrays are variables which can store more than one value, I believe?
They are available in TFT only. So I don't know much about them :p
-Basically they help reducing triggers and variables, I think?

Variables are great, btw. I love integer variables :)
I am not 100% sure how they work. But they do :p
I believe they store a certain value. -Which you can set easily through the
'Set variable' action.

For example:

Code:
Events
A unit owned by Player 2 (blue) dies
Conditions
Actions
Set Death_Count to Death_count + 1

-This will increase the variable (an integer variable) by 1 per death of units belonging to Player 2.

I might be wrong in some aspects. But I hope it will help you :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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