Custom Statements
python early: | |
def parse_smartline(lex): | |
who = lex.simple_expression() | |
what = lex.rest() | |
return (who, what) | |
def execute_smartline(o): | |
who, what = o | |
renpy.say(eval(who), what) | |
def lint_smartline(o): | |
who, what = o | |
try: | |
eval(who) | |
except: | |
renpy.error("Character not defined: %s" % who) | |
tte = renpy.check_text_tags(what) | |
if tte: | |
renpy.error(tte) | |
renpy.register_statement("line", parse=parse_smartline, execute=execute_smartline, lint=lint_smartline) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment