How to Create and Load Custom Moodlets with a Pure Script Mod by Nona Mena

*** Read more of this thread in ***

This tutorial assumes you know the basics of creating a pure script mod, and that you have at least some understanding of C#. All of the information you will find here is actually available elsewhere. I have simply put it all together in one post.

Pre-requisite Tutorials
If you have never made a script mod for the Sims 3, I highly recommend you take a look at the following tutorials before beginning with this one.
To complete this tutorial, you will need:
Microsoft Visual C# Express 2010 (or 2012) - This is the free version. You can use the pay version, too, of course.
Peter's Unprotect program - This is a small console application Peter compiled using twallan's code to make it easy to unprotect the core libraries.
Twallan's STBL program, available at his wiki (used to convert a text file to STBL, which I find easier when working with a lot of strings).
STBL Duplicator - You can use this tool to make strings for all languages.

Also highly recommend (free):
ILSpy - To decompile the core .dlls of the game
Notepad++ - Because it makes reading XML files easier.

There are several parts to this tutorial:
Part One: Creating the Code
Part Two: Creating Your Buffs XML
Part Three: Buff Elements and Localization
Part Four: Adding Moodlets and Buff Origins in the Script
Part Five: Finishing Up
Additional Credits
Bonus: Useful Overload Methods

Plan Ahead
To load a custom moodlet into the game, you need all of the following:
1. Custom script which parses an XML file to load the moodlet data, and contains a GUID for each moodlet.
2. An XML file containing moodlet data.
3. Buff information: Buff Name, Buff Description, Strength, Axis Effected (happy, uncomfortable, etc.), Buff Length, Buff GUID, Custom class and assembly name, Buff Moodlet Icon
4. Localization: You need a STBL file which contains the strings for your buffs. Note: Your buffs must be fully localized for all languages (even if you use Enlgish for all languages) or else they will not show properly in non-English games.

A word on terminology in this Tutorial:
In the Sims, the words buff and moodlet are interchangeable. I have also used the terms interchangeably in this tutorial. Whenever I refer to a buff, it means moodlet, and vice versa.

Now, Let's get started. Go to: Part One: Creating the Code

Click here to go to original support thread...