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
(Map Editor Question) - Figuring out how to loop Scripts
I was doing some work on my current map... and wanted to loop an option, and then go back
https://imgur.com/a/qSxPfD7 (Here is the link to my current code)
But I want to try and get that too loop... but no matter what I do- I cannot get the loop to function: It either closes when I select an option like "Rangers (10x)" and then I have to open the menu again and go back to the options- or have it crash everytime I use the one in the picture
If anyone knows how to get this working- your help would be greatly appreciated
Last edited by RainbowThumb; 19 Feb, 2024 @ 11:48am
< >
Showing 1-5 of 5 comments
matthescratch 29 20 Feb, 2024 @ 2:23am 
It looks like that currently if you purchased some units then have no money left for any other units it will just loop forever and that could be your crash.
You need an exit loop with a condition so if you have no money left it will exit the menu.
RainbowThumb 5 20 Feb, 2024 @ 6:09am 
Originally posted by matthescratch:
It looks like that currently if you purchased some units then have no money left for any other units it will just loop forever and that could be your crash.
You need an exit loop with a condition so if you have no money left it will exit the menu.

That is not what I am wondering...
I want to purchase a unit- then continue purchasing till I am done- and then have a button to RETURN to the previous tab, and then again- closing the menu

Currently- how I have it set up- my menu will ENTIRELY close if I select an option, and I don't want that- I want to buy a unit- and then have the option to go back
Last edited by RainbowThumb; 20 Feb, 2024 @ 6:13am
matthescratch 29 20 Feb, 2024 @ 8:09am 
Hmm. Looking at your setup it should go back. Maybe the first choose option is throwing it off. Try getting rid of first choose option.

Sorry. I’m not very good at menus. I have achieved exactly what u are saying on a menu before. I’ll have a look for it shortly if you still need help.
matthescratch 29 20 Feb, 2024 @ 9:24am 
I think you need a Loop before the first Choose Option and an exit button that executes the ExitLoop.

Then you need an exit button that executes ExitLoop after the second Choose Option.

cant see why that wouldnt work.
Amove 16 4 Mar, 2024 @ 10:06am 
Game crashes if your coding is faulty. You mainly need two things: the loop has to be above the choose option, and secondly you need an exit loop option so you can exit the menu. Make sure that everything under the loop is embedded inside and not just directly below it, this is especially important for your exit loop.

Here's a screenshot of my menu (there are multiple loops since there are sub-menus):
https://steamuserimages-a.akamaihd.net/ugc/2458473371643593521/CC8214C02482770773016025C8B36F09316C89EF/
< >
Showing 1-5 of 5 comments
Per page: 1530 50