Hello devs! Recently i entered modding in Sims 3. Not so long ago found out that the game is in C#.. So i wanted to make a test mod that doesn't alter the game code, i have a few questions..
Since Sims 3 are using custom version of clr/.net i found out that they don't check access modifiers and exception is not thrown when you try access them directly so that bringed me the question, could i just set all private/protected/internal members to public and build the mod like this or is there some way to make visual studio skip the access modifier compilation check? Second regarding game code mod i made, debugging gave me some trouble, with the help of ErrorTrap i logged the following exception, https://prnt.sc/tmtg2x . Could you give me a hint or something to where i can re-assign the StateMachineClient so the error doesn't happen again?
Pre-Last question, what can i do to make debugging easier?
Last question, is there something else i should know? What i want to doIn the final, i want to make a mod to mess with Grim Reaper, edit the code of the game enough to make him "work inside a household", as of current progress i managed to add him to household without him leaving/losing deep voice/losing smoke, save file is not broken but there is still alot more work to do than just that..
Few questions related mod making
- Chain_Reaction
- Site Admin
- Reactions:
- Posts: 7618
- Joined: December 30th, 2011, 6:00 pm
- Contact:
Few questions related mod making
Just build against the modified core DLL's found in my github, they're already set to public.
What exactly were you trying to do there? It looks like grim was processing a soul for the grave, right? Are you trying to use the grim you have in house to do that?
Debugging is kinda a nightmare for this game, it's never really going to be easy. Just use notifications heavily and write script error files too if you need to log. If the status of a variable is important to what you're doing, just get it in your face somehow. Even if you don't think you'll need to know how the flow is going at that point in the code, you will be banging your head when you have to shut the game down, add in logging to a variable and wait for it to load yet again.
What does just adding him to the household with MC do? I've never tried.PiotrKFtw wrote: ↑July 22nd, 2020, 4:30 pmi want to make a mod to mess with Grim Reaper, edit the code of the game enough to make him "work inside a household", as of current progress i managed to add him to household without him leaving/losing deep voice/losing smoke, save file is not broken but there is still alot more work to do than just that..
Few questions related mod making
Yeah. After little troubleshooting it turned out to be caused by master controller, mc deleted the drive and i had to reassign to get it to work. Also i had to modify the master controller in order to not EndService when adding Grim Reaper to house hold. After 2 days of working and debugging, here's the current result (progress): https://youtu.be/aKR3FgDez08Chain_Reaction wrote: ↑July 23rd, 2020, 8:26 pmWhat exactly were you trying to do there? It looks like grim was processing a soul for the grave, right? Are you trying to use the grim you have in house to do that?
Without modifying mc, adding him to house hold does EndService on him making him lose his function/abilities and cause a new grim reaper to get spawned (which is not what i want to achieve)Chain_Reaction wrote: ↑July 23rd, 2020, 8:26 pmWhat does just adding him to the household with MC do? I've never tried.
Thats what i was afraid of having to do.. Well since you say that i guess there is no other way.. I used the ErrorTrap file logging but as i said, without adding additional code it was just giving cleanup error (which pointed me to wrong direction at first) instead of the driver message.Chain_Reaction wrote: ↑July 23rd, 2020, 8:26 pmDebugging is kinda a nightmare for this game, it's never really going to be easy. Just use notifications heavily and write script error files too if you need to log. If the status of a variable is important to what you're doing, just get it in your face somehow. Even if you don't think you'll need to know how the flow is going at that point in the code, you will be banging your head when you have to shut the game down, add in logging to a variable and wait for it to load yet again.
Thanks it will really help me out.Chain_Reaction wrote: ↑July 23rd, 2020, 8:26 pmJust build against the modified core DLL's found in my github, they're already set to public.
Few questions related mod making
Is there a way to save something into the game save file? I was looking for some way to save single info but i found that appearantly saving happens in native form..
- Chain_Reaction
- Site Admin
- Reactions:
- Posts: 7618
- Joined: December 30th, 2011, 6:00 pm
- Contact:
Few questions related mod making
Sure, these mods save hundreds of options to the save file. The game should automatically save non-static members of any class that has the [Persistable] attribute and has a public constructor with the same name as the class. You can save static members by giving them the [PersistableStatic] attribute. And you can choose not to save a non-static member by giving it the [Persistable(false)] attribute.
Few questions related mod making
Thanks for help again. Now for (hopefully) the last things and everything should be good to go, where are (which field) Service sims for specific service stored (master controller -> intermediate -> select service uses it to get the count), i would probably find it by myself but i currently have other more important things to do than computer. Is the gameplay.package the same or it differs from 1.69 version?Chain_Reaction post_id=75744 time=1595928483 user_id=2 wrote: Sure, these mods save hundreds of options to the save file. The game should automatically save non-static members of any class that has the [Persistable] attribute and has a public constructor with the same name as the class. You can save static members by giving them the [PersistableStatic] attribute. And you can choose not to save a non-static member by giving it the [Persistable(false)] attribute.
(Off-Topic) Where can i share the mod?
- Chain_Reaction
- Site Admin
- Reactions:
- Posts: 7618
- Joined: December 30th, 2011, 6:00 pm
- Contact:
Few questions related mod making
If I understand the question, you want to know where is the data stored for which Sims belong to a service? It's the mPool field under the base service class.
It's the same, yes.
You're welcome to make a thread here in chatterbox if you'd like.
Few questions related mod making
Oh so it's this field, i thought it only belongs to a current instance, i was wrong then. Thanks for help again.Chain_Reaction wrote: ↑August 6th, 2020, 10:13 pmIf I understand the question, you want to know where is the data stored for which Sims belong to a service? It's the mPool field under the base service class.
Good to know because i thought that my mod is only compatible with steam version because thats where i got sims 3
Ok, thanks.Chain_Reaction wrote: ↑August 6th, 2020, 10:13 pmYou're welcome to make a thread here in chatterbox if you'd like.
0