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!
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 17th May 2023 at 6:46 PM by Battery
 
79 Comments / Replies (Who?) - 61 Feedback Posts, 17 Thanks Posts
Hide Thanks Posts for this thread (Show only feedback)
Page 1 of 4
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
Space Pony
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.
Space Pony
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...
Space Pony
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.
Space Pony
#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?
Space Pony
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 :)
Forum Resident
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!
Instructor
THANKS POST
#13 Old 21st Jul 2018 at 10:53 AM
This will be very useful for creators, thank you!
Space Pony
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!
Space Pony
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?
Space Pony
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!
Space Pony
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?
Space Pony
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 4