Answer the question
In order to leave comments, you need to log in
How to create a mod system for a game in Python?
I want to make it possible to create mods for my game, and I ask myself the question " How can I make it possible to import an entire function or def functions from a text file or a .py file? "
And also how to import variables from a .py file (this in case function import is not possible from .txt)?
Answer the question
In order to leave comments, you need to log in
Well, if the game is in python, then the functions must be imported as
from mod_file import *
And for the person to choose which file to import from
. Variables are also imported
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question