Thanks, Remix -- that was exactly what I was looking for!
As you noted, it needed some minor debugging (missing closing quote in 'label a' plus an inadvertent indent on the config.hyperlink_handlers line).
For anyone else who learns best from studying code examples, here is the tweaked version. I switched 'label a:' to 'label start:' so that this example is ready-to-test.
Code: Select all
init python:
def handle_call_with_args( value ):
label, args = value.split('?')
# we py_eval the args into a list for *args using eval to get variable values interpreted
renpy.call( label, *renpy.python.py_eval( "[{0}]".format( args ) ) )
define config.hyperlink_handlers = { 'call_args' : handle_call_with_args }
default var_val = 'a value'
label start:
"{a=call_args:b?12,'string',var_val}jump b{/a}"
label b( i, s, v ):
"i=[i], s=[s], v=[v]"
Again, thank you very much for taking the time to create this example. You've made my day.