It might be a 2.61 problem, but when I run more than 2 or 3 scripts in module mode, I have to enable Debug, or it wont run.
For CoS, I use one master script and hook all functions from it. Reloading the modules all the time is bad for performance.
The script is completely external, I write it with Notepad, so there’s no copy in Blender.
Debug is great when you can update the script ans see it in action while the game runs.
Are you using initialization variables at a module level - variables that are outside your function, and therefore are only calculated once per game until reloaded. This extends to cont and scene if you use those they should be inside the funtion
Thanks Agoose77.
Not really, in most cases these functions must update a global variable. One of them needs to add an object to a scene, if a condition is fulfilled.
def spawnStar():
g_Player= GALAXY_Obj['g_Player']; Stargen=STELLAR_Obj['C_Controller']
for star in GALAXY_Obj:
if "type" in star:
star= star
dist= star.getDistanceTo(g_Player)
if dist<100:
#Activate star gen
Active_star=star; Stargen["act"]=True
if Stargen["generate"]==True:
GALAXY.addObject(Stellar_obj[star["type"]],Stargen)
Stargen["act"]=False
Well, nothing happens in this case, I know the script is being read, because the properties do change, but the object is not spawned!:spin:
Other functions do the same, but I see what you mean… I’ll change the modules.
The problem was, that once a an error is found in a controller, it stops working… I ignored all errors, because I knew the cause! Silly me, carrying on!