I'm currently trying to learn Creator-Defined Statements but I'm stumped as to how to use the lint statement properly. The renpy.error() statements I use never show up when there's a problem, and I can't figure out how to make it give an error when I want it to (eg. telling the user that "X is not a keyword argument or valid child for the statement." if they use a keyword argument for my statement that's not supported).
For example, if my statement is written as:
Code: Select all
my_statement "test1" param1 "value1" param2 "value2"
but "param2" is not a valid keyword I want to return the error:
Error: param2 is not a keyword argument or valid child for the my_statement statement.
Theoretically the lint statement should work something like this:
Code: Select all
def lint_my_statement(o):
test1,kwargs = o
e = my_error_checking(kwargs) # Returns "param2"
if e is not None:
renpy.error("Error: %s is not a keyword argument or valid child for the my_statement statement." %s)
But what do I need to do to get Ren'py to call it? (For what it's worth, the Example in the documents also doesn't seem to call the lint statement.)
Any help on this would be much appreciated because I want to make sure that my code handles errors properly. Thanks!