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
Directly reference a variable?
Why can't I directly input a variable into stuff, like the zombie spawn counts menu?
IE
Player chooses "hard difficulty" > zombie spawns multiplier variable "DIF" is set to 4 > wave event you can't input "DIF" in the number of zombies to spawn.

I have a temporary workaround in looping with DIF=(DIF-1) and IF DIF=0 then exitloop: but this doesn't work for my second project, a zombie assault map, where the numbers are far higher meaning it loops like 600 times causing lag.
< >
Showing 1-5 of 5 comments
budisourdog 4 18 Jul, 2024 @ 1:10pm 
(that loop example is wrong you actually have to use a second variable that copies the value of the 1st in your loop, and have it reset itself to the value of the real variable after the loop exits)
You can set up this variable at the beginning of your level, and then use this variable to be a condition for wave size.

Meaning if a player set the difficulty to 4, you can set the condition for your waves in the condition cell of a wave event.

You can also repeat the wave depending of the difficulty, or rather increase zombies stats to avoid lags with massive waves.
budisourdog 4 19 Jul, 2024 @ 1:15pm 
The biggest problem is that the # can and will vary from 1-400 as the player buys more units and scales the waves.
I want to just make it a 1 line arithmetic literally VAR*zombies.
Looping one at a time works, but that lag stacks up fast.
I could maybe rig up a convoluted series of loops to process numbers in bulk by like VAR>=50... dammit I think that might work its gonna be so cursed.
You can do that, but to deminish the lags you can set up higher "checkpoints". So instead of

If 1 soldier created = 1 runner
you can go for
10 soldiers created = 10 runners

You can also mix infected to tougher up your waves:

Like
Condition in an event wave
Count(Soldier)>=10
You spawn one chubby

Though, to create a loop, that would require one or two additional variables so you can scale up chubbies automatically every 10 additional soldiers
budisourdog 4 22 Jul, 2024 @ 4:35pm 
yes I was most concerned about the zombie assault map (like "We are Billions")
I've re-written the entire code to be a loop with multiple blocks, 100, 50, 25, 10, and 1 each can trigger, subtract their values from the controlling variable, when it hits 0 the loop exits and resets the control variable to the correct value. Much less lag now.
< >
Showing 1-5 of 5 comments
Per page: 1530 50