Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Lab Assistant
Original Poster
#1 Old 16th Feb 2015 at 4:11 AM Last edited by simalary44 : 18th Feb 2015 at 7:25 PM.
Default -- Python Compiling --
Fixed the problem, thanks to @scumbumbo

Simalary Studios

Contact Me
Send me a PM, if you need to contact me for anything.
Advertisement
Deceased
#2 Old 17th Feb 2015 at 7:40 AM
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.
Pettifogging Legalist!
retired moderator
#3 Old 18th Feb 2015 at 2:47 PM
I’m un-deleting this thread because scumbumbo’s answer contains interesting info. @simalary44 feel free to delete the contents of your post (with the Edit button) but please don’t remove the entire post as that will delete the whole thread again. Thanks!

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#4 Old 18th Feb 2015 at 7:27 PM
Quote: Originally posted by plasticbox
I’m un-deleting this thread because scumbumbo’s answer contains interesting info. @simalary44 feel free to delete the contents of your post (with the Edit button) but please don’t remove the entire post as that will delete the whole thread again. Thanks!


Sorry, I just deleted it because I didn't need it, but good idea keeping it up

Simalary Studios

Contact Me
Send me a PM, if you need to contact me for anything.
Back to top