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!
Space Pony
Original Poster
#1 Old 20th May 2018 at 1:09 PM
Default Utility Library Package
Hi fellow Sims Script modders ,

while working on an update for my Abductor mod, i was thinking to reupload and rework my Utility Library package for everyone to use.

So my question is quite simple:
is there any interest in an C# Library mod that you could implement in your mod to do things like changing sliders or creating in game menues (similar to how Nraas menues work) in a simple way so you dont have to fiddle with it on your own ?

This would be the ready to go Sims package and the dll for referencing.

So what do you think should i invest my time in the rework or is there no interest ?
Advertisement
Scholar
#2 Old 20th May 2018 at 5:42 PM
I do have interest. I want to make the vampires and witches customizable with different options in the future. Which will require menus. Your mod will be like a dll file that we add as reference right? And we'll also add the file in the mods/packages folder?

Though it's hard to tell how many other people will have interest. Sims 3 is still a very amazing game 10 years after it's release. But the amount of script mods people make for it have become a lot less I think. Like currently if you use the Script mod filter, you'll notice the last mod in the very first page is Arsil's mental Powers mod. Which was uploaded on 7th May 2017. More than a year ago.
Space Pony
Original Poster
#3 Old 20th May 2018 at 6:49 PM Last edited by Battery : 27th May 2018 at 7:49 PM.
Thanks for your input Skydome i really appreciate it !
I was aware that i looked somewhat grim but i was hoping that this sort of mod could counter it a bit ^^

would you be willing to give me some feedback on the way layout ease of use etc ? ( i know its a lot to ask but its also an opportunity to shape the mod in a way which is of most use to you and our co modders)

E: @your question, yes the mod would be an package file that goes into the mods folder.
i will upload a early version to show you what i mean just have to make a few changes so that it works again xd

E2: ok i uploaded a small test that shows just what i mean
Scholar
#4 Old 21st May 2018 at 6:06 PM
I have downloaded it but how do I test it? I add it to package folder then load the game? Or do I check the code?
Space Pony
Original Poster
#5 Old 21st May 2018 at 11:44 PM
Quote: Originally posted by skydome
I have downloaded it but how do I test it? I add it to package folder then load the game? Or do I check the code?


you can make the example cs file to an solution where you reference the utility.dll in addition to the normal includes
Test Subject
#6 Old 24th May 2018 at 2:31 PM
Very interested.
Also, if you can find a way to make larger sliders for arms that don't distort the length of the bones that would be awesome.
Even if you can't do that, having the script that controls such easily exposed to tinker with ourselves would be fantastic.
Right now, the only sliders I know for such all give add just a bit of length to arms and it makes animation tricky.
Field Researcher
#7 Old 24th May 2018 at 7:27 PM
Having a libary to create menues easily would be great
Space Pony
Original Poster
#8 Old 25th May 2018 at 6:03 PM
Allright im going to work on the package again. Has ayone who tired got the example to run ?
Space Pony
Original Poster
#9 Old 26th May 2018 at 1:46 PM Last edited by Battery : 26th May 2018 at 7:29 PM.
Ok i need to make a decision for the Menu Creation.
I got two options:
1. Wrap the Variables/objects in an extra object and put that in an dictionary for referencing.
2. Use pointers which would require you to enable the unsafe code compiling (unsafe doesnt mean that the code will be broken its just that the clr doesnt check it) which is a much easier way so you can directly link to variables.

Need your feedback before i can continue to work

heres an example on the different implementations:

For Variant 1 (Wrapper):
public Dictionary<string,SettingObject> mSettings = new Dictionary<string,SettingObject> ();
...
this.mSettings.Add ("bool_Test", new Setting<bool> ("", false));
...
Menu.AddRow (1, new Battery.BoolMenuOption ("Descriptive Text Here", "bool_Test"));


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

For Variant 2(Pointer):

bool bool_Test = false;
unsafe
{
fixed (bool* vari = &bool_Test )
{
Menu.AddRow (1, new Battery.Utility.UI.BoolMenuOption("Descriptive Text Here", vari));
}
}

So which one would you Prefer to write in your mod ?
Scholar
#10 Old 26th May 2018 at 8:48 PM
I'm sorry I have been a little busy the last week. I'm going to check ASAP.
I'll ask you some questions tomorrow since I haven't done anything like this before, I might need some help.
Scholar
#11 Old 26th May 2018 at 8:49 PM
I would I think prefer the wrapper version maybe.
Space Pony
Original Poster
#12 Old 26th May 2018 at 8:50 PM Last edited by Battery : 26th May 2018 at 9:07 PM.
Quote: Originally posted by skydome
I'm sorry I have been a little busy the last week. I'm going to check ASAP.
I'll ask you some questions tomorrow since I haven't done anything like this before, I might need some help.


thanks skydome, but be aware that the menu isnt available in the test ive uploaded

oh good to know that you prefer the wrapper (i should mention that you have to put all your variables into a dictionary and you have to retrieve them this way)
i will upload a new demonstration hopefully tomorrow so that you maybe could compare the two versions better and dont have to read my explanations but to see it in code would that help you make a definite decision (since you didnt sound too sure about the two options ^^).

E: ill be checking the forum tomorow and see if problems arise
Space Pony
Original Poster
#13 Old 27th May 2018 at 3:39 PM Last edited by Battery : 9th Jun 2018 at 5:25 PM.
Allright i wasted a lot of time today with forgetting that the string class is immutable.

but i got a little package ready for you to try out this time ready to go with a whole example solution that uses the utility.

Please tell me if it worked (worked for me ofc )


E: You need to reassign the Reference dlls ( Project->Edit References->browse then include the usual sims 3 dlls AND the utility dll) if you have questions feel free to ask ill try to keep an eye on this thread

E2: I have decided to go with a hybrid mode which allows you to use both the dictionary mehtod aswell as the pointer variant all in one (The uploaded file should now give you a good idea how the menu system works its actually functional )
Scholar
#14 Old 30th May 2018 at 2:32 PM
Ok I have added it as reference to my Vampire mod

Ok now let's say I want to add a menu called Skydome>Vampires and a menu similar to Master controller menu will pop up.
How do I start on that. I have created the interaction. And checking the example.dll, starting to slowly figure it out
Space Pony
Original Poster
#15 Old 30th May 2018 at 4:48 PM Last edited by Battery : 31st May 2018 at 5:53 PM.
Quote: Originally posted by skydome
Ok I have added it as reference to my Vampire mod

Ok now let's say I want to add a menu called Skydome>Vampires and a menu similar to Master controller menu will pop up.
How do I start on that. I have created the interaction. And checking the example.dll, starting to slowly figure it out


Hi skydome,

thanks for giving the mod a shot. I hope you are just doing this for testing purposes since i may need to make changes for better readability/usability which could make your code not work up the road, this is why i need your feedback. (of course the mod should work for now)

Dont forget to backup your whole mod solution so if anything goes wrong you still have your mod,
id hate to see your work vanish because you wanted to test the library

To answer your question:
your actual menu is a menucontainer, so you want to create a menucontainer like this(for the most simple way):

UI.MenuContainer ExampleMenu = new UI.MenuContainer ("Skydome>Vampires","");
OR
UI.MenuContainer ExampleMenu = new UI.MenuContainer ("Skydome",">Vampires");

now that youve got your menu you can start to add items to it like this (if you use the pointer variant)

fixed (bool* vari = &YourBoolVariableHere)
{
ExampleMenu.AddRow(new Battery.Utility.UI.Bool_MenuOption("description of the variable", vari);
}

Now you would have a row that should look something like that:

description of the variable ------------------------------- false (or true if YourBoolVariableHere would be true)

then you can open the menu with a function of the menu controller (for now called Battery.Utility.UI.ObjectPickerBatt) like this

Battery.Utility.UI.ObjectPickerBatt.Show (ExampleMenu);


then the menu should show up

thanks again for testing ♥
Space Pony
Original Poster
#16 Old 31st May 2018 at 12:35 PM Last edited by Battery : 31st May 2018 at 7:12 PM.
Well maybe i should also state the dictionary approach since you hinted that youd like that one more:

  • Step 1 (Create a dictionary that will hold your Settings/Variables): (in the recently uploaded version you can take any key you want i have chosen ulong for this example)
    public Dictionary<ulong,SettingObject> dict_1 = new Dictionary<ulong, SettingObject>();

  • Step 2 Add Settings/Variables to your dictionary:
    dict_1.Add (1, new Setting<int> ("MyIntegerSetting", 250));

  • Step 3 Create the menu like in the other example:
    UI.MenuContainer ExampleMenu = new UI.MenuContainer ("Skydome>Vampires","");
    OR
    UI.MenuContainer ExampleMenu = new UI.MenuContainer ("Skydome",">Vampires");

  • Step 4 add the menu item to the menu:
    ExampleMenu.AddRow (new UI.SetDictionaryOption<ulong>("Set my Int",1,dict_1,() =>
    {
    int temp;
    string input = Sims3.UI.StringInputDialog.Show ("Enter number", "PromptText", dict_1[1].Value.ToString(), false);
    int.tryparse(input, out temp);
    dict_1[1].Value = temp;
    }

  • Step 5 open the menu:
    Battery.Utility.UI.ObjectPickerBatt.Show (ExampleMenu);
Scholar
#17 Old 31st May 2018 at 5:35 PM
Ok working on it
Also taken a backup.
Scholar
#18 Old 8th Jun 2018 at 9:27 PM
Ok gotten a small menu to appear
Not doing anything with the menu yet since you said you'll upload the mod later.
Space Pony
Original Poster
#19 Old 9th Jun 2018 at 10:42 AM Last edited by Battery : 10th Jun 2018 at 8:52 AM.
Quote: Originally posted by skydome
Ok gotten a small menu to appear
Not doing anything with the menu yet since you said you'll upload the mod later.


Thank you so much for testing sky !

I have made some minor adjustments to the mod. Unfortunately this includes some renaming of methods/classes which in my opinion make it more readable/easier to get what is what.

Here are the things that got renamed:

Battery.Utility.UI is now Battery.Utility.bUI (i just added the b to prevent confusing my mods UI class with the UI namespace of the basegame.
Battery.Utility.UI.ObjectPickerBatt is now Battery.Utility.bUI.MenuController ( i think the name MenuController gives you an better hint what the thing does right away)
MenuContainer.AddRow is now called MenuContainer.AddMenuObject

Added Features:
Remoting
-With the remoting feature the mod comes full circle to its original idea which was allowing other users to create addons/use the functionality of other mods (startet as an addon to my abductor mod)
with this you can use methods/classes of other mods without the need of getting your mod dependent on it (including the dll).

i will include a testversion of my abductor mod and an example solution on how to call methods from it, with the procedure given in the example you should be able to use any mods methods.
Be aware that it would be good practice if you would ask the modder first if they are ok with using their mods features.

Again, thanks a lot for Testing ♥

E2: If you havent found any errors or have suggestions on the naming of classes methods of this mod consider this the unofficial launch. The official launch will just include some tutorial and maybe a few more methods/constructors so you should be safe with using the version uploaded here.

If you've got ideas or already implemented features youd like to see in this mod just write me and if it does make sense for the scope of that project i can include it along with your name in the credits (ill maybe make the whole project open source at one time)
Virtual gardener
staff: administrator
#20 Old 9th Jun 2018 at 3:20 PM
This is awesome! Bookmarking it myself and hopefully will give it a try later this week. :D

Thank you Battery you're awesome!
Space Pony
Original Poster
#21 Old 9th Jun 2018 at 4:24 PM Last edited by Battery : 14th Jul 2018 at 1:25 PM.
Quote: Originally posted by Lyralei
This is awesome! Bookmarking it myself and hopefully will give it a try later this week. :D

Thank you Battery you're awesome!


Thanks for giving it a shot, i hope you will find it beneficial to your modding endeavors ♥

I'm now working on the lackluster improt/export feature so the official release hopefully will include this (otherwise i will include it in a later version)

Note I am still not 100% certain how the mod behaves when its updated. While i had no problem with my testmods using a newer version of the utility then they wehere compiled with but im just one person so extrapolationg for all other possiblities isnt possible. So be aware that there could be problems with newer versins so i will keep old versions uploaded for compability.

Anyway heres the unofficial release
Space Pony
Original Poster
#22 Old 8th Jul 2018 at 9:22 PM Last edited by Battery : 14th Jul 2018 at 1:24 PM.
So as you might have noticed i have not uploaded the official release yet. This is because i had an idea for easier serialization in the sims3. This took me the last weekends to figure out.
Now im in the process of cutting any edges i deem to rough and writing the documentation for the mod.
I have attached a early scribble of the documentation aswell as the rough version of the mod i plan to release next weekend.
Any input on the mod and or the documentation scribble would be greatly appreciated (this would also include not understandable instructions in the documentation)
Scholar
#23 Old 10th Jul 2018 at 5:19 PM
Quote: Originally posted by Battery
So as you might have noticed i have not uploaded the official release yet. This is because i had an idea for easier serialization in the sims3. This took me the last weekends to figure out.
Now im in the process of cutting any edges i deem to rough and writing the documentation for the mod.
I have attached a early scribble of the documentation aswell as the rough version of the mod i plan to release next weekend.
Any input on the mod and or the documentation scribble would be greatly appreciated (this would also include not understandable instructions in the documentation)


Downloaded it
Will you upload it as a mod after the next update?
Space Pony
Original Poster
#24 Old 10th Jul 2018 at 8:30 PM
Quote: Originally posted by skydome
Downloaded it
Will you upload it as a mod after the next update?


Yes thanks skydome, i know that i should have released it some time ago. Im still aiming for the mod to be uploaded as a "real" mod this weekend *fingers crossed*.
I still have to do a lot of work on the documentation and then some polishing. Hope that there is nothing that has to be polished for more then a day.
Space Pony
Original Poster
#25 Old 14th Jul 2018 at 2:32 PM
Allright the mod is enque for approval/disapproval as you might have noticed i have removed all prior download links, this is to prevent confusion for anyone who stumbles over the thread.

I made some last minute adjustments to the mod, that will break anything that came before so if you want to update your scripting (if applicable) i have attached the version of the official upload to "play with" (since it will take some time to go through the whole Approval process) so you can start with whatever you want to do with it right away.
Attached files:
File Type: 7z  Battery.Utility_1.0.0.7z (32.4 KB, 13 downloads) - View custom content
Page 1 of 2
Back to top