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
ramboing 1 23 Oct, 2022 @ 10:47am
is there an if-then?
Is there any way to do something like, for example text "You have chosen {if Choice=1} +1 range {if Choice=2} +20% damage."

Or to do an if-then within a single execute code entry: if Choice=1, then ApplyRules("RangerAttack Range +1") if Choice=2...

Update: There doesn't seem to be any kind of IF statement that works within text, but "boolean" variables actually store a string instead of a boolean, so you can have your choices store the proper text in a variable, and then set your button text to {variable}.
Last edited by ramboing; 31 Oct, 2022 @ 8:43pm
< >
Showing 1-4 of 4 comments
Hello!

Yes there is:

The condition rectangle in the events tab, you can see Execute Code (you can see it too in a lot of other scripts).

For your example :
1) Create a custom variable called Choice 1
2) Create an event in the Schedule tab and switch to scripts. Create an execute code. In the rectangle next to Execute Code (that you can see when clicking on your execute code script), write Choice +=1.
3) Create an other event and repeat this operation but:
4) Write in the condition rectangle Choice=1 (This is your IF)
5) Write ApplyRules(WhatEverYourIdeaIs") (this is your THEN - this means that if Choice=1 -and only 1, not below and not above - it will apply this effect)

Creating a custom variable is important to trigger anything you would like to script in the game. Always select value (the variable will be measured in numbers), as boolean is bugged. The name doesn't really matter as long as you keep track of what triggers what.

All you need after this operation is to select a starting time and if it has to repeat or not.

Btw, you can also set a condition to trigger choice 1 (e.g: the number of specific infected killed)

Hope it helped!
Last edited by KarEssMoua [BHVR]; 24 Oct, 2022 @ 5:15am
ramboing 1 25 Oct, 2022 @ 6:13am 
I haven't finished processing and understanding that yet, but I think I need to make a separate event for each possibility? I was hoping there was some way to use just one text window event and be able to change the text displayed depending on what the player picked for Choice1, Choice2, Choice3, etc, so one window could display all of the player's choices at once. Like:

Tech Tree:
Ranger +1 range
Soldier +20% damage
Sniper 50% move speed
ramboing 1 26 Oct, 2022 @ 2:34pm 
Actually, the window that pops up at the start of "29 Years Later Phase 24: The Alpha and the Omega", is exactly what I want to do. It has about 10 buttons, and each one tells you your current choice.

For example, one button says something like "KarEssMoua did not factor / don't know". Selecting it takes you to a choice "KarEssMoua did not factor / don't know" "KarEssMoua survived" "KarEssMoua was killed". Once you pick, it takes you back to the main window, and the button has appropriate text. I doubt the mapmaker made a trigger for every combination of choices you can make, so how did he make all that text change with your choices?
Last edited by ramboing; 26 Oct, 2022 @ 2:35pm
Hello!

I think for what you need, it would be better if I'm showing you how it works. You can add me if you want me to show you how it works
< >
Showing 1-4 of 4 comments
Per page: 1530 50