External Scripts priorities


I use the Controller’s star but even if I do it, the script is not the first one to be executed (I use print to check).
Other controllers don’t use the star option.
Is the script priority connected to the position of an object in a hierarchy? (parent, child)

Hmm… I didn’t know that the star didn’t always work. Are you 100% sure that whatever is executing before it doesn’t have a star as well?

Well I do know that objects created last in Blender are executed first. So if you add 4 Cubes to the viewport and add the same script for each one, the last created Cube (named Cube.003 by default) will be the first one to be executed. So maybe knowing this could help your case.

I have more informations.
The problem comes from the initialization of the functions.

Ex :
external script first.py (called through starred controller Module “first.main”)
called on “CUBE” object

print "first"
Player = objList.get("OBPlayer")
def main():
     Player["name"] = "Elise"
    print "first ok"

external script second.py (called through NOT starred controller Module “second.main”)
called on PLAYER object

print "second"

def test():
     if Player["name"] == "Elise":
        print "cute"

def main():
      print "second ok"

Console Displays

if Player["name"] == "Elise"
KeyError : 'value = gameOb[key]: KX_GameObject, key "name" does not exist

The error was that test() in second.py (not starred) was called before main() in first.py (starred)

if I delete test(), the result I get is

first ok
second ok

Can we change the priority of the part that is read only once, also?
So we can get

first ok
second ok

Hi Cray!

The controller is inside the first state? If not consider using the “level” button inside the sensor brick or add a new one (sensor) for state 2 for example.

See if that works…