Spawning after last spawns deaths

  • Thread starter Thread starter bobdakilla
  • Start date Start date
B

bobdakilla

Guest
Spawning times

Well my title pretty much explains it, ive got no code and was looking for a way to automatically start a wave of creeps after the deaths of the last wave. Thats really it, so tips and code are very welcome!
 
I forget the code but i think it is something like this:

one variable required = level (integer) initial value = 0/1

Code:
Events - Player 12 (brown) food limit becomes equal to 0

Conditions - none

Actions - If (level = 1) then do (create (x) (units) at (random point in/center of (region)) facing (???)) else do (if (level = 2 ) then do (create (x) (units)...

and so on until your last level.

Good luck with TD (it is a TD isnt it?)

~Jindo
 
Thanks, nah its not a TD. Its alittle something different, kinda like a survival game.
 
one or two triggers can be used depending on if you plan on changing the waves a lot, then you can make one to set up all levels and one to plan them all, or you can just change them in one trigger. to start waves of different creeps whether it is a TD or anything else its pretty much the same...You will need a variable, one will work, it sets the levels, but two if your planning on changing the creeps in each level a few times, use two or more if you want to change the number of creeps too...

Variables: LEVEL (integer) CREEPS (unit type array of how ever many waves your going to have)

Code:
Events:
          Player 12 (brown) food limit becomes equal to 0
Conditions:
Actions:
          if then else multiple conditions
             if: LEVEL is equal to 1 
             then: create x number of CREEPS(1) in center of creepspawn gen
                   set LEVEL to LEVEL + 1
          if then else multiple conditions
             if: LEVEL is equal to 2 
             then: create x number of CREEPS(2) in center of creepspawn gen
                   set LEVEL to LEVEL + 1
          if then else multiple conditions
             if: LEVEL is equal to 3 
             then: create x number of CREEPS(3) in center of creepspawn gen
                   set LEVEL to LEVEL + 1
          if then else multiple conditions
             if: LEVEL is equal to 4 
             then: create x number of CREEPS(4) in center of creepspawn gen
                   set LEVEL to LEVEL + 1
          etc etc etc....
you get it right?
 
With some small change that trigger gets much more readable:

create x number of CREEPS(LEVEL) in center of creepspawn gen
set LEVEL to LEVEL + 1
 
True...
 
Having this vars:
integer CreepLevel
unit-group CreepGroup
unit-type array CreepUnitType
integer array CreepUnitQuantity

you could code something like this:
Code:
Init creep respawn
    Events
        Map initialization
    Conditions
    Actions
        -------- Init the array with the creep unit-types
        Set CreepUnitType[0] = <First unit type>
        Set CreepUnitType[1] = <Second unit type>
        Set CreepUnitType[2] = <Third unit type>
        Set CreepUnitType[3] = <Fourth unit type>
        -------- Set the number of units for each unit-type for level 1
        Set CreepUnitQuantity[0] = 2
        Set CreepUnitQuantity[1] = 1
        Set CreepUnitQuantity[2] = 0
        Set CreepUnitQuantity[3] = 0
        -------- Level 2 --------
        Set CreepUnitQuantity[4] = 4
        Set CreepUnitQuantity[5] = 1
        Set CreepUnitQuantity[6] = 0
        Set CreepUnitQuantity[7] = 0
        -------- Level 3 --------
        Set CreepUnitQuantity[8] = 4
        Set CreepUnitQuantity[9] = 2
        Set CreepUnitQuantity[10] = 1
        Set CreepUnitQuantity[11] = 0
        -------- Level 4 --------
        Set CreepUnitQuantity[12] = 6
        Set CreepUnitQuantity[13] = 3
        Set CreepUnitQuantity[14] = 2
        Set CreepUnitQuantity[15] = 0
        -------- Level 5 --------
        Set CreepUnitQuantity[16] = 8
        Set CreepUnitQuantity[17] = 4
        Set CreepUnitQuantity[18] = 2
        Set CreepUnitQuantity[19] = 1
        -------- Level ... --------
        ...
        -------- Creating first respawn --------
        Trigger - Run Creep respawn <gen> (ignoring conditions)
Code:
Creep respawn
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is in CreepGroup) Equal to True
        (All units of CreepGroup are dead) Equal to True
    Actions
        Unit Group - Remove all units from CreepGroup
        For each (Integer A) from 0 to 3, do (Actions)
            Loop - Actions
                Unit - Create CreepUnitQuantity[((CreepLevel x 4) + (Integer A))] CreepUnitType[(Integer A)] for Neutral Hostile at (Random point in (Area))
                Unit Group - Add all units of (Last created unit group) to CreepGroup
        Set CreepLevel = (CreepLevel + 1)
You can have any number of unit-types, only changing the "x 4" to the number of unit-types, the range in the For clausule and adding data to the CreepUnitQuantity array.

[EDIT] Sorry, I forgot to incr the CreepLevel var.
 
Allright well thanks for all the input first of all! I was wondering, code doesn't seem to work, any suggestions?


Code:
Waves
    Events
        Player - Player 12 (Brown)'s Food max becomes Equal to 0.00
        [B]In the line above, i used food max, food cap, and food used for testing to see if any would work.[/B]

    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Level Equal to 1
            Then - Actions
                Game - Display to (All players) for 3.00 seconds the text: Wave 1!
                Unit - Create ((Number of players) + 1) Orc slave for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing (270.0) degrees
                Set Level = (Level + 1)
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Level Equal to 2
            Then - Actions
                Game - Display to (All players) for 4.00 seconds the text: Wave 2!
                Unit - Create 3 Orc slave for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing (270.0) degrees
                Unit - Create ((Number of players) + 1) Water Elemental (Level 1) for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing (270.0) degrees
                Set Level = (Level + 1)
            Else - Actions
                Do nothing

Continues on, and on, and on.....
 
it should be food used is equal to 0, and you might want to have another event that goes at 5 or 10 or however long you want to run the first level, since it starts at 0 and doesnt "become" 0.
 
Ok, i understand the food used = 0; but the rest im not sure on could you or anyone else expand on that?
 
Well is there a way i can set food used= 5 in all the triggers or something so that when all the spawns are killed it will goe to 0 and when it goes to the next trigger it will add up the food again, right?
 
Make sure that all the creeps have a food number, as in they use food. That way when the last one dies, food used will become 0. In free triggers I have a map where I did that exact thing. The triggers for it are currently disabled because I changed the way my TD works, but they're still there, in case you want an example. Good luck with your survival map =)
 
I have a question, i understand how to make level 1- level 30. what what trigger do i use to start level 1? to make the creeps?(how do i make level 1 start so it'l run threw level 30)
 
At the beggining do this

set (level variable) = Level variable +1

so that will start level 1
 
It's not working, and this is what I have

Set level
Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
Set Level = (Level + 1)

Levels
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 Equal to 1
Then - Actions
Unit - Create 1 Footman for Player 12 (Brown) at (Center of purple <gen>) facing Default building facing degrees
Unit - Create 1 Footman for Player 12 (Brown) at (Center of Red Spawn <gen>) facing Default building facing degrees
Unit - Create 1 Footman for Player 12 (Brown) at (Center of blue1 <gen>) facing Default building facing degrees
Unit - Create 1 Footman for Player 12 (Brown) at (Center of purple <gen>) facing Default building facing degrees
Set Level = (Level + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Level Equal to 2
Then - Actions
Unit - Create 1 Knight for Player 12 (Brown) at (Center of purple <gen>) facing Default building facing degrees
Unit - Create 1 Footman for Player 12 (Brown) at (Center of Red Spawn <gen>) facing Default building facing degrees
Unit - Create 1 Footman for Player 12 (Brown) at (Center of blue1 <gen>) facing Default building facing degrees
Unit - Create 1 Footman for Player 12 (Brown) at (Center of purple <gen>) facing Default building facing degrees
Else - Actions
Do nothing
 
ok scrap that first trigger, and add to the second the event after .01 secs elapsed time and make sure the variable lvl is set to be at 1 by default.
 
Well im kinda stuck again. I have 2 triggers now b/c i decided it would make it easier to see what im doing. One is "Start" and the other, "waves"...

Code:
Start
    Events
        Time - Elapsed game time is 10.00 seconds
    Conditions
    Actions
        Game - Display to (All players) for 3.00 seconds the text: Wave 1!
        Unit - Create ((Number of players) + 1) Orc slave for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing (270.0) degrees
        Set Level = (Level + 1)


Code:
Waves
    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 Equal to 1
            Then - Actions
                Game - Display to (All players) for 4.00 seconds the text: Wave 2!
                Unit - Create 3 Orc slave for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing (270.0) degrees
                Unit - Create ((Number of players) + 1) Water Elemental (Level 1) for Player 12 (Brown) at (Player 12 (Brown) start location) facing Default building facing (270.0) degrees
                Set Level = (Level + 1)
            Else - Actions

It seems to work till the wave in the trigger "Start" is killed(also in this trigger Set Level= Level + 1 to start the wave in the "waves" trigger above), when that happens all my creeps are spawned! Whats going on if my code seems to be right?
 
Another Way you could make this

Code:
    Events
        Player - Player 12 (Brown)'s Food used becomes Equal to 0.00
        Time - Elapsed game time is X seconds
    Conditions
    Actions
        If (LEVEL Greater than 0) then do (Game - Display to (All players) the text: (Level  + ((String(LEVEL)) +  Compleated Next lvl in (X) seconds))) else do (Do nothing)
        Set LEVEL = (LEVEL + 1)
        Countdown Timer - Start Timer as a One-shot timer that will expire in X seconds
        Countdown Timer - Create a timer window for (Last started timer) with title Next lvl in
        Wait X seconds
        Countdown Timer - Destroy (Last created timer window)
        For each (Integer A) from 1 to (The number of creeps you want), do (Unit - Create 1 MonsterType[LEVEL] for Player 12 (Brown) at (Random point in (Your Region)) facing Default building facing degrees)

For this i have used 3 Variables
-MonsterTypes (Unit type-array)
-Level (Timer)
-LEVLE (integre)

This way players will have x seconds before first wave starts and you will only need 1 trigger to spawn each round if you want diffrent kinds of monsters at the same time just add another MonsterType (unit type-array)

But you will also need a second trigger to set up the monsters that spawn each round witch could look like this

Code:
    Events
        Map initialization
    Conditions
    Actions
        Set MonsterType[1] = Peasant
        Set MonsterType[2] = Footman
        Set MonsterType[3] = Knight
        Set MonsterType[4] = Rifleman
this would make first round spawn peasants nxt round footmen and so on
Hope this can help if you not already have found a solution to your problem
 
I would do something like
Code:
Event
    Time elapsed is 30 seconds
Conditions
    None
Actions
    Run Next Level trigger ignoring conditions
And then in the "Next Level" trigger, spawn the creeps, and so on...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Hey Ghan, whatever cron job its part of its not running its been the same for days. If it does not work can we remove it?
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top