MTS has all free content, all the time. Find out how YOU can help to keep it running. Tell me how...

C# Script Utility

by Battery Posted 15th Jul 2018 at 12:06 PM - Updated 16th Jul 2021 at 9:54 PM by Battery
28 Comments / replies (Who?) - 14 Feedback Posts, 11 Thanks Posts
What is this mod ?
This mod is a C# Library of Methods and Classes that enable script modders to implement varios functionality in a simpler way then without it (see Features)



Mods that Make use of this Utility



Usage / Installation:


Why this mod ?


Features




Challenges:


Future plans:



Changelog


Additional Credits ♥:

Nraas industries for some insight on their menus
PuddingFace for being so nice to do some proof of concept testing and giving feedback
TreyNutz for giving feedback on an early prototype of the menu system.
Zoe22 and FloTheory for helping to test the Auto Menu feature
Consort for helping me fix an issue with some Sliders

PuddingFace , Clang2, KittyTheSnowcat and Lyralei for showing their interest in the mod so that i did go through with it rather then dumping it.



If you have feedback or questions feel free to ask them either in the comments or in the mods forum thread
Tags: #Battery, #Script, #Utility, #Menu

Operating System: Windows
Utility Type: Miscellaneous
Plugin Type: Not Applicable

You must have the expansion or stuff packs listed below installed to use this custom content. Please see the post text for any exceptions.

Sims 3

This is a multi-part download:


Only use one of the *.package files in your game
Key: - File was updated after upload was posted
Filename - Tip: You can click the magnifying glass to see the archive contents Size Downloads Date
Battery_Utility_1.02b9_automenu.7z | Auto Menu functionality

Size: 734.7 KB · Downloads: 4,729 · 30th May 2021
734.7 KB 4,729 30th May 2021
Battery_Utility_1.02b9..7z

Size: 734.2 KB · Downloads: 2,591 · 30th May 2021
734.2 KB 2,591 30th May 2021
Utility Legacy Versions.7z | Outdated Legacy Versions

Size: 273.1 KB · Downloads: 823 · 15th Mar 2020
273.1 KB 823 15th Mar 2020
Don't forget to Thank the creator after downloading! Use the Thanks button located above the screenshots above.
Quick Guide:

1. Click the file listed on the Files tab to download the file to your computer.
2. Extract the zip, rar, or 7z file. Now you will have either a .package or a .sims3pack file.

For Package files:

1. Cut and paste the file into your Documents\Electronic Arts\The Sims 3\Mods\Packages folder. If you do not already have this folder, you should read the full guide to Package files first: Sims 3:Installing Package Fileswiki, so you can make sure your game is fully patched and you have the correct Resource.cfg file.
2. Run the game, and find your content where the creator said it would be (build mode, buy mode, Create-a-Sim, etc.).

For Sims3Pack files:

1. Cut and paste it into your Documents\Electronic Arts\The Sims 3\Downloads folder. If you do not have this folder yet, it is recommended that you open the game and then close it again so that this folder will be automatically created. Then you can place the .sims3pack into your Downloads folder.
2. Load the game's Launcher, and click on the Downloads tab. Find the item in the list and tick the box beside it. Then press the Install button below the list.
3. Wait for the installer to load, and it will install the content to the game. You will get a message letting you know when it's done.
4. Run the game, and find your content where the creator said it would be (build mode, buy mode, Create-a-Sim, etc.).


Extracting from RAR, ZIP, or 7z: You will need a special program for this. For Windows, we recommend 7-Zip and for Mac OSX, we recommend Keka. Both are free and safe to use.


Need more help?

If you need more info, see:
 
28 Comments / Replies (Who?) - 15 Feedback Posts, 11 Thanks Posts
Hide Thanks Posts for this thread (Show only feedback)
Page 1 of 2
Virtual gardener
staff: administrator THANKS POST
#2 Old 15th Jul 2018 at 1:36 PM
This is lovely! Will certainly give it a try for my sewing table project. Was kinda wondering how I was going to approach the menus... especially since they're all annoying and frustrating to get it to work properly
Field Researcher
Original Poster
#3 Old 15th Jul 2018 at 3:15 PM
Quote:
Originally Posted by Lyralei
This is lovely! Will certainly give it a try for my sewing table project. Was kinda wondering how I was going to approach the menus... especially since they're all annoying and frustrating to get it to work properly


Thanks you for your kind words Lyralei !

If i can help you implement the functionality of this mod let me know and i will try to help (since i have just covered the bare basics in the documentation yet)

Good luck with your mod. Oh and same thing for everyone if you need help ask here or in the forum thread, this will also help to see where the mod and its documentation needs the biggest improvements.
Field Researcher
THANKS POST
#4 Old 15th Jul 2018 at 3:24 PM
This is very intriguing. Simplifying a lot of the commonly-used scripting like this may be a way to get more people into C# scripting!

Using the simulator for multithreaded scripting tasks is what interests me the most. Usually, that simulator is only used for routing and "behind-the-scenes" stuff. How much of a performance difference have you seen when using it?

I hope you don't mind if I reverse-engineer this code and use it for my own nefarious purposes...
Field Researcher
Original Poster
#5 Old 15th Jul 2018 at 4:11 PM
Quote:
Originally Posted by gamefreak130
This is very intriguing. Simplifying a lot of the commonly-used scripting like this may be a way to get more people into C# scripting!

Using the simulator for multithreaded scripting tasks is what interests me the most. Usually, that simulator is only used for routing and "behind-the-scenes" stuff. How much of a performance difference have you seen when using it?

I hope you don't mind if I reverse-engineer this code and use it for my own nefarious purposes...


That depends on the workload i mostly use it in conjunction with outfit changes there it is obvious without the gameclock stops for about 5-15 seconds with the simulator it runs normally. Be aware that the simulator (as you stated correctly) already has some load mainly routing, so hitting the simulator to hard may cause slower routing while the work is in progress, also the task itself takes a bit longer since it has some overhead with it then just running it on the main thread. But all in all its a good way to get rid of some stuttering for heavy workloads. The thing my mod only does is provide a simple wrapper where you can put your method in.

Use Battery.Utility.Threading.Task_GenericAction.Start(YourAction); to run something on the simulator with this mod

And for the reverse engineering go ahead i plan to make the c#-projectfile open source later if there is someone interested in it, but first i have to improve the documentation, improve usability and see if any bugs have to be squished.
Field Researcher
#6 Old 15th Jul 2018 at 6:35 PM
Quote:
Originally Posted by Battery
That depends on the workload i mostly use it in conjunction with outfit changes there it is obvious without the gameclock stops for about 5-15 seconds with the simulator it runs normally. Be aware that the simulator (as you stated correctly) already has some load mainly routing, so hitting the simulator to hard may cause slower routing while the work is in progress, also the task itself takes a bit longer since it has some overhead with it then just running it on the main thread. But all in all its a good way to get rid of some stuttering for heavy workloads. The thing my mod only does is provide a simple wrapper where you can put your method in.


Hmm...makes me wonder if the occasional freezing in my large savegames is due to some errant script running in the main thread. If only there was some way to offload some of that stuff to the simulator as needed to marginally improve performance...

In any case, thanks!

"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
Site Helper
THANKS POST
#7 Old 16th Jul 2018 at 1:44 PM
That was a really wonderful idea, which sounds as though it will be useful for a lot of people!
Field Researcher
#8 Old 16th Jul 2018 at 4:34 PM
SO, you have this menu appear when you click on an object? What happens when you click on one of the menu items? Can you change the setting?
Field Researcher
Original Poster
#9 Old 16th Jul 2018 at 5:09 PM
Quote:
Originally Posted by pjsutton
SO, you have this menu appear when you click on an object? What happens when you click on one of the menu items? Can you change the setting?


Thats exactly what will happen if you want it to it either switches its state from true to false for bools (and vice versa) or you can input your value as a stringinput. the menue will be there until you close it.

Oh and you cann call the menu any way you would call a method so you dont necessarily need to click an object (e.g you could use a timer after the game loads or couple it with an event)
Scholar
THANKS POST
#10 Old 16th Jul 2018 at 5:17 PM
OMG it's here :) and thanks for the credit :)
Field Researcher
THANKS POST
#11 Old 18th Jul 2018 at 9:20 AM
Wow, I just started learning how to mod and so appreciate this tool. I can't imagine the amount of work you put into this! Thank you so very much for sharing it with us, no doubt it will be an invaluable help for us modders.
Mad Poster
THANKS POST
#12 Old 19th Jul 2018 at 5:01 PM
Thanks for this mod!

I really hope it leads to more deep mods for the Sims 3 that add more gameplay and functionality!
Lab Assistant
THANKS POST
#13 Old 21st Jul 2018 at 10:53 AM
This will be very useful for creators, thank you!
Field Researcher
Original Poster
#14 Old 22nd Jul 2018 at 6:22 PM
Well thanks everyone,

i really hope this mod will help to make some of the tedious tasks easier for modders to eventualy result in more Script mods. If someone needs help you can just ask im still working on improving the "manual"

I just uploaded Version 1.0.1 be Aware that i moved the menu Objects to their own namespace you can now find them under "Battery.Utility.MenuObjects"
Lab Assistant
THANKS POST
#15 Old 28th Jun 2019 at 5:58 PM
thank you
Test Subject
THANKS POST
#16 Old 23rd Sep 2019 at 9:57 PM
Hello! This tool is wonderful, I could test its functions. I only have one question, how could I get the ResourceKey from a custom slider? When I open the slider with S3PE where should I copy the resource? Thank you!
Field Researcher
Original Poster
#17 Old 26th Sep 2019 at 5:04 PM Last edited by Battery : 26th Sep 2019 at 8:37 PM.
Quote:
Originally Posted by arielfcaceres
Hello! This tool is wonderful, I could test its functions. I only have one question, how could I get the ResourceKey from a custom slider? When I open the slider with S3PE where should I copy the resource? Thank you!


Hey arielfcaceres,

sorry for the late response.

To get the slider you want from S3PE just select the slider press the right mouse button and select copy resource key.
You can then just paste it into the function like that

Code:
ResourceKey key = ResourceKey.FromString ("0xB52F5055-0x00000000-0xA684FF36BCAE80E4");
Slider.Set_Value(Sim.ActiveActor ,key, 0.5);

This will set the nose lenght of the active actor to 0.5.
"0xB52F5055-0x00000000-0xA684FF36BCAE80E4" is the Resource key of the noselength slider.
Lab Assistant
THANKS POST
#18 Old 15th Feb 2021 at 4:55 AM Last edited by SonyaYU : 15th Feb 2021 at 5:15 AM.
Ok that prototype update made me so excited. I've been DREAMING of a S3SE existence!
Are... are we seeing an MCM on the horizon and possibly a cure for the lag on sim menus and walls and rabbitholes from too many mod menus?
Field Researcher
Original Poster
#19 Old 15th Feb 2021 at 8:00 PM
Quote:
Originally Posted by SonyaYU
Ok that prototype update made me so excited. I've been DREAMING of a S3SE existence!
Are... are we seeing an MCM on the horizon and possibly a cure for the lag on sim menus and walls and rabbitholes from too many mod menus?


I hate to calm your enthusiasm but this is a far cry from the capabilities of the Morrowind/Skyrim Skript Extender. In its current state it only allows for File IO. (and its quite buggy)
About the MCM there is the auto menu functionality that is at least somewhat comparable, but it still nees to be adapted by other modders and there are several reasons not to bind ones mod to this Utility.

But i agree Having a nraas like menu is probably much better than having 10 options in the pie menu for one mod.

Again sorry to be such a killjoy. But thanks for your interest, maybe File IO can at least enable some mods
Lab Assistant
#20 Old 16th Feb 2021 at 4:58 AM
Quote:
Originally Posted by Battery
I hate to calm your enthusiasm but this is a far cry from the capabilities of the Morrowind/Skyrim Skript Extender. In its current state it only allows for File IO. (and its quite buggy)
About the MCM there is the auto menu functionality that is at least somewhat comparable, but it still nees to be adapted by other modders and there are several reasons not to bind ones mod to this Utility.

But i agree Having a nraas like menu is probably much better than having 10 options in the pie menu for one mod.

Again sorry to be such a killjoy. But thanks for your interest, maybe File IO can at least enable some mods


Ooh, I see. Still looking forward to the options that may come up. The more we can optimise and unify, the better!
Test Subject
THANKS POST
#21 Old 16th Feb 2021 at 6:35 PM
With the sims 3 script extender, mentioned in the changelog, is there hope for a mod to eliminate sim pie menu lag and also camera stutter/lag? I am no stranger to script extenders because I play Fallout 4. From experience with fallout, I know that there is a possibility to fix a large majority of gameplay and performance issues. Just seeing it mentioned made me happy, thanks.

If TS3 goes back to being smooth and lag free like it was when I was a kid that would be amazing!
Field Researcher
Original Poster
#22 Old 18th Feb 2021 at 6:32 PM
Quote:
Originally Posted by Hellokittyki
With the sims 3 script extender, mentioned in the changelog, is there hope for a mod to eliminate sim pie menu lag and also camera stutter/lag? I am no stranger to script extenders because I play Fallout 4. From experience with fallout, I know that there is a possibility to fix a large majority of gameplay and performance issues. Just seeing it mentioned made me happy, thanks.

If TS3 goes back to being smooth and lag free like it was when I was a kid that would be amazing!


The pie menu lag could probably eased by normal c# scripting, but i think this would be very time consuming and probably needs to be a core mod. So nothing i myself would like to do at the moment. The best thing is to reduce stress on the pie menu by consolidating multiple options into one menu in my opinion. As stated above this mod can be at least a help if the modder doesnt want to do all the coding him/herself.

Btw S3SE is uploaded on Mod The Sims.
Lab Assistant
#23 Old 20th May 2021 at 4:28 PM
I am not clear on which version I need to install. As far as I know, the only mod that I have that uses this is PuddingFace's Enhanced Vampires. Does it matter if I use the "mastermenu" version or the other version?
Field Researcher
Original Poster
#24 Old 21st May 2021 at 8:37 PM
Quote:
Originally Posted by FreakyRufus
I am not clear on which version I need to install. As far as I know, the only mod that I have that uses this is PuddingFace's Enhanced Vampires. Does it matter if I use the "mastermenu" version or the other version?


Both versions are identical in their compatibility, the only difference is that the master menu version has a menu that is able to edit values of subscribed mods but all that is purely optional. You can pick either one, and always change them later if you stumble upon a mod that supports the master menu and you want to use that feature.
Field Researcher
#25 Old 21st Jul 2021 at 12:43 AM
Just wondering.
Did this mod got updated or just description update?
Cause I see this:
Quote:
Posted 15th Jul 2018 at 3:06 AM - Updated 16th Jul 2021 at 12:54 PM by Battery
Page 1 of 2