- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Sims 3 Code Documentation
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Sims 3 Code Documentation
Replies: 13 (Who?), Viewed: 2709 times.
#1
26th Jan 2021 at 12:57 PM
Posts: 3,860
Thanks: 8579 in 67 Posts
Sims 3 Code Documentation
Heya everyone!A few months back @gamefreak130 pointed out the existence of this thread: http://simswiki.info/wiki.php?title=TS3PR
Which was a thread created back in 2010. So, pretty old now!
It's been quite a while since it was updated if you can see :p And a while back Gamefreak130 and I were actually talking about updating it, so I figured, why not do that today!
So if you'd like to contribute then you're free to do so! Here's an example of the formatting (That I assumed the original creator of the thread wanted it to look like?) but if that format is awful, just let me know too lol
Example: http://simswiki.info/wiki.php?title.../Sims3.SimIFace
What I did so far:
Updated the homepage of the docs to add Sims3StoreObjects.dll and the microsoft-but-not-so-microsoft libraries. Plus some explanation as to what the Sims3Common.dll is and how to use it if ever necessary.
http://simswiki.info/wiki.php?title=TS3PR
Also updated the SimIface/Sims3 thread: http://simswiki.info/wiki.php?title.../SimIFace/Sims3
And updated, but still neeed to finish, the SimIface.Sims3.SimIFace thread: http://simswiki.info/wiki.php?title.../Sims3.SimIFace
Feel free to edit anything that I might have read wrong or add additional information (like usage of a function/method/class/thing)
I will still be updating it bit by bit but if you want to contribute then you can too! At least I think so IIRC... else also let me know :p because then that's just a permission thing.
Advertisement
#2
27th Jan 2021 at 12:55 AM
Posts: 437
Thanks: 5342 in 22 Posts
Thanks for getting this started. I've cleaned up some various things around the current landing pages and added a couple more for Sims3StoreObjects: http://simswiki.info/wiki.php?title...ms3StoreObjects.
I think having a separate page for every object in a namespace (as was done here) is the way to go to keep things organized, so the next step is to go through each namespace to enumerate all the objects. I've already done it for everything in Sims3StoreObjects, but that's a very small percentage of the total amount of ground to cover.
I think having a separate page for every object in a namespace (as was done here) is the way to go to keep things organized, so the next step is to go through each namespace to enumerate all the objects. I've already done it for everything in Sims3StoreObjects, but that's a very small percentage of the total amount of ground to cover.
"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
If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
#3
27th Jan 2021 at 12:09 PM
Posts: 3,860
Thanks: 8579 in 67 Posts
Quote: Originally posted by gamefreak130
Thanks for getting this started. I've cleaned up some various things around the current landing pages and added a couple more for Sims3StoreObjects: http://simswiki.info/wiki.php?title...ms3StoreObjects. I think having a separate page for every object in a namespace (as was done here) is the way to go to keep things organized, so the next step is to go through each namespace to enumerate all the objects. I've already done it for everything in Sims3StoreObjects, but that's a very small percentage of the total amount of ground to cover. |
I think indeed having an MSDN-like setup is probably the easiest to read here as well So let's keep that approach for now! Almost feel like we need to write a program that just dumps all the namespaces and classes for us :p Especially when looking at the SimIFace stuff.
I do wonder though, some classes seem to have been used in the past by EA, but aren't currently. (I.E AnimationsUtil, which was probably used before they got rid of the GrannyRig support and went their own ways). Should we include those? I personally think the debug engine functions can still be useful as references, as they can still be used in your own scripts.
#4
28th Jan 2021 at 4:40 AM
Posts: 437
Thanks: 5342 in 22 Posts
Quote: Originally posted by Lyralei
Almost feel like we need to write a program that just dumps all the namespaces and classes for us :p |
...Give me a few days
"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
If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
#5
29th Jan 2021 at 2:57 AM
Posts: 437
Thanks: 5342 in 22 Posts
Alright, well that didn't take quite as long as I thought it would.
There should now be pages for all namespaces in the assemblies, and each page lists out the types in that namespace. I didn't know what to do with nested types (like the Definition classes in interaction objects), so I just left them out for now. I also didn't touch the two pages from SimIFace that @Lyralei had started filling in. Other than that, the scaffolding should be set up to actually fill in type information!
Oh, and if you're wondering how I did it, here's the code I wrote to generate the pages, in all its LINQ-ing glory:
There should now be pages for all namespaces in the assemblies, and each page lists out the types in that namespace. I didn't know what to do with nested types (like the Definition classes in interaction objects), so I just left them out for now. I also didn't touch the two pages from SimIFace that @Lyralei had started filling in. Other than that, the scaffolding should be set up to actually fill in type information!
Oh, and if you're wondering how I did it, here's the code I wrote to generate the pages, in all its LINQ-ing glory:
Code:
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; namespace TS3PRGenerator { class Program { static void Main(string[] _) { Assembly[] assemblies = { Assembly.Load("Sims3StoreObjects, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("ScriptCore, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("SimIFace, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("Sims3GameplaySystems, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("Sims3GameplayObjects, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("Sims3Metadata, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("UI, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null") }; foreach (Assembly assembly in assemblies) { if (!Directory.Exists($"out/{assembly.GetName().Name}")) { Directory.CreateDirectory($"out/{assembly.GetName().Name}"); } var types = from type in assembly.GetTypes() where !type.IsNested && !type.Name.Contains("<") orderby type.Name group type by type.FullName.Substring(0, type.FullName.LastIndexOf('.')) into g orderby g.Key select g; StringBuilder namespaceList = new(); foreach (var group in types) { Console.WriteLine($"\n{group.Key}\n"); namespaceList.AppendLine($"*[[/{group.Key}/]] -"); Dictionary<string, StringBuilder> typeLists = new() { { "Classes", new() }, { "Structs", new() }, { "Interfaces", new() }, { "Enums", new() }, { "Delegates", new() } }; foreach (Type type in group) { Type[] genericTypes = type.GetGenericArguments(); string typeName = genericTypes.Length > 0 ? $"{type.Name.Substring(0, type.Name.LastIndexOf('`'))}" : type.Name; //<{string.Join<Type>(", ", genericTypes)}>" : type.Name; Console.WriteLine(typeName); switch (type) { case { IsClass: true } when typeof(Delegate).IsAssignableFrom(type): typeLists["Delegates"].AppendLine($"*[[/{typeName}/]] -"); break; case { IsClass: true }: typeLists["Classes"].AppendLine($"*[[/{typeName}/]] -"); break; case { IsEnum: true }: typeLists["Enums"].AppendLine($"*[[/{typeName}/]] -"); break; case { IsValueType: true }: typeLists["Structs"].AppendLine($"*[[/{typeName}/]] -"); break; case { IsInterface: true }: typeLists["Interfaces"].AppendLine($"*[[/{typeName}/]] -"); break; } } using (StreamWriter writer = File.CreateText($"out/{assembly.GetName().Name}/{group.Key}.txt")) { writer.WriteLine("This Page is currently simply a stub, if you have information to contribute on any of these classes, please create the page and add info about it to this page." + writer.NewLine); writer.WriteLine("'''Please ensure you give separate headings for classes, enums, interfaces and other object types'''" + writer.NewLine); writer.WriteLine("__TOC__" + writer.NewLine); foreach (string key in typeLists.Keys) { if (typeLists[key].Length > 0) { writer.WriteLine($"=={key}=={writer.NewLine}"); writer.WriteLine(typeLists[key].ToString()); } } } } using (StreamWriter writer = File.CreateText($"out/{assembly.GetName().Name}.txt")) { writer.WriteLine("==Namespaces==" + writer.NewLine); writer.WriteLine(namespaceList.ToString()); } } } } }
"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
If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
#6
29th Jan 2021 at 10:13 AM
Posts: 3,860
Thanks: 8579 in 67 Posts
Quote: Originally posted by gamefreak130
Alright, well that didn't take quite as long as I thought it would. There should now be pages for all namespaces in the assemblies, and each page lists out the types in that namespace. I didn't know what to do with nested types (like the Definition classes in interaction objects), so I just left them out for now. I also didn't touch the two pages from SimIFace that @Lyralei had started filling in. Other than that, the scaffolding should be set up to actually fill in type information! Oh, and if you're wondering how I did it, here's the code I wrote to generate the pages, in all its LINQ-ing glory:
Code:
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; namespace TS3PRGenerator { class Program { static void Main(string[] _) { Assembly[] assemblies = { Assembly.Load("Sims3StoreObjects, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("ScriptCore, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("SimIFace, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("Sims3GameplaySystems, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("Sims3GameplayObjects, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("Sims3Metadata, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null"), Assembly.Load("UI, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null") }; foreach (Assembly assembly in assemblies) { if (!Directory.Exists($"out/{assembly.GetName().Name}")) { Directory.CreateDirectory($"out/{assembly.GetName().Name}"); } var types = from type in assembly.GetTypes() where !type.IsNested && !type.Name.Contains("<") orderby type.Name group type by type.FullName.Substring(0, type.FullName.LastIndexOf('.')) into g orderby g.Key select g; StringBuilder namespaceList = new(); foreach (var group in types) { Console.WriteLine($"\n{group.Key}\n"); namespaceList.AppendLine($"*[[/{group.Key}/]] -"); Dictionary<string, StringBuilder> typeLists = new() { { "Classes", new() }, { "Structs", new() }, { "Interfaces", new() }, { "Enums", new() }, { "Delegates", new() } }; foreach (Type type in group) { Type[] genericTypes = type.GetGenericArguments(); string typeName = genericTypes.Length > 0 ? $"{type.Name.Substring(0, type.Name.LastIndexOf('`'))}" : type.Name; //<{string.Join<Type>(", ", genericTypes)}>" : type.Name; Console.WriteLine(typeName); switch (type) { case { IsClass: true } when typeof(Delegate).IsAssignableFrom(type): typeLists["Delegates"].AppendLine($"*[[/{typeName}/]] -"); break; case { IsClass: true }: typeLists["Classes"].AppendLine($"*[[/{typeName}/]] -"); break; case { IsEnum: true }: typeLists["Enums"].AppendLine($"*[[/{typeName}/]] -"); break; case { IsValueType: true }: typeLists["Structs"].AppendLine($"*[[/{typeName}/]] -"); break; case { IsInterface: true }: typeLists["Interfaces"].AppendLine($"*[[/{typeName}/]] -"); break; } } using (StreamWriter writer = File.CreateText($"out/{assembly.GetName().Name}/{group.Key}.txt")) { writer.WriteLine("This Page is currently simply a stub, if you have information to contribute on any of these classes, please create the page and add info about it to this page." + writer.NewLine); writer.WriteLine("'''Please ensure you give separate headings for classes, enums, interfaces and other object types'''" + writer.NewLine); writer.WriteLine("__TOC__" + writer.NewLine); foreach (string key in typeLists.Keys) { if (typeLists[key].Length > 0) { writer.WriteLine($"=={key}=={writer.NewLine}"); writer.WriteLine(typeLists[key].ToString()); } } } } using (StreamWriter writer = File.CreateText($"out/{assembly.GetName().Name}.txt")) { writer.WriteLine("==Namespaces==" + writer.NewLine); writer.WriteLine(namespaceList.ToString()); } } } } } |
Also, I don't think the WIki has seen this much activity in it's changes in a looooong time :p
#7
31st Jan 2021 at 10:32 AM
Posts: 3,860
Thanks: 8579 in 67 Posts
@gamefreak130 Am about to change the bits in the SimIface that needs their own class pages into the correct way, although I was thinking. in the case of Sims3 it only has 3 enums in it: http://simswiki.info/wiki.php?title.../SimIFace/Sims3
Do you think it would be worth splitting that into different pages or just keep them together?
Do you think it would be worth splitting that into different pages or just keep them together?
#8
31st Jan 2021 at 3:57 PM
Posts: 437
Thanks: 5342 in 22 Posts
Quote: Originally posted by Lyralei
@gamefreak130 Am about to change the bits in the SimIface that needs their own class pages into the correct way, although I was thinking. in the case of Sims3 it only has 3 enums in it: http://simswiki.info/wiki.php?title.../SimIFace/Sims3 Do you think it would be worth splitting that into different pages or just keep them together? |
I would say to split just for consistency. If we have a bunch of stubs that way, then we have a bunch of stubs, but I think it'll make for easier searching of relevant material.
"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
If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
#9
1st Feb 2021 at 4:09 PM
Posts: 3,860
Thanks: 8579 in 67 Posts
Quote: Originally posted by gamefreak130
I would say to split just for consistency. If we have a bunch of stubs that way, then we have a bunch of stubs, but I think it'll make for easier searching of relevant material. |
I also split the SimIface stuff and currently busy creating an easier way to see what links to what by adding sort of like a TOC to the pages, like so:
http://simswiki.info/wiki.php?title...e/BlockedStatus
Animation priority is also a great example of what happens when there is a page there that exists
http://simswiki.info/wiki.php?title...imationPriority
#10
11th Mar 2021 at 11:16 AM
Posts: 3,860
Thanks: 8579 in 67 Posts
I added the super helpful excel sheet with terminology to the documentation as well!
(http://simswiki.info/wiki.php?title...r.27s_Reference) - See terminology
Thread where we're discussing the terminology: https://modthesims.info/showthread....0<br /> <br />Oh and I added a reference link in the programmer info tab, in case people are looking for other programmer info :p http://simswiki.info/wiki.php?title...oding_Tutorials
Also! Should we sticky this thread as well? I'm not sure if it's helpful at all?
(http://simswiki.info/wiki.php?title...r.27s_Reference) - See terminology
Thread where we're discussing the terminology: https://modthesims.info/showthread....0<br /> <br />Oh and I added a reference link in the programmer info tab, in case people are looking for other programmer info :p http://simswiki.info/wiki.php?title...oding_Tutorials
Also! Should we sticky this thread as well? I'm not sure if it's helpful at all?
Test Subject
#11
11th Mar 2021 at 2:53 PM
Posts: 32
Thanks: 182 in 8 Posts
I personally think it would be great to have it stickied.
#12
11th Mar 2021 at 4:17 PM
Posts: 845
Thanks: 371 in 3 Posts
Didn't know this page existed, it is so helpful! Thank you for cleaning it up and I agree with WhacktheM0l3, making it a sticky post would be great.
#13
12th Mar 2021 at 8:12 PM
Posts: 3,860
Thanks: 8579 in 67 Posts
Allright! used my admin-y powers and sticked it!
I'll try and add some more documentation wherever I can whenever I got more time Since the idea is to explain particular concepts in the docs as well where needed WHich Illspy doesn't necessarily help with
I'll try and add some more documentation wherever I can whenever I got more time Since the idea is to explain particular concepts in the docs as well where needed WHich Illspy doesn't necessarily help with
#14
14th Jan 2023 at 6:50 PM
Posts: 62
Thanks: 149 in 2 Posts
This is awesome! Very helpful thank you!
Who Posted
|