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!
Lab Assistant
Original Poster
#1 Old 30th Apr 2020 at 5:01 AM
Default Script Modding In 2020
...Yes, hi. I'm back again. This might sound stupid, but I'm gonna say it anyway. Lately, I've been working on my knowledge of C# so I can dip my toes into script modding, and at the moment I like to think I have a pretty good understanding of it, but I've hit a roadblock. Right now I have the current versions of Visual Studio and NET Reflector, and I'm reading the tutorials and things aren't quite matching up. Does this mean I should find the older versions of these two softwares or does this mean that the current tutorials should be updated to fit in line with the newer versions of the software?

Oh c'mon. There better be a point to all this stress I'm under.
Advertisement
Senior Moderator
staff: senior moderator
#2 Old 30th Apr 2020 at 11:02 AM
You don't need the older versions of the software, especially not Visual Studio, and probably not Net Reflector. I actually use ILSpy instead of Reflector which works perfectly fine. What is that you're struggling with it not matching up? Is it referencing mscorlib? because I remember that being a bit different with new versions of VS
Lab Assistant
#3 Old 30th Apr 2020 at 1:34 PM
I ran into this same problem, the software gets updated but the tutorials do not..........
Lab Assistant
Original Poster
#4 Old 30th Apr 2020 at 1:35 PM
Switched from Net Reflector to ISpy and that fixed one of my problems, so we're moving in the right direction. As for my other problem, yes actually; how do I set VS to not reference mscorlib? I tried following the tutorial but I'm either stupid or something might not be adding up. Either way, it lost me.

Oh c'mon. There better be a point to all this stress I'm under.
Space Pony
#5 Old 30th Apr 2020 at 3:25 PM Last edited by Battery : 30th Apr 2020 at 4:51 PM.
You could use SharpDevelop which has the benefit that it doesnt change as visual studio does (it has other advantages aswell)

(Attention shameless selfplug ) Its a shame that the main Tutorial page make it seem that only Visual Studio is the way to go with sims 3 script modding and doesnt mention Sharp develop.

If you for some reason you want to stay with Visual studio (probably because you already installed it) see Step 3

E: Proper Visual Studio problem solution see Zoe's post below
Senior Moderator
staff: senior moderator
#6 Old 30th Apr 2020 at 4:32 PM
True, SharpDevelop might be better especially if you're not already used to VS.
Also, if you are using VS (later versions like 2017) and are trying to do Step 6, I don't think you can find the .csproj in the project folder like it says in that tutorial.
What you need to do is when your project is open, right click on the project name on the right hand side in the Solution Explorer, and click "unload project". Then right click on it again and there is an option to edit the .csproj file. Then you can paste that chunk of code where it needs to go, close the .csproj, and reload your proj.
Hope this isn't too confusing.

edit:
Here is where I got this info from, the top answer explains how you do it:
https://stackoverflow.com/questions...dit-csproj-file

Also just to clarify, Step 3 is where it shows you how to set it to not reference mscorlib for older versions, and mentions that it's different for 2012+ versions. Step 6 is where it tells you how to manually set it to not reference mscorlib for these later versions. But for even later versions (2017 at least which is what I'm using) the other thing that differs is how to find the .csproj file for editing.
Lab Assistant
#7 Old 30th Apr 2020 at 5:26 PM
Speaking of VS, I'm having problem with references. Under the assemblies; mscorlib, System and System.Xml have very cute(!) yellow triangles next to them that prevents the code from compiling properly. I should note that while adding those references I get "reference is invalid or unsupported" error, so I had to add them by editing the project file. Thanks to Battery, I can successfully compile in SharpDev but I really like writing in VS so I end up using both; which causes some problems time to time due to C# version difference.
Senior Moderator
staff: senior moderator
#8 Old 30th Apr 2020 at 9:52 PM
Hmm I'm not sure why that would happen when you add the references. I know that if the references are moved to another location in your files then you have to re add them so it's looking to the right place for them, but no idea why they'd be invalid when you add them in.
Are they the dlls that you extracted yourself? You could try using the extracted and unprotected dlls from Inge I think at Simlogical:
http://simlogical.com/ContentUpload...e/uploads/1686/
Lab Assistant
Original Poster
#9 Old 1st May 2020 at 2:38 PM
Alright, I tried using SharpDevelop, and I used it for a good five hours testing my knowledge of C# by applying it to mod making. Turns out I need to learn a lot more because a lot of shit doesn't make sense to me, so back to scouring the internet for information on C#. But during those five hours I did learn that SharpDevelop is relatively easier to use than VS, but I find that I like writing in VS more and the Dark Mode is too much of a blessing to give up. So, I'm back using the 2019 version of Visual Studio Community, and the solution for getting the project to not reference mscorlib.dll isn't possible for my version, but I think I figured out a different way. In the Solution Explorer I can open the myproject.csproj file and edit it using Notepad++ and then save it. @zoe22 will this method work just fine? Also, the code you have to input, this one right here:

<ItemGroup>
<Reference Include="mscorlib">
<HintPath>... Path to where Sims 3 mscorlib.dll is on your computer ...</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>

Do I keep the ellipses and the space between them and the path to where mscorlib.dll is on my computer?

Oh c'mon. There better be a point to all this stress I'm under.
Senior Moderator
staff: senior moderator
#10 Old 1st May 2020 at 2:55 PM
Hmmm off the top of my head I don't think you need the ellipses. But if you've added the other other references, you should see them in the .csproj file and how the paths are laid out?

Re learning about C#, if you are struggling with specific language related things, or writing actual code in order to calculate something etc, definitely Google it and read about it online, but at the same time I also found a big struggle more to be understanding the specific sims code /methods and how they work, what calls what, how interactions are set out and such.
I actually had a somewhat good knowledge of C# before I started sims modding and there was definitely a big learning curve even then!
So I guess I'm just trying to say that yes it's helpful to have an understanding of coding with c#, and the basics of how programming and object-oriented programming works, but I think the biggest step in learning modding for sims is actually learning the simmy code itself, which just takes time, practice, and of course asking on here for help!

At least that was just my experience, it might be different for others but I thought it was worth mentioning :P
Lab Assistant
Original Poster
#11 Old 1st May 2020 at 3:43 PM Last edited by LittleCheshire : 1st May 2020 at 4:16 PM.
Thanks, I'll do that! You've been a really big help, ya know? I'm trying to make new moodlets for pets so I've been trying to learn all that I can. Would you happen to know if there is any more information about adding moodlets into the game other than the tutorial that NonaMena has on the tutorials page? Also, where can I find Twallan's STBL Program and Peter's Unprotect? The links to them are dead. I still remain of the opinion that the modding tutorials on the MTS Site page should be updated for that reason; some things in the tutorials no longer apply and plenty of links are dead.

Oh c'mon. There better be a point to all this stress I'm under.
Senior Moderator
staff: senior moderator
#12 Old 1st May 2020 at 4:20 PM Last edited by zoe22 : 1st May 2020 at 4:32 PM.
I'm glad I can help, sometimes I feel very confused myself with things so
And no, I've actually not really looked into custom moodlets before.
But having a look, it seems like Nona Mena's tutorial is the best

edit: just saw your edit, not sure where Twallan's STBL program is but you can use this instead.
As for the unprotector, you can just use the already extracted and unprotected dlls at simlogical here

And yep, it is a shame that the tutorials are so out of date, which makes it difficult for complete newbies to learn things. But the only solution is for us to write some new tutorials ourselves!
Lab Assistant
#13 Old 1st May 2020 at 8:10 PM
Thanks @zoe22 but I still get errors with unprotected ones. The problem might be their name, I think VS is complaining bcuz it conflicts with system's original dll's.
Senior Moderator
staff: senior moderator
#14 Old 1st May 2020 at 11:01 PM
Hmmm that's really weird, did you remove all the existing references first?
Lab Assistant
#15 Old 1st May 2020 at 11:14 PM
Ok I just solved it. Turns out it's bcuz I was an idiot
Instead of .NET Framework template I've picked .NET Standard somehow
Sorry to trouble you all :D
Senior Moderator
staff: senior moderator
#16 Old 1st May 2020 at 11:32 PM
Ahh don't worry about it, I think I actually did that once when I was setting up a project! Glad it's sorted and you can get on with the modding!
Virtual gardener
staff: administrator
#17 Old 3rd May 2020 at 10:46 AM
Quote: Originally posted by LittleCheshire
Thanks, I'll do that! You've been a really big help, ya know? I'm trying to make new moodlets for pets so I've been trying to learn all that I can. Would you happen to know if there is any more information about adding moodlets into the game other than the tutorial that NonaMena has on the tutorials page? Also, where can I find Twallan's STBL Program and Peter's Unprotect? The links to them are dead. I still remain of the opinion that the modding tutorials on the MTS Site page should be updated for that reason; some things in the tutorials no longer apply and plenty of links are dead.
The ones in the forums going to the old simlogical site seem to be a bit dead, although I went out of my way and updated the links in here: http://modthesims.info/wiki.php?tit..._GeneralModding
To the PDF versions (or raw HTML versions) of the page itself, I know it's not all tutorials but it does make life a bit easier

Usually though, if you get an error, if you just go to this list: http://www.simlogical.com/ContentUp...ploadsIndex.htm , Then all you need to do is CTRL+F and find the tutorial's name. It's a bit grinding! But it's definitely worth it!
Lab Assistant
Original Poster
#18 Old 11th May 2020 at 5:40 PM
Although the links in NonaMena's custom moodlet tutorial are still dead I want to thank you for your time, @Lyralei updated links are always nice. While I'm still here, does anyone know of sites or other resources that will teach me C# in depth for free? I want to learn all that I can.

Oh c'mon. There better be a point to all this stress I'm under.
Senior Moderator
staff: senior moderator
#19 Old 11th May 2020 at 11:17 PM
Im sure there are a few, but I used SoloLearn which is pretty good.
Virtual gardener
staff: administrator
#20 Old 12th May 2020 at 2:23 PM
I usually say this to Javascript developers, who just start out and know the basics:

"The core of programming is not necessarily knowing the ins and outs of the language, it's how you apply the logic!".

Now, coding for the sims is a tad different compared to regular C# tutorials on creating programs and writing things in the command prompt/terminal . I actually would suggest looking at some C# Unity tutorials! They use a similar system as TS3's scripting methods, it really helped me out at least!

Here are a few recommendations: 
https://www.youtube.com/channel/UCP...Wh5OdCwEO60Y8jQ
(This one is 7 hours long, so buckle up! :p ) https://www.youtube.com/watch?v=2KTyAj0JCpI

I do want to mention though, that whenever I script stuff for TS3 (And totally did this a lot for my sewing table mod), I copy/paste the heck out of what EA wrote :p As long as I understand what it does, I'll use it though. I think it's fair to say that most script modders actually don't write their code entirely on their own and from scratch but simply use EA's code and mash it into a working thing
Lab Assistant
Original Poster
#21 Old 13th May 2020 at 1:54 AM
Thanks for the recommendations! I'll be making use of them, and I'll buckle down and watch the 7-hour long one when I have the time. I would also actually copy/paste the stuff the EA wrote if I could find the code for the stuff I'm looking for. How do you reuse something you can't find, after all? I wish I could have the game open and the code flowing by where I can see it so I know what code to take and shape it to what I need it to be.

Oh c'mon. There better be a point to all this stress I'm under.
Virtual gardener
staff: administrator
#22 Old 13th May 2020 at 9:11 AM
Quote: Originally posted by LittleCheshire
Thanks for the recommendations! I'll be making use of them, and I'll buckle down and watch the 7-hour long one when I have the time. I would also actually copy/paste the stuff the EA wrote if I could find the code for the stuff I'm looking for. How do you reuse something you can't find, after all? I wish I could have the game open and the code flowing by where I can see it so I know what code to take and shape it to what I need it to be.
We're here to help though! Sometimes the things you need is in the weirdest places :p I mean, sometimes I end up hours upon hours to eventually find something that works with my edge case. Although in some cases, the best thing to do is using pseudocode: https://www.geeksforgeeks.org/how-t...-a-pseudo-code/

Which is basically, writing down the logic  So instead of thinking "how would I approach it in this particular language" with pseudocode you change it to "How would I approach this logistically speaking?". It really helps as a beginner! And even with long, complex functions

Quote:
I wish I could have the game open and the code flowing by where I can see it so I know what code to take and shape it to what I need it to be.
That would be awesome but alas :/. I mean the code you write in visual studio, etc. You compile it into bytes when building it, which is what the computer/engine ends up reading. Hence why reverse engineering dlls and discovering all these 'types' you see in S3PE takes so long. (And why some are still seen as 'Unknown'. Or really, there not being that many people out there who know how to do it. :/

Just out of curiosity! You do use ILSpy right?  Because that also has an easy search option.
Lab Assistant
Original Poster
#23 Old 13th May 2020 at 4:13 PM
Yup, I use ILSpy. Also, I have a question--Gods, I've been asking questions a lot and I'm embarrassed--should I add Buzzler's code first before adding the code for the custom moodlet I'm trying to make, or is that unnecessary and I can just start coding for the moodlet?

Oh c'mon. There better be a point to all this stress I'm under.
Virtual gardener
staff: administrator
#24 Old 13th May 2020 at 7:25 PM
Quote: Originally posted by LittleCheshire
Yup, I use ILSpy. Also, I have a question--Gods, I've been asking questions a lot and I'm embarrassed--should I add Buzzler's code first before adding the code for the custom moodlet I'm trying to make, or is that unnecessary and I can just start coding for the moodlet?
Hey no worries!  The more questions you ask, the more you learn!

As far as my knowledge goes on buffs, you basically need to only sort of 'hook into' the custom buff code that is used for store buffs: http://www.simlogical.com/ContentUp..._Script_Mod.pdf

After that, you should be good to go!  You do have an instantiator xml right? 
Lab Assistant
Original Poster
#25 Old 15th May 2020 at 3:30 AM
Hook into the custom buff code that is used for store buffs, got it. I understand that. As for having an instantiator xml, I actually don't think I have that? I have an instantiator, "Cheshirefrown", but not an instantiator xml I don't think. How do I get that? I looked around and the links to the example instantiator class and instantiator xml to import into S3PE are dead.

Oh c'mon. There better be a point to all this stress I'm under.
Page 1 of 3
Back to top