Hello, I’m a complete newbie to pythoning in in the BGE. I’ve read the manual and tutorial on blender.org and I’ve read the python in BGE starter guide. And that’s all that I know about Python on the BGE. I’ve tried to look through the YoFrankie files to understand it better but that was too overwhelming for me. I’m stuck trying to figure out these:
1- On many examples that I’ve read, there is a keyboard sensor linked to a python controller and a motion actuator. But the script will often contain code that seems unnecessary to be repeated everytime I press a button. Such as importing modules, setting variables to each sensor etc. That is repeated every game tick. Which seems like a waste. Is that the only way to do it? Or can I just set all these variables on one big initialization script and then just use the controller script to calculate the logic and activate/deactivate the actuators?
2- Can I make one initialization script that will create logic bricks for all objects and connect them, using Python only, without having to deal with the F4 interface (maybe only use the interface for the init script)? How?
3- One thing I want to do is to have procedurally generated meshes and objects. I know how to create Add->Mesh scripts. But I have no idea how to make those work in the GE in real time, is it possible?
4- On most Yo Frankie scripts. It simply defines a couple of functions then defines a main() function. But I cannot find it anywhere how the main() function is called, I just find the definition. Shouldn’t it call it somewhere is that some native aspect of Python or the BGE that I were not aware of?
5- I read that I can only use the action actuator for bones. But what if I wanna change the action of an object with no armature? I thought of changing the current IPO curve for the IPO actuator but I didn’t find anything about this on the GE API. Maybe I can use something from the non-GE Blender API to edit the object IPO curve in real time?
6- How often is a game tick? I read about it a lot on the docs, but I couldn’t find how many game ticks are there in 1 second. Could I possibly adjust this value?
7- The “Show Framerate and profile” option doesn’t seem to work on a standalone runtime. Is there a quick native way to display the FPS in runtime so others can help me benchmark it?
Thanks in advance ^^