Minor output window error messages, ignore for complied games?

Hi all

A bit of an odd question, but is it OK to ignore Python error messages that are not serious?

I recently (with a load of help) made a lock on system- one approach generates an error that states Python/ Blender expected an object reference/ co-ordinates but it still seems to work. Although flawed, I would like to use this method.

If (in the future) I finish this game and I compile it, will non-lethal messages like this cause any problems? Should I be a good person and try to make everything work in a pukka fashion?

Or will Python Jedi just slap me for being lazy?:wink:

Cheers

Paul

I can remeber that the runtime got some problems when there is no console to output (when it want to output).

But the last time I saw this is some years ago. Currently I always have a console.

BTW. You can ignore whatever you want. According to murphy’s law - errors will catch you when you do not expect problems ;).

If it is an Exception, you have to know that mostlikely some code is not processed. This can have side effects either.

Use try: and except: statements to prevent condolences errors. but I will look at the code that gives the error

Thanks for the replies! Here is the file (lifted from the other thread I talked about):

The error message is generated when the ‘target’ cube goes out of the radar detection cone, and thus the tracking script has no target to lock onto.

Attachments

countdown.blend (475 KB)

Replace Homing_Rocket with this.
It simply checks if the value of target is a game object.
That was what was causing the error

import bge
cont = bge.logic.getCurrentController()
scene = bge.logic.getCurrentScene()
own = cont.owner

if "locked_target" in bge.logic.globalDict:
    locked_target = (bge.logic.globalDict["locked_target"])

    target = locked_target
    print(target)
    if type(target) == bge.types.KX_GameObject:
        own.alignAxisToVect(own.getVectTo(target)[1], 1, 1)




Cheers agoose, you are a Python ninja!

No problem, and thanks :slight_smile: