Im having a problem with declaring a global variable across modules.
Example:
globals.py
Syntax: Select all
test_variable = None
def set_test_variable(value):
global test_variable
test_variable = value
test.py
Syntax: Select all
from listeners import OnLevelInit
from .globals import set_test_variable
@OnLevelInit
def on_level_init(map_name):
set_test_variable(123)
And when I debug/print the value of the test_variable (after on_level_init), all im getting is None.
Could you please help me?