Posts: 2,671
Thanks: 62689 in 190 Posts
25 Achievements
As long as the import statement is formatted correctly it should work and compile to a .pyo whether it finds that module or not. If the error really bothers you, make sure that you're doing your compiles in the same folder with the EA scripts so it can find that file.
I really don't think it matters much, in my experience/testing if you include both the .py file and .pyo file in your
zip file the game will choose to load the .py file and not the .pyo. I only include the .pyo as perhaps this behavior will change in the future and I want to include the .py so that others can see what I've done and benefit from it.
EDIT: I thought that EA claimed that the .pyo would be loaded by preference if both existed, but they don't ever actually state that in the Custom Content Guide, they just say that you can include the .py files as an option. I'm not sure what kind of performance gains would be seen by putting just the .pyo file in as most scripts so far are pretty simple. Might help with something like the Pregnancy Mega Mod where it rerolls the pregnancy in a loop to try and match the user's choice for pregnancy results, but in practice even that runs pretty darned quick.
If someone ever writes something that runs frequently it might make a difference for slower machines.