My intent is to have a continuous check on an NPC's stress level which will lead to an automatic jump to a predetermined "freak out" label if their stress is too high. I've been able to get the python_callback to work for keeping track of stat updates behind the scenes but creating a label jump is stumping me.
Here's my initial method under the NPC class I've created, the one being checked:
Code: Select all
def jumpcheck(self):
if self.stress > 2 and self.flight > self.fight:
renpy.jump(self_leaves)
elif self.stress > 2 and self.fight > self.flight:
renpy.jump(self_explodes)
else:
renpy.notify("That didn't work")
Code: Select all
def run_jumpcheck():
try:
b1.jumpcheck()
d.jumpcheck()
m.jumpcheck()
except:
renpy.notify("Nothing's working")
config.python_callbacks.append(run_jumpcheck)
For a while my renpy.notify was showing "Nothing's working" the entire trial, but I've gotten it to a point where it'll show "That didn't work" for the first two choices (where stress is less than 3) and then switch to "Nothing's working" after that. So I know it's trying to work and I can't figure out why it's backing out once the jump becomes possible.