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 6th Sep 2014 at 12:09 PM
Default (Extremely) new to modding, would like some pointers
So, I just got the game and feel that it needs some serious modding. I'd like to do the mods myself, but have no experience modding any Sims games (or any game, for that matter). I don't know Python, but could theoretically learn it very fast, considering that I have prior commercial programming experience in C, ASM, C++, C#, PHP, and VB (both VB6 and VB.NET).

What I would like to know is:

- What IDE are you using for Python?
- Is a compiler necessary, or does the game compile the code?
- Am I supposed to make .package files or something? I heard something to that extent and am a bit at a loss there.
- Does anyone know where I can find a full API documentation?

If you point me in the right direction, my hope is that I can contribute quite a few things!
Advertisement
Test Subject
#2 Old 6th Sep 2014 at 12:20 PM
Quote: Originally posted by mgomez
So, I just got the game and feel that it needs some serious modding. I'd like to do the mods myself, but have no experience modding any Sims games (or any game, for that matter). I don't know Python, but could theoretically learn it very fast, considering that I have prior commercial programming experience in C, ASM, C++, C#, PHP, and VB (both VB6 and VB.NET).

What I would like to know is:

- What IDE are you using for Python?
- Is a compiler necessary, or does the game compile the code?
- Am I supposed to make .package files or something? I heard something to that extent and am a bit at a loss there.
- Does anyone know where I can find a full API documentation?

If you point me in the right direction, my hope is that I can contribute quite a few things!

Hi there!

A few things you should know first.
1.) Script modding isn't fully supported right now. You can write scripts, but the method in which scripts are inserted through the Mods folder is not working. The only way you can install and run script mods as of now (September 6, 2014) is by overriding the maxis python scripts due to a bug. They're fixing it, but I'd suggest you wait instead of jumping right in. The initial times are always where it's gonna be the hardest to mod for a game. Once a few tools come out, it'll be much easier to do what it is you need to do.
2.) Some of the rules of python coding are pretty different from any of the languages you've listed. You might want to read about python itself first.
3.) It might be good to know how modding in The Sims 3 worked, as they're pretty similar.

Okay, now to answer your questions.
- What IDE are you using for Python?
I actually don't use an IDE other than Notepad++.

- Is a compiler necessary, or does the game compile the code?
This is a concept that might be a bit confusing to those of you who are familiar with programming rather than scripting. Python scripts can be run from source .py files. That is, you can write source code and instantly run it. However, you can also compile it, and you would do this for two reasons.
1.) Compiled (.pyo) scripts aren't readable as source code. (Unless decompiled, of course).
2.) Compiled scripts are optimized to run faster, which is why when releasing a mod it's recommended to compile them.

- Am I supposed to make .package files or something? I heard something to that extent and am a bit at a loss there.
- Does anyone know where I can find a full API documentation?
Please read the sticky on top of this forum.

If you need any clarifications on anything, feel free to ask.
Test Subject
#3 Old 6th Sep 2014 at 4:41 PM
Python will be easy for you I suspect.

IDE: Notepad++ is decent editor but not and IDE. Given that you cannot debug anything its probably good enough. However if you want one that does refactoring and analysis and has projects and solutions and whatnot as you would expect from an IDE then I recommend PyCharm or Intellij IDEA both have community editions. I personally use IDEA full version cause I use a number of languages and its worth it to me.

I actually don't think compiling the python to pyo is needed for most mods other than do package it. Python is a fast interpreter/compiler and the pyo bytecode is not highly optimized. If you have hundreds of files then its totally worth it to save a few seconds and of course you should probably do so when delivering actual mods.

Packages require the use of sim4pe (C# source here) but are not required for the zip files. As mentioned they may be useful until the next patch which fixes script loading. The sticky at the top of this forum has links to more complete documentation for how to create a python file as well as an example.

If you are looking for python API then I would recommend downloading Python 3.3 and then reading the help included or going to the the online help . if its windows then its in the c:\python33\Doc\python335.chm file. The Sims API is not documented but you can reverse the source code (see the Converting .pyo to .py files thread) for either tools or someone linked to downloadable already converted files. This is where pycharm and intellij are helpful.
Lab Assistant
Original Poster
#4 Old 6th Sep 2014 at 10:30 PM
Thanks for your replies!

The fact you can run uncompiled/compiled scripts sounds to me like it's something similar to LUA. I'm reading up on Python right now. It seems to be a bit of a change in pace compared to my strict adherence to C-style coding, but I think I can get the hang of it pretty quickly. Hopefully, EA and Maxis will fix the libraries ASAP. I'm itching to get back into coding (I haven't done it in 7 years).
Pettifogging Legalist!
retired moderator
#5 Old 6th Sep 2014 at 10:33 PM
Quote: Originally posted by TheHologramMan
someone linked to downloadable already converted files


A link to those is in the "Tools / Documentation / Resources" sticky over in Tools forum. Also check out the wiki for documentation of file formats etc – not complete yet, it's being worked on, but might be helpful for making more sense of the game data (links, see stickies).

@TheHologramMan , @jcgurango (and everybody else) -- I'd like to very much encourage you to post this kind of useful pointers in the sticky threads too! They are deliberately open for posting -- I have a feeling people don't notice that? --, and I have zero python experience so can't really add anything substantial myself. I'm just gonna link to this thread for now.

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.
Back to top