Grimrukh / soulstruct

Python tools for inspecting and modifying FromSoft games (mainly Dark Souls 1).
145 stars 16 forks source link

Add 'from common_func import ...' support #3

Open garyttierney opened 3 years ago

garyttierney commented 3 years ago

This is still a WIP so I've marked it as a draft. There's no error handling yet and the discovery of common_func is a little out of place, but it does the trick for me so far in DS3.

Still todo:

Do you think this is the right time/place to be reading custom_func.py and parsing it's AST (i.e. on demand as opposed to passing in a load_common_func=True to an EMEVD instance).

Grimrukh commented 3 years ago

This is looking good. Yes, I think this could be easily expanded to import event functions from any file - we'd just need to tell the compiler that only the common_func ones don't need to be inlined in the final EMEVD.