Replies: 3 (Who?), Viewed: 144 times.
Lab Assistant
Original Poster
#1 Old 21st Jul 2021 at 2:28 PM
Default Some questions about the .NET DLLs
So I'm developing a mod that's less of a stupid idea than the time travel one (sorry for bothering you guys about that ). I have some questions about the functions of the DLLs.
(Just so you know, I know C# pretty well, but just don't know the inner workings of this game's .NET DLLs that much, other than the fact that it has custom versions of System.dll and mscorlib.dll that have important features of .NET scrubbed out, which is rather annoying (hence why I'm doing the command system down below, to make the game interact with a program that uses a full implementation of .NET)!)

How do I force the game to change the active sim?
How would I force an external program to send commands to the mod and have the mod parse objects, methods, and types, and execute the methods that were parsed? I set up a command system that sends and recieves commands and buffers, but I'm not sure if it will work...

I might have some more questions as I develop this mod more, just an FYI.

---------------------------------------------------------------------------------------------------------------

"WELCOME TO THE WOOOORLD OF TOMORROW!"
Advertisement
Lab Assistant
Original Poster
#2 Old 21st Jul 2021 at 2:33 PM
Ok, here's another question: How would I serialize and deserialize all the gameobjects (I already have a serializer and deserializer helper struct but the tricky part is finding what game objects to "sync") and sync them with, say, serialized objects on a server? As in, upload the serialized objects to the server and download and deserialize objects from the server?

---------------------------------------------------------------------------------------------------------------

"WELCOME TO THE WOOOORLD OF TOMORROW!"
Virtual gardener
staff: administrator
#3 Old 21st Jul 2021 at 5:53 PM
Quote:
Originally Posted by ToonElectrocrash
So I'm developing a mod that's less of a stupid idea than the time travel one (sorry for bothering you guys about that ). I have some questions about the functions of the DLLs.
(Just so you know, I know C# pretty well, but just don't know the inner workings of this game's .NET DLLs that much, other than the fact that it has custom versions of System.dll and mscorlib.dll that have important features of .NET scrubbed out, which is rather annoying (hence why I'm doing the command system down below, to make the game interact with a program that uses a full implementation of .NET)!)

How do I force the game to change the active sim?
How would I force an external program to send commands to the mod and have the mod parse objects, methods, and types, and execute the methods that were parsed? I set up a command system that sends and recieves commands and buffers, but I'm not sure if it will work...

I might have some more questions as I develop this mod more, just an FYI.


On the .NET dll being scrubbed out, most of these features can still be found in the SimIFace.dll. You'll see your trusty functionsl like stopwatch and what-not However! not everything is in there. EA basically 'compressed' the Mscorlib and system dll down to only have what they found necessary to use. Which sucks! But it's how it is :/ But I'd check that out first before going super advanced mode and see what you can do from there

Regarding linking another program to TS3, that's more or less @Battery 's kind of field, I just program sims 3 objects and global mods :p
Field Researcher
#4 Old 21st Jul 2021 at 7:36 PM
Quote:
Originally Posted by ToonElectrocrash
How do I force the game to change the active sim?

Code:
using Sims3.Gameplay.Core;

Plumbbob.ForceSelectActor(sim);

Quote:
Originally Posted by ToonElectrocrash
How would I force an external program to send commands to the mod and have the mod parse objects, methods, and types, and execute the methods that were parsed? I set up a command system that sends and recieves commands and buffers, but I'm not sure if it will work...


If you already have a way of sending/receiving bytes from an external program, you might consider looking at the ExportContent and ImportContent methods if you haven't already, which are used when exporting content to the bin or traveling to read/write Sim and GameObject state from a stream. You might be able to use a MemoryStream or something to call those methods and send the data across. For types and method parsing, you could do something as simple as sending the type/method names as strings and using reflection later to get the matching runtime types and methods.

Quote:
Originally Posted by ToonElectrocrash
How would I serialize and deserialize all the gameobjects (I already have a serializer and deserializer helper struct but the tricky part is finding what game objects to "sync") and sync them with, say, serialized objects on a server? As in, upload the serialized objects to the server and download and deserialize objects from the server?


To get all in-world GameObjects, you would use:
Code:
using Sims3.Gameplay;
using Sims3.Gameplay.Abstracts;

GameObject[] objects = Queries.GetObjects<GameObject>();


As far as uploading/downloading is concerned, that's definitely a Battery question. I don't really have any ideas.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Back to top