Valkrionn
The Hamster King
I'm attempting to define a global variable in python atm.
Is it enough to define the variable at the top of the file, and explicitly declaring the variable a global in any file that modifies the value?
Edit: Also, how do you call the variable in another python file? Need to call it in MainScreen.
Edit the Second: Alright, I got the globals working, and as wrote a small function that sets the relevant global equal to itself, and returns it, which I then call in the Screens file... Works perfectly. All that's left is to balance it.
This is for a new Grigori Spawning mechanic, btw... No randomness at all, instead it increases a certain amount each turn based on buildings and civics. Two globals are used: iGrigoriSpawn, which is used as the counter, and iGrigoriMod, which modifies the counter and is increased everytime a new Adventurer spawns... Same way GPs require more points each time.
Is it enough to define the variable at the top of the file, and explicitly declaring the variable a global in any file that modifies the value?
Edit: Also, how do you call the variable in another python file? Need to call it in MainScreen.
Edit the Second: Alright, I got the globals working, and as wrote a small function that sets the relevant global equal to itself, and returns it, which I then call in the Screens file... Works perfectly. All that's left is to balance it.

This is for a new Grigori Spawning mechanic, btw... No randomness at all, instead it increases a certain amount each turn based on buildings and civics. Two globals are used: iGrigoriSpawn, which is used as the counter, and iGrigoriMod, which modifies the counter and is increased everytime a new Adventurer spawns... Same way GPs require more points each time.
