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!
Trainee Moderator
staff: trainee moderator
Original Poster
#1 Old 6th Jul 2018 at 5:55 PM
Default How do I make a social interaction with custom animations?
I saw on another thread about somebody wanting to make social interactions too, but it leads to a tutorial I just can't wrap my head around
And just to let everybody know, I'm a noob/beginner at coding.

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Advertisement
Scholar
#2 Old 7th Jul 2018 at 3:38 PM
Quote: Originally posted by TheSweetToddler
I saw on another thread about somebody wanting to make social interactions too, but it leads to a tutorial I just can't wrap my head around
And just to let everybody know, I'm a noob/beginner at coding.



Ok so you have visual studio 2015 and ilspy and smooth Jazz and S3PE right?

I've also sent you the dll files that you'll need. I got these from Nrass github page and I further modified one of the file.

Anyway the first thing you have to learn to do is prepare a visual studio project for modding. You can follow this tutorial here for that. Your Visual studio is 2015 so you have to follow the VS2010 and 2012 part of the steps instead of the older versions. At Step1 name your file TheSweetToddler1(You can give any name you want, it's simply a suggestion). When you get to step 3 add the DLL files I have sent you as reference instead of what they tell you to do. Skip the Mscorlib one since you're in 2015 version. You'll have to add that one manually later as explained further in the guide.

Now open your project in Visual studio. The one you made from the previous instruction. Open AssemblyInfo.cs and add
Code:
using Sims3.SimIFace;
[assembly: Tunable]


to that file.

Now open your main code file. It'll most likely say Class1.cs
It'll probably look like this
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TheSweetToddler1
{
    public class Class1
    {
    }
}


Now
Remove
Code:
using System.Linq; 

Add
Code:
using Sims3.SimIFace;


Ok from now on I'll be following this guide http://modthesims.info/wiki.php?tit...ripting_Modding
I'll post further instructions in the next post ok
Scholar
#3 Old 7th Jul 2018 at 5:22 PM
Default Mod to pause the game when game starts
So this is what your code should now look like
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Sims3.SimIFace;
//This is a comment, doesn't affect the code. Anything after // is a comment

namespace TheSweetToddler1 //This should be unique. Should be different from EA namespace or other modder's namespace. 
{
    public class Pausinator // Changed the name from class1. This can be any name you want. But I named it pausinator cause the original tuorial had this name
    {
    }
}



Ok now add this inside your pausinator
Code:
    [Tunable]   //Makes the bool tunable. So you'll write an xml file with this value and make it true. That's how you attach a script. I'll explain how to do this later.
    protected static bool kInstantiator = false;

    static Pausinator()//If your class has a different name then give this a different name.
    {
        World.OnWorldLoadFinishedEventHandler += new EventHandler(OnWorldLoadFinished);
//This loosely translates as when the world loading finishes. Do what's written in OnWorldLoadFinished below. It's currently blank.
    }

    private static void OnWorldLoadFinished(object sender, EventArgs e)
    {
    }

Ok now write this OnWorldFinished


Code:
Sims3.Gameplay.Gameflow.SetGameSpeed(Gameflow.GameSpeed.Pause, Sims3.Gameplay.Gameflow.SetGameSpeedContext.GameStates); //Pauses the game.


The Final code will be this
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Sims3.SimIFace;

namespace TheSweetToddler1
{
    public class Pausinator
    {
        [Tunable]
        protected static bool kInstantiator = false;

        static Pausinator()
        {
            World.OnWorldLoadFinishedEventHandler += new EventHandler(OnWorldLoadFinished);
        }

        private static void OnWorldLoadFinished(object sender, EventArgs e)
        {
            Sims3.Gameplay.Gameflow.SetGameSpeed(Gameflow.GameSpeed.Pause, Sims3.Gameplay.Gameflow.SetGameSpeedContext.GameStates);
        }
    }
}

Ok so your code is ready. What it does is pause the game when you load it. You can press P to unpause it as usual.
Save your project and click Build>Build Solution. This will compile your code into a .dll file. Now where can you find this .dll? Documents\Visual Studio 2015\Projects\TheSweetToddler1\TheSweetToddler1\bin\x86\Debug copy and paste the dll someplace else.

Now open S3PE click New. Go to Resource>Add. A dialog box opens. In type select _XML_0x333406C, Type 0 in Group, In name type TheSweetToddler1.Pausinator press fnv64 button and click ok.
Now right click on the xml file and select Notepad from the Menu. And the xml file will open in a notepad.
Now paste this in your notepad
Code:
<?xml version="1.0" encoding="utf-8"?>
<base>
  <Current_Tuning>
    <kInstantiator value="True" />
  </Current_Tuning>
</base>

And save and close notepad. The kInstantiator is the same as it was in your script. Except it was false. Changing this to true is how you attach your script.

Now go to resource>Add Resource select S3SA 0x073FAA07 in type group is still 0. Name can be anything you want but it has to be unique, other tutorials will tell you to keep the name the same as your xml but that is not necessary. It only has to be unique. Press fnv64 button and ok. Now you have your S3SA file. This is where your dll goes. Now right click and select import dll. Navigat and import the compiled dll file.
And there you have it. Your mod is complete . Test it out in a saved game. When the game loads it'll be paused. If everything was done right.

Thanks to Buzzler for this tutorial. I have just made it a little simpler for you since you don't have coding experience. This is the original tutorial you can check it out if you want to.

Once you get this mod to work. I'll show you how to add an interaction in the pie menu. If you have any questions. Let me know.
Back to top