Quick Reply
Search this Thread
Lab Assistant
Original Poster
#1 Old 19th Aug 2024 at 6:42 PM
Default Need Help Creating a Toggable Camera Tuning Mod
Hey everyone,

I'm completely new to modding and feeling a bit overwhelmed, so I’m reaching out for some help. I’ve got an XML file that adjusts various camera settings in The Sims 3—things like movement speed, zoom levels, and pitch. This tuning is inspired by the work of other modders, so I can’t really take credit for figuring it all out myself.

My goal is to make these tweaks togglable in-game, ideally through a keybind or console command, so I can switch between my custom settings and the default ones. But honestly, I’m pretty clueless on how to make this happen. From what I’ve gathered, I might need to get into script modding—maybe something involving TRIG, _KEY, or even a S3SA using S3PE. But this is way beyond what I’ve done before; the farthest I’ve gotten is simple XML tuning, so all of this is uncharted territory for me!

I’ve tried looking into the game’s C# code, poking around with classes like CameraController in Sims3.SimIFace, but I’m pretty lost. I’m not sure how to apply the XML settings dynamically through code, and the toggle mechanism is an even bigger challenge. I’m also running into a bunch of errors that I can’t figure out.

Honestly, I’m not even sure if I’m approaching this the right way. If anyone with experience in this area could offer some guidance—like how to apply XML tuning dynamically or set up a toggle—I’d be really grateful. Even just knowing where to start or what resources to check out would be a huge help.

Thanks so much in advance for any advice!

Do you belive frogs can bite? If not, then you should, because they do! LOL!
Advertisement
Trainee Moderator
staff: trainee moderator
#2 Old 22nd Aug 2024 at 12:10 AM
I suppose you're referring to Sims3.Gameplay.Core.Camera class. Changing tunings through code is quite easy. But you would first need to read Sims 3 Pure Scripting Modding tutorial to get started.

Now that I assume you have read it and understood a bit, instead of OnWorldLoadFinishedEventHandler, you should use OnStartupAppEventHandler (or sOnStartupAppEventHandler, whichever appears as you write in VS), so that your function is called when the game application has finished starting (that happens right before main menu). Then, within your function, all you have to do is to do the following:

Code:
static YourClass()
{
    World.OnStartupAppEventHandler += new EventHandler(OnStartupApp); //You can also simply write OnStartupApp instead of new EventHandler(OnStartupApp).
}

public static void OnStartupApp(object sender, EventArgs e)
{
    Sims3.Gameplay.Core.Camera.kSimViewZoom = 10f; //I'm using kSimViewZoom and a random value as an example. Do and repeat this for any tuning you'd like to change.
}

Try this by yourself first. Then we can go through applying these via commands and keys.

P.S. If you use the game's original assemblies (scripts), you won't be able to change these tunings, as they are private members (meaning you cannot access them). Use unprotected assemblies.
Lab Assistant
Original Poster
#3 Old 22nd Aug 2024 at 3:46 PM
Quote: Originally posted by Eca
I suppose you're referring to Sims3.Gameplay.Core.Camera class. Changing tunings through code is quite easy. But you would first need to read Sims 3 Pure Scripting Modding tutorial to get started.

Now that I assume you have read it and understood a bit, instead of OnWorldLoadFinishedEventHandler, you should use OnStartupAppEventHandler (or sOnStartupAppEventHandler, whichever appears as you write in VS), so that your function is called when the game application has finished starting (that happens right before main menu). Then, within your function, all you have to do is to do the following:

Code:
static YourClass()
{
    World.OnStartupAppEventHandler += new EventHandler(OnStartupApp); //You can also simply write OnStartupApp instead of new EventHandler(OnStartupApp).
}

public static void OnStartupApp(object sender, EventArgs e)
{
    Sims3.Gameplay.Core.Camera.kSimViewZoom = 10f; //I'm using kSimViewZoom and a random value as an example. Do and repeat this for any tuning you'd like to change.
}

Try this by yourself first. Then we can go through applying these via commands and keys.

P.S. If you use the game's original assemblies (scripts), you won't be able to change these tunings, as they are private members (meaning you cannot access them). Use unprotected assemblies.


Thank you so much for taking your time to reply! I really appreciate you! I will try this tomorrow and see how it goes!

Do you belive frogs can bite? If not, then you should, because they do! LOL!
Back to top