since I am relatively new to python/renpy I am wondering if it is safe to modify or redefine coding in the python modules that come with renpy. For example, I want to have a custom say function which is originally defined in exports.py:
Code: Select all
init 100 python:
def my_say(who, what, *args, **kwargs):
"""
Copied from exports.py
"""
<some custom coding here>
if renpy.config.old_substitutions:
# Interpolate variables.
what = what % renpy.exports.tag_quoting_dict
if who is None:
who = renpy.store.narrator # E1101 @UndefinedVariable
if renpy.config.say_arguments_callback:
args, kwargs = renpy.config.say_arguments_callback(who, *args, **kwargs)
if isinstance(who, (str, unicode)):
renpy.store.say(who, what, *args, **kwargs)
else:
who(what, *args, **kwargs)
renpy.exports.say = my_say
Is there a better way to do stuff like this? Is it even recommended?