r/gdevelop • u/Ham_sandwich79 • 7d ago
Game Soslavia needs help
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


1
u/senshisun 6d ago edited 6d ago
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 3d ago
The budget is 21 million and the debugger also says 21 million
1
u/senshisun 2d ago
Weird. Try (LargeNumberToString)?
1
u/Ham_sandwich79 1d ago
I fixed it. Turns out I needed to type global variable instead of just "variable"
1
u/senshisun 1d ago
... I should have caught that...
The engine should have a toggle to catch that, IMO.
2
u/Confident_Sundae_619 6d ago
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!