Setup MonoDevelop for The Sims 3
How to use MonoDevelop to create pure script mods for The Sims 3


MonoDevelop, also known as Xamarin Studio, is an open source and free IDE for .NET languages as C#, VB.Net, ASP.Net and others and developed by the Xamarin company and the Mono community.

Step 0. Get MonoDevelop (Xamarin Studio)

MonoDevelop can be downloaded from its official website: http://monodevelop.com/Download.

Browse to that page, select a MonoDevelop version (you will probably prefer the Stable Release) and your operating system. The download links appear in the Packages section. You will find also links to the libraries MonoDevelop depends on, the .Net Framework 4.0 and the GTK# Framework. You will have to install them (or ensure that they are up-to-date on you PC) prior to installing MonoDevelop. Start with the .Net Framework, then GTK# and finally install MonoDevelop. The operation is straightforward, so I won't go into more details for this tutorial.

MonoDevelop may want to update itself at the first start. Strange for a just-downloaded software? It's just that the development is very active! Update is quick, so you can proceed or do that later.

Step 1. Start a New Project

Go to File > New > Solution...

Create a new C# / Library solution. Give it a name and a location and click OK.

Step 2. Configure the New Project

The workspace opens itself. In the project tree, the top level with the purple icon is your solution. The second level, with the blue icon is your project. Right click on your project and select Options.

In the Project Options dialog, go first to the General tab and change the target framework to Mono / .NET 2.0. Then, check Do not reference mscorlib.dll.

Then, go to Compiler. Select the Release configuration at the top of the window and then select x86 as platform target.

Step 3. Add References to The Sims assemblies

In the project tree, open the References folder. Right click on the System assembly and select delete.

Right click on the References folder and select Edit references.... Go to the .Net Assembly tab and navigate to the folder where you have extracted the Sims assemblies. If you haven't already extracted the assemblies, please refer to the following procedure: Getting Started With Pure Script Modding .

Select all the needed assemblies and click Add. They appears in the Selected references list. Validate with OK.

Select all newly added references, right click on them and uncheck the Local Copy option.

Step 4. Prepare the AssemblyInfo.cs File

In the project tree, double click the AssemblyInfo.cs file to open it in the editor. Add the lines

using Sims3.SimIFace;

and

[assembly: Tunable]

where indicated.

Step 5. Get ready for the build

To start a build, check that the Release configuration is selected, and click the little hammer button to launch a build.

You're ready to go!

What follows are some more tips in using MonoDevelop.

Interesting built-in functions

MonoDevelop comes with an interesting integrated assembly browser that decompiles bytecode to IL or C#. It looks a lot like ILSpy. Just double click on an assembly from the project tree to add it to the assembly view and start browsing. You can search the assembly for text and/or references.

MonoDevelop has also a built in XML editor, what is kind of useful as any scripting mod has at least an instantiator XML file. To create an XML file, right click on the project and select Add > New File.... Then, select the XML tab and Empty XML File. Give it a name and click OK.

You can also have a file copied to the output folder, by right clicking on it and selecting Quick Properties > Copy to Output Directory.

Adding Custom Tools

You can add shortcuts to custom tools in Tools > Options... > External Tools. One I find very handy is the XML to STBL compiler, a tool you may want to use when dealing with large sets of language strings to translate. I use my own my own but this setting will also work for Twallan's.

One thing I however noted with these tools is, they block the run queue until they return. This can be a problem with tools that you keep at the background as S3PE. These must be unfortunately seen as tools to modify the current workspace, and may not used as shortcuts to parallel tools.

Links and other resources

As Buzzler likes to say, where does the newborn go from here?

Here are some companion tools you will find essential when modding:

And as a bonus, some of my other companion tools, all free of charges.

Thanks to Inge, Nona, Buzzler and Twallan for their tutos and help.