killing a Script in G-Blender


(Doc Holiday) #1

How can i kill a G-Blender Script bevor it ends? sys.exit() quits Blender complete. Anybody an Idea?

Thx, Doc


(Ben) #2

-what means “before it ends”:
if you want to finish it within the script it can happen when a prop has
a certain value with “if” condition,or you can exit a cycle with “break”
if you want it to be interrupted out of the script ,the sensor which starts
can happen when receive a messagge or sommething like this


(Doc Holiday) #3

What? …
Doc You have an Example Code?

Thx, Doc


(Ben) #4

-I think is better tell me which script you want to interrupt before it ends.


(Doc Holiday) #5

Any Script! Maybe:

if a == 1: Kill the current Script ???

Do You know a Possibility?
Thx, Doc


(Ben) #6

if owner.prop == 1:
if a == 1:
-where prop is a property equal to 1.When prop is not 1 the script doesn’t
work.
2)if you connect your python controller with a sensor that becomes false when you want the script doesn’t work.

There are a lot of possibilities to stop a script.You start it and you can stop when you want.

P.S.maybe i haven’t realised the question


(Doc Holiday) #7

Yes, You did. :frowning: Maybe, it’s my bad English?

Ok!: The Script should be killed, after it has started.

if Question Fale: kill (and restart)
else: run till the End.

any Idea?
Thx, Doc