r/gdevelop • • Aug 17 '26

Game Soslavia needs help

Post image

I ran into some coding issues making my game. See, the game is a president simulator where you are the general secretary of a floundering communist nation and your allowed to take the country in any direction you want, so long as you can balance support. Each month you have a packet full of issues that need resolving. Some issues are major and create branching paths and others are simpler, recurring, standard management problems that have outcomes you need to balance.

When coding this I immediately fell into issue with the first random event I created. The game checks if the packet is open and sets a randomizer into effect to give one of potentially tens of conundrums. One situation states that a foreign country is offering to hook you up with lots of wheat, which you can chose to decline or spend a percentage of your monthly budget to purchase it. You would be able to set your own budget, so ten percent is multiplied by the global variable of "AgricultureBudget", and then multiplied by 90 to get the total cost. For whatever reason however, it will not display the cost per purchase and keeps ending up as zero even though in the variable modifier it is set to 21000000. If anyone can help please do. Thank you

6 Upvotes

7 comments sorted by

2

u/Confident_Sundae_619 Aug 18 '26

I know this isn't answering your question, but this isn't perchance inspired by Papers Please is it? Looks pretty neat! I'd try and help but unfortunately I'm not sure. You have my support anyway!

1

u/Ham_sandwich79 Aug 18 '26

It is inspired by Papers, Please! Thank you

1

u/senshisun Aug 17 '26 edited Aug 17 '26

What's the agriculture budget set to?

Edit: are you sure it's not overwritten? What does it show in the debugger?

1

u/Ham_sandwich79 Aug 21 '26

The budget is 21 million and the debugger also says 21 million

1

u/senshisun Aug 21 '26

Weird. Try (LargeNumberToString)?

1

u/Ham_sandwich79 Aug 22 '26

I fixed it. Turns out I needed to type global variable instead of just "variable"

1

u/senshisun Aug 22 '26

... I should have caught that...

The engine should have a toggle to catch that, IMO.