character_callback documentation: https://www.renpy.org/doc/html/characte ... -callbacks
say_arguments_callback documentation: https://www.renpy.org/doc/html/config.h ... s_callback
When would you want to choose one versus the other?
What are the advantages of one and of the other?
It seems one difference is that character_callback is automatically passed the event variable, while the say_arguments_callback is automatically passed the who variable.
One of the reasons I ask is because I have a character callback that decides if the slow_talking character can be interrupted or not. With callback variable 1, it cannot be interrupted. With callback variable 2, it can be interrupted.
Now, I also want it to be that this character can have a long text where for the first half of the text it can't be interrupted, but for the second half of the conversation it can be interrupted.
Currently, I have a function like so:
Code: Select all
init -1 python:
def splitlines(what, **kwargs):
what1, what2 = what.split("~")
w1 = what1 + "{color=#000}{cps=0}" + what2 + "{/color}{/cps}{nw}"
w2 = what1 + "{fast}" + what2
b1(w1, cb_num=0) #Note: in the character definition, 0 is the default callback value
b1(w2, cb_num=1)
Code: Select all
label start():
"The game starts."
b3 "Right now you can't interrupt this character, because it's default callback variable is 0."
b3 "Now I want you to be able to interrupt this character, so I change the callback variable for this line." (cb_num=1)
$splitlines("The callback variable is 0, which means you can't interrupt. ~Now the callback variable is 1, which means you can interrupt.")
Also, the problem with the splitlines function is that it only works on the character b1. But if I can't switch image tags mid-game, then I'm going to have two different characters who would be accessing this function (b1 and b2). So...it would be great if I could catch a who in this function...which say_arguments_callback would do, no? But I don't know if you can use say_arguments_callback to trigger the two different says like my function does.
Thoughts on how to accomplish this? Or should I just put this splitting function in the say screen?
ETA: Actually, I don't quite see how modifying the say screen would let me to change the call back variable...so I'm really hoping the say_arguments_callback might be able to do this.