Hey all when I first, first started BGE and python especially I felt like after the beginner tutorials I was practically abandoned if not for the community. To try and fix this I figured a handy reference of essential knowledge and commonly used poorly documented features/code/logic bricks etcetera would be a good idea. As I’m still a noob here the list is currently quite short but it’s all stuff which I found from the forums or example blends and found immediately useful. If you guys post other related essential poorly documented knowledge and tips I’ll try and make time to edit this post and keep them all on one page for a quick read that noobs can be directed to after completing socials python tutorial or some other noob based BGE tut.
Things they never told us:
GameLogic.getCurrentScene.getObjectList(OByourobject) (means you can get properties from objects not using the python script.)
Set friction, damping and more using the materials tab under Dyn.
Messages can send strings but you must use properties string and on the message actuator use the property button. Python sender (
own.prop = # sets your property
GameLogic.addActiveActuator(cont.getActuator(“message”), 1) #off goes your message.)
reciever ( eval(cont.getSensor(“message”).getBodies()) #gets you message
If you can suss out python Apple2 module is your friend.
If you can’t suss out python Blengine and documentation is your friend.
The Blender module is not available as a Python library. It’s hard-coded into Blender itself, and is not available to the BlenderPlayer.
Ben made a version of Blender.sys.expandpath() for the GameEngine that you can use to get the directory of the .blend itself, though I don’t think it will return the actual name of the .blend like Blender.Get(‘filename’) does. Here’s how to use it:
To make a path relative to the current directory, use “//” as the path.
GameLogic.expandPath("//" + filename)
You can put property names (and even matematical expressions, between parentheses) in the min/max fields of the property sensor.
You can exit the game with Control+Pause too (useful when you use ESC in a keyboard sensor and something goes wrong)
Having a high poly object takes much more loading time than if you have more lower poly objects (keeping the same poly count)
Hey Cyborg is this better or have you got something else in mind. Sorry Venom 7 I’m inclined to agree with Nikolay this thread is specific to the game engine. Maybe we can have a simaler thread for more genral blender tips. Thanks for the tips anyway I’d never heard of the second one.
Nicely going guys! I think this is a pretty good start for one evening. Remember to check back in with more if you remember them or find something new which isn’t immediately obvious.