Search code examples
c++pythonphysfs

PhysFS and Python embedding


I am writing a game engine and I'd like it to have Python scripting as well as support for mods using PhysFS.

My game data is stored something like this:

  • /
    • native
      • scripts
      • sprites
      • ...
    • mods
      • mymodname
        • scripts

What I want is for the mod scripts to be able to 'import' the native scripts as if they were in the same directory. Is something like that possible using PhysFS?


Solution

  • [I am the same person who asked the question.]

    The solution I used eventually was to modify Python's sys.path when my program starts. This does not pollute the game's data directories with symbolic links and is overall much cleaner.