I have a question about character callbacks that's really stumping me. I've seen them used pretty cleanly for beepy voices and lip flaps and all that, but I'm trying to use them for custom character indicators, kind of like CTC indicators. To do this, I need the character to be an argument in the callback function, but for some reason, it's not working.
The idea is that a talk indicator will appear above each character's head whenever they're talking, not in the textbox. Each character has a "current position" attribute, so I should be able to put the indicator at their current position. It appears when they begin talking and disappears when the interaction is over (I think I've done that part right?) The issue is getting the function to accept the character as an argument. If I put it at the end, like here, it returns the error "non-default argument follows default argument," which I don't fully understand.
Code: Select all
init -1 python:
def talking_stick(event, interact=True, char):
if not interact:
return
if event == "begin":
renpy.show("talk_indic", at_list=[current_pos(char.xpos,char.ypos - 48*3,0.5)])
elif event == "end":
renpy.hide("talk_indic")
...
...
...
define a = Character("Aggy", image="aggy", callback=talking_stick(Aggy))
Code: Select all
def talking_stick(char, event, interact=True):
So I'm not really sure what to do. Any ideas?