Get access to BGE data for file export? [2.49]

Hi

So as far as I understand it, I can only access Blender Game Engine data (i.e. GameLogic) when the game is running.

So what if I need to make an script that exports properties that are available only from the GameLogic module?

specifically, I am after the ‘visible’ attribute of KX_GameObject. example

cont = GameLogic.getCurrentController() 
obj = cont.owner 
 
obj.visible #I want this!

Does anyone know how I can access the GameLogic module from a normal python script (i.e not in game mode)

Alternatively, is there any other way to find out if an object is ‘visible?’ (where an object is set ‘invisible’ in the game logic panel)

If it is only possible to access this data while the game mode is running, is it possible to turn the game mode ‘on’ and ‘off’ using python script?

Any other ideas are also welcome! :yes: