They Are Billions

They Are Billions

Custom Levels for They Are Billions
Add custom levels to They Are Billions by subscribing to these workshop items!
Learn More
This topic has been locked
Mr_Darwoo 12 19 Mar, 2021 @ 8:56am
Random Map Unit Generators
What generators do I have to stipulate in the events for zombie generation when I choose a random map?

I have tried switching to manual and creating N S E W, then switching back to random. After I save/exit, when I go back, the generators have disappeared.

When I tested the map, no zeds were created. I tried removing the generator references, but again, nothing popped out.

Can anyone help me please?

thanks.
< >
Showing 1-5 of 5 comments
Random map = Random generated map + normal N-E-S-W spawns. If you want to setup waves on random generated, just set up a wave event with with the spawn area(s).

Manual = normal N-E-S-W spawns but you can modify them and add more.
Mr_Darwoo 12 19 Mar, 2021 @ 9:31am 
I thought they might be N E S W, and I specified "N or E or S or W" in my events, but no zombies were created.

What I'm trying to do, is to release a couple of zombies from a random generator every time a player builds something, relative to the workers the building uses/houses. eg a tesla, and one runner will be generated, or 2 runners for a tent, 4 for a sawmill etc.

I have a variable set up for each type of building. In the Event script, I start with a block with a condition, Count(entity) >Variable
I also have a TEMP variable.
This block then executes the code TEMP=Count(Entity)-Variable;Variable=Count(entity) to give the variable the value of the current count for the next time it is called.
It then goes to a loop command.
From there another block has the condition TEMP >0
Then the Generate Units command comes off this to generate however many zombies for one building.
Then another block executing a code TEMP=TEMP-1.
By my way of thinking, this should then loop back and generate zeds until TEMP has no value.
Once the variable Temp=0, a second block coming off the TEMP >0 block has the exit loop command.

I tried to set it up like this so that each loop generates the zeds from a random generator for each one of the particular buildings.

Is this maybe too complicated?
Mr_Darwoo 12 19 Mar, 2021 @ 10:32am 
I took the condition out of the block in the script and put it on the schedule of the event. That seems to have fixed the generating of zeds when buildings are created.

My waves however, seemed a bit stuffed. The first two were announced N and S, but they came from the East. :-( The third wave was announced W and came from the West thankfully.
JustGoFly 6 20 Mar, 2021 @ 10:38am 
That loop will work, but will eventually slow your game. You might want to do something where you check if count>9, then loop count/10 times, and spawn 10 zombies at a time. You could do this again if count >99, and loop spawning 100 zombies at a time. I doubt you'd ever want to spawn more than 999 zombies at a time, so you could cap your spawns at that next point.

Also using logging to monitor your game while playing. I use NotePad++ and configured it to autoload the file when it changes, so I can monitor the game, or use some form of "Tail" application to monitor a continuously growing log file.

I use blocks ONLY for condition statements and execute code for all execute codes. And I never put conditions in execute code blocks. This makes your code easier to read and debug.
Mr_Darwoo 12 21 Mar, 2021 @ 4:27am 
@JustGoFly Thanks for that. I ended up deleting the blocks and only using a Loop anyway. Works much better. And I had my variables displaying in the notification window as I was going while testing so I could see that they were working properly.
< >
Showing 1-5 of 5 comments
Per page: 1530 50