Hi, n00bs of python!
I just found out a cool trick, for saving properties while switching scenes.
Of course, all experienced programmers should know this.
Instead of using normal blender properties, you use GameLogic.Properties, ( Maybe they aren’t called like that… ) and make a script for making a “normal” property equal to it.
Scripts example:
Initialize GL.Var: ( init.py )
GameLogic.thing = 30
Men, that’s a VERY long script!
Every time you use a sensor, remove 1 from property:
cont = GameLogic.getCurrentController()
x = cont.getSensor("x")
if x.isPositive():
GameLogic.thing = GameLogic.thing - 1
Sets property equal to GL.prop:
cont = GameLogic.getCurrentController()
own = cont.getOwner()
own.Text = GameLogic.thing
EDIT: As C-106 Delta says, the variable could stay forever, although I don’t care it stays until I close the game. To delete objects, just use del, like if quit_key.ispositive(): del GL.var.
EXAMPLE BLEND: http://uploader.polorix.net//files/1586/Mouse_Activator.blend
The blend includes a GL variable, social’s mouselook, and a activators demo.
I got the original blend from somebody who just did a quick setup for social’s mouselook… http://www.savefile.com/files/1536265 All the other things that appear on my example are made by me. (lol)
I hope that helps somebody