PDA

View Full Version : TUTORIAL: Core Modding! (For complete and total nincompoops, like me!)


BailaBaila99
10th Jul 2009, 10:15 PM
So I've always had this dream of one day, having my own cooking show. The tagline would be: "I have no idea how to cook, so if I can do it, you can too!"

That's basicly the idea behind this tutorial. I do not possess l33t skills like Pescado or Lemmy101 or Delphy. In fact, until yesterday, I had no idea how to core mod. But I bugged the hell out of the right people until they held my hand and walked me through it, and now, that's what I'm going to do for you, as a public service to those great modders, so that you won't have to bug them like I did. At least, maybe you'll bug them with slightly less stupid questions than mine. But enough introductions, let's get started. Oh, one more quick thing before that. This tutorial was not written by me. Well, it was, but not really. Really it was written a little bit by Delphy (whom I pestered in the chatrooms) and for the most part by Lemmy101. They showed me exactly what to do, I took notes, and now I'm passing it on to you. I'm just the middleman.

I. What is core modding?

A lot of you are probably familiar with XML tuning, a tutorial about which can be found right here on this very forum. A lot of you, also, probably know that XML tuning's fatal flaw is its ridiculous limitations! If you want to make some very minor adjustments to the way the game works, XML may be able to do it, and you should definitely check there first, but most everything else about the game is deeper coded in 3 main DLL files. It turns out that even some very minor changes can only be made in these DLL's, but the plus side of that, is that the limitations are almost non-existant here. If you wanted to turn the Sims 3 into a first-person shooter set in a giant themepark with zombie clowns on the loose, well you might not be able to do that, but frankly I wouldn't be surprised. Editing these DLL's, however, is a kick in the head, but it's worth it if you want to mod the game, and even though it's a labor-intensive process, it actually ISN'T something far beyond the abilities of the average Joe Shmoe on this forum, thanks to the geniuses who figured it all out for us. Believe me, if I can do it, say it with me, you can too.

II. Ok, first of all, let's go over the laundry-list of programs you will need.

A. First, and foremost, you will need S3PE, which is in the early stages of becoming what SimPE was to TS2, if you don't already have it, get it here: S3PE (S3PI Demo Package Editor) (http://www.simlogical.com/Sims3ToolsForum/index.php?topic=171.0)

AA. Also, I hope this goes without saying, but you need the modding framework and Resource.cfg for your Sims 3 directory, in order to run any mod, and you MUST have the included d3dx9_31.dll file, in the correct directory, to run any core mod. If you don't already have 'em, get them here: Framework (http://www.moreawesomethanyou.com/smf/index.php?topic=15184.0). (Note: if your game freezes during the initial loading screen with any core mod installed, it's because you don't have d3dx9_31.dll, or you don't have it in the right directory)

B. You will also need the latest .NET framework to be able to use the aforementioned program. If you already have it, move on to bullet C, if not, go here: .NET Framework (http://www.microsoft.com/net/Download.aspx) AND you'll need the .NET sdk 2.0 for other stuff, so if you don't already have it, get it here: .NET SDK 2.0 (http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en). And finally, (thanks to TigerM and Lemmy for pointing this out) you're definitely going to need the Windows SDK (http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx) as well, if you don't already have it.

C. The .NET Reflector is a program that will give you a free peep-show of the DLL's you'll be modifying in a straight-forward intelligible format that I'm confident some species of monkeys would have little trouble deciphering, but will not let you edit them (at least, not in the correct way, and not without wreaking havoc on your game). Why is this necessary, you ask? Because the DLL's are not made to be edited in their present state, after we convert them to a format we CAN edit, they will be much, much harder to read. Seriously, those monkeys from before, they will cry. Just trust me and get the program. .NET Reflector (http://www.red-gate.com/products/reflector/)

D. Notepad can only handle so much abuse, and unfortunately it is ill-equipped to open the vast filesizes we need it to open. You'll need Notepad++ (http://notepad-plus.sourceforge.net/uk/site.htm) .

E. ILASM and ILDASM: After you have installed all of the above, you will need to make use of two programs that should probably ALREADY be on your computer. The trouble is finding them, as they can be in a number of places. The first place to look, however, would be any of the many folders occupied by Microsoft's .NET in your system folders, i.e. Program Files and Windows. You will need to COPY (do not take them out, COPY them!) the exe files for these programs, and any dll's or other files they may need in order to run, to a new folder, anywhere on your computer, which is going to be your new modding workstation. Just make a folder in My Documents if you want and call it "MyStupidMod." Whatever floats your boat. My guess is that you'll need the same files I needed, which are: ilasm.exe, ilasm.exe.config, fusion.dll ildasm.exe and ildasm.exe.config .

Here's where I found mine, but yours may be somewhere different. If all else fails, try running a search of your entire computer to find the files. I found ilasm.exe, ilasm.exe.config, and fusion.dll in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727, and I found ildasm.exe and ildasm.exe.config in C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin .

Again, I can't stress enough, COPY them instead of moving them.

F. Last though certainly not least, a statement riddled with irony that you will only come to contemptuously appreciate once you actually begin to download and install this last program, is Visual C# 2008 Express Edition (http://www.microsoft.com/express/vcsharp/) . But don't go and download it just yet! Listen, this is a very handy and free program that will allow you to create C# code, but it may not be entirely necessary for you. It is definitely necessary if you are looking to create a more in-depth, larger scale mod, like the Indie Stone mod. For my mod, however, I only needed to change a single value, and I didn't open this program once in the process. Basicly, if you want to create new DLL's, you're going to need this program (or you can choose to do a pretty advanced workaround described by Rick and TigerM below). If you just want to modify the existing DLL's, skip this step, for sanity's sake, and move on. The only real reason for the hesitation here, is that this program takes a LONG ASS TIME to install. If you do end up installing it, make sure you have a good book. Or the firefox Stumble! add-on. Basicly, you're gonna have some time to kill.

That's it! Once you've gone through all of these steps, you are finally set up to core-mod. Now we can get started. (Didn't I tell you this was labor-intensive?)

III. Preparing the files for editing

A. First things first, open S3PE, and you'll need to open the right package and extract the right file. For your specific case, I don't know what you want to do here. You might want to make a fresh, new mod for the Sims 3 base game, or you might want to add some small detail to an existing mod that you can't live without. (note that if you want to keep your Indie Stone or Awesome Mod, you must make your changes to THESE mods, due to the highlander rule, there can only be one. This wouldn't be true of XML tuning, but we're in Core Modding country now, and things aren't quite as simple (yet)) There are 3 main DLL's that control nearly every aspect of the game. These are: Sims3GameplaySystems.dll (likely the one you're going to want to edit), Sims3GameplayObjects.dll, and UI.dll . Both Awesome Mod and Indie Stone modify all three, (which is why the are incompatible, and would be even if they only modified one in common).

So, if you want to edit the basegame, open ProgramFiles\Electronic Arts\Sims 3\Game\Bin\Gameplay.package (NOT GameplayData.package, that was for XML). If you want to edit an existing mod, open that mod's package. Either way, you will see a short list of files (anywhere between 1 and 4 of them), and you need to pick the correct one to edit. To do so, select each, one at a time, and press "Value". In the window that pops up, you should see a line that says "ManifestModule:" and after this will be the original filename (it should have .dll at the end). When you've found the one you want to have a go at, make sure it's still selected, and click "Grid", then Import/Export, Export, and navigate to the directory we set up earlier as your workstation. Now, save it as the filename you saw earlier, when you checked the Value. For instance, if you're exporting Sims3GameplaySystems.dll, you'll want to save it as that. And don't forget the .dll!

B. Now, open the .NET Reflector program, and use it to open the dll you just exported. (NOTE: If you have trouble opening the file, it is likely because you don't have it in the same folder as ILASM and ILDASM. If you do, then something is wrong with these programs, or your file. Go back and make sure you followed these steps correctly.) You'll have to click some plus signs in the left window once you open it, to see what's inside, but what you'll find is a very handy display of the entire contents of the file. Take this opportunity to do some detective work. Once you find an item that looks like what you probably want to edit, double-click it, and you'll see its contents in the right window. My goal was to make a "No Privacy" mod, so I went to Sims3GameplaySystems > Sims3.Gameplay.Situations > GenericPrivacySituation > OtherSimCanIgnorePrivacy(Sim) : Boolean, and found the following:

public override bool OtherSimCanIgnorePrivacy(Sim sim)
{
return sim.SimDescription.ToddlerOrBelow;
}

Now, the syntax might be scary, but hopefully a 5-year-old wouldn't have too much trouble ascertaining what's going on here. The condition, OtherSimCanIgnorePrivacy, is checking two factors, 1: is the invading Sim a spouse? and 2: Is the invading Sim a toddler or baby? If either of these factors is true, the condition returns true (and the sim is allowed to ignore privacy in the situation) but otherwise, it returns false (and the sim pitches a fit, gets embarrassed, and no one ends up using that bathroom). Well, I wanted to skip these two checks entirely, and simply return "true."

If we could edit this RIGHT NOW, in a mostly legible fashion, the world would truly be filled with sunshine and puppy dogs, but sadly it's a cruel, cruel place, and we can only view the code here. On to C.

C. We must convert our little DLL into a behemoth of a file of another type, called IL. The code will all be converted, so that we can edit it, into a much less user-friendly (if not a downright user-asshole) format, the filesize will be somewhere around 50mb. To do this, we need ILDASM, one of those strangely named programs we put in our workstation folder earlier. (REMEMBER: ILDASM is for IL Disassembling, and ILASM is for IL Assembling. Basicly, ILDASM = DLL>IL, ILASM = IL>DLL) Don't go and double-click it, that won't work. Here's what you do:

Go to start > run, and type "cmd". This will bring up a DOS console, and you'll need to navigate to the directory we're working in. To do this in DOS, type "cd directoryname" where directoryname is the name of the folder you're navigating to, in My Documents. If you need to go up a folder, type "cd.." . If you're having trouble with this, go here (http://www.computerhope.com/cdhlp.htm). Once you've gotten to your workstation directory, type the following (NOTE: syntax can be tricky):

ildasm filename.dll /output=filename.il

I'm hoping you already figured out what you're supposed to type in place of "filename." If all goes well, a window should appear and a progress bar should begin traversing a small window on your screen, and when it finishes you will have an IL file in your workstation directory.

IV. Making your Edit! (FINALLY!)

Now you'll want to use Notepad++ to open the IL file you just created. Take a moment to recover from the shock of how lengthy this file actually is. Go ahead, I'll wait for you. Ok, traversing the breadth of this file is going to be a headache, so you'll want to use the Search option a lot. (NOTE: The search box has an up/down toggle. Just so ya know.) Start by searching for some of the terms you found when you did your detective work in the .NET Reflector earlier. If you don't remember them, you can re-open it and check, the dll is still there. These terms will likely occur multiple times in the document, but if you pick something really specific to search for, you won't have to do quite as much hunting. I searched for "CanIgnorePrivacy" and found a few dead-ends, but finally came across this (the definition of the method I was looking for):

.method public hidebysig virtual instance bool
OtherSimCanIgnorePrivacy(class Sims3.Gameplay.Actors.Sim sim) cil managed
{
// Code size 12 (0xc)
.maxstack 8
IL_0000: ldarg.1
IL_0001: callvirt instance class Sims3.Gameplay.CAS.SimDescription Sims3.Gameplay.Actors.Sim::get_SimDescription()
IL_0006: callvirt instance bool Sims3.Gameplay.CAS.SimDescription::get_ToddlerOrBelow()
IL_000b: ret
} // end of method GenericPrivacySituation::OtherSimCanIgnorePrivacy

This is MSIL code, and if you don't know how to edit it, well, neither do I. You can read up on it, on the internet, I'm told, and you can check out this helpful topic (http://www.simlogical.com/Sims3ToolsForum/index.php?topic=242.0) by Lemmy101, {UPDATE: Also check out Lemmy's New IL / DLL Tutorial (http://www.modthesims.info/showthread.php?t=355295)} but really, this is where the real difficulty, and creativity comes into play.

I can tell you, however that those strange bits like "IL_0001" are the line numbers inside the {curly brackets}, and that there cannot be two with the same name inside the same set of brackets.

Now, I probably would have had to play around with this file and think really hard for days until I figured out how to make the simple change of defining this condition as simply "true," but Lemmy101 geniusly pointed out that we could just copy and paste from the method ABOVE this one, which happened to be the following:

.method public hidebysig virtual instance bool
OtherSimCanJoinSituation(class Sims3.Gameplay.Actors.Sim otherSim) cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldc.i4.0
IL_0001: ret
} // end of method GenericPrivacySituation::OtherSimCanJoinSituation

The condition OtherSimCanJoinSituation for GenericPrivacySituation is simply returning "false." We want to the CanIgnorePrivacy method to return "true." So, we copy and paste, with one little change. Apparently, the item that's really doing the work here is the unassuming "ldc.i4.0". I have no idea what the hell this means, but lemmy told me to change it to a .1 (for true) instead of a .0 (for false). Here's what our new code looked like:

.method public hidebysig virtual instance bool
OtherSimCanIgnorePrivacy(class Sims3.Gameplay.Actors.Sim sim) cil managed
{
// Code size 12 (0xc)
.maxstack 8
IL_0000: ldc.i4.1
IL_0001: ret
} // end of method GenericPrivacySituation::OtherSimCanIgnorePrivacy

Then save, and that's that. On to V.

V. Un-preparing the file and sticking it in your game.

A. First things first, we need to get our edited IL file back into DLL form. Before you do, though, consider that you might not want to replace your original DLL you exported way back in an earlier step that I'm too lazy to look up the name of. If you don't want to replace it, rename it something silly, and it'll be left alone. If you just don't care, the let it be. Now go back to that cmd DOS window. In your workstation directory, enter the following, using ILASM this time, and again remember that the syntax is tricky:

ilasm filename.il /dll

You should see a vortex of text come careening down the window at you. It will do this for a good 30 seconds though, so you can take this opportunity to pretend you're Neo from the matrix.

If all goes well, (and this is the part you have to cross your fingers for) it will finish up and say "Operation Completed Successfully" and you'll have a newly modded .dll file in your directory. Whatever the name of this dll is, make sure to change it (if need be) to that original filename we saw in S3PE > Value at the start of this whole mess.

...If it FAILS, then either you didn't type it in the DOS window correctly (and you're hoping for that possibility, trust me) or your mod code doesn't make sense, and it couldn't compile it. In which case, you'll have to figure out what you did wrong back in Notepad++ and try again. (and again and again and again)

B. Once you've got your DLL file finished ILASM'ing, go ahead and open it with Reflector. Check the part or parts you modified, and see if you managed to do what you were trying to. Did it work?

C. If so, open S3PE, and depending on whether you're editing an existing mod, or creating your own new base-game mod, either open the mod package, or simply create a new one.

If you're going with door number one, then all you'll have to do is find that original file you exported before in the mod package (making sure it's the same one by clicking "Value") and simply select it, then Grid > Import and choose the DLL that's still warm from the ILASM. When it asks you if you want to commit the change, say yes, and then save the package and put it in your ProgramFiles\ElectronicArts\Sims3\mods directory (making sure there's no other core mod packages already in there, as they will almost certainly conflict).

If you're more of a number two person, then you'll need to re-open the original gameplay.package (in a new window of S3PE, for your convenience) and find the file you exported before. Now, in the other S3PE window, your new package window (DO NOT ADD ANYTHING TO THE ORIGINAL GAMEPLAY.PACKAGE FILE! Your sims will all die horrible deaths and so will your computer.) go to Resource > Add Resource, and copy in the Type and Instance from the file in gameplay.package EXACTLY. The group should simply be "0x00000000" (that's zero x and 8 zeros). After you've added the resource, select it, and Grid > Import, choose the ILASM'ed DLL and commit, then save, put the package in your mods directory, making sure there's no other core mods present (as they will almost certainly conflict) and you're done!

// End of Tutorial *whew*

Anyway, I wish you all the best of luck with your modding, and I can't wait to see what you create. Note that during the majority of the steps in this tutorial I had no idea what the hell I was doing, and if your results turn out different than mine in any area, I will try my best to offer help, but it's more than possible that I'll be of no more use to you at that point.

Also, if anyone thinks they can improve or expand this tutorial, I have only this to say. OH SO YOU THINK YOU CAN DO IT BETTER, HUH? No, really, that would be awesome. Any flaws you can point out on my part, or any extra guidance you can offer in the MSIL editing part (which deserves a whole other tutorial) would be welcome.

That's it, thanks again to Lemmy101, and good luck to you all!

References:
Lemmy's IL and DLL Tutorial (http://www.modthesims.info/showthread.php?t=355295)
Sims Wiki: Sims 3: 0x073FAA07 (http://www.sims2wiki.info/wiki.php?title=Sims_3:0x073FAA07)
Sims 3 Tools Forum: Export / Import assemblies (http://www.simlogical.com/Sims3ToolsForum/index.php?topic=107.0|)
Sims 3 Tools Forum: Assembly Errors. What am I doing wrong? (http://www.simlogical.com/Sims3ToolsForum/index.php?topic=242.0)
Sims 3 Tools Forum: On making a tutorial for Making a core mod (http://www.simlogical.com/Sims3ToolsForum/index.php?topic=232.0)

Rick
10th Jul 2009, 10:25 PM
ilasm and ildasm mean "IL Assembler" and "IL Disassembler", respectively. They don't mean deconstruct or decompress or what have you.

BailaBaila99
10th Jul 2009, 10:27 PM
Thanks =)

Rick
10th Jul 2009, 10:31 PM
If you havn't made the connection yet, IL (aka CIL, MSIL) is akin to an assembly language, hence why there is an assembler and disassembler.

http://en.wikipedia.org/wiki/Common_Intermediate_Language

SummerMuse
10th Jul 2009, 10:36 PM
@bailabaila99: You are my hero. I will be studying this in depth tonight and over the weekend. THANK YOU!

TigerM
10th Jul 2009, 10:46 PM
This is probably a little beyond a basic tutorial, but I figured I'd put it out there.

As an alternative for people who don't want to download Visual Studios express and are comfortable working in another editor (Like Notepad++) without all the bells and whistles, if you have the .NET framework you already have a C# command line compiler, likely in the same place you found ilasm. It is called "csc.exe". You can find usage information at http://msdn.microsoft.com/en-us/library/78f4aasd(VS.80).aspx. Similarly if you prefer working in VB or JScript you can use vbc.exe or jsc.exe from the same location.

One advantage of doing the command line is you can tell it /nostdlib so it won't link any of the .NET framework libraries, then you just have to use the /reference parameter to import whatever DLLs you need from the game, and you'll be guaranteed you don't accidentally use some class that isn't implemented in the game's runtime. (Theoretically you could do the same thing by removing all the project references in Visual Studios and just browsing to the game's DLLs to import them.)

There is also a compiler that comes with the Mono project, but seeing as how everyone already has the Microsoft compiler, it would take someone extremely obsessed with avoiding Microsoft stuff to go to that extreme.

Rick
10th Jul 2009, 10:49 PM
One advantage of doing the command line is you can tell it /nostdlib so it won't link any of the .NET framework libraries, then you just have to use the /reference parameter to import whatever DLLs you need from the game, and you'll be guaranteed you don't accidentally use some class that isn't implemented in the game's runtime. (Theoretically you could do the same thing by removing all the project references in Visual Studios and just browsing to the game's DLLs to import them.)Yeah, you can do this. This is how I do it. :)

There's one special bit that's required (telling it not to reference mscorlib), other than that it works fine.

BailaBaila99
10th Jul 2009, 10:53 PM
TigerM, I bow before your smarts, but I'm afraid I don't really know exactly what that means yet... If you think I should change anything in the tutorial though, type it up and I'll run it by lemmy! =) Thanks!

TigerM
10th Jul 2009, 10:56 PM
Well the command line part may be a little beyond the scope of your tutorial, but for modifying the references I could take a stab about writing that up. No promises my instructions make sense though because I don't use Express, and I don't know the full extent of features I'm used to that are missing.

Edit: Actually probably the rest is a little beyond the scope of your tutorial as well, since as I re-read it you mainly cover making changes, not adding large scale modifications like Indie or Awesome.

Inge Jones
10th Jul 2009, 10:57 PM
Well BailaBaila, rather than change your nice clear and simple looking tut, you could just add the advanced tips at the end - but remember you'll be asked to support anything you put in your tut, so you may prefer not to add something you don't yourself understand.

jadaytime
10th Jul 2009, 10:58 PM
So I guess in your Sim world there is no more Shooing huh? Now we need the Sim Gods to find a way to have multiple core mods.

SummerMuse
10th Jul 2009, 11:02 PM
There is also a compiler that comes with the Mono project, but seeing as how everyone already has the Microsoft compiler, it would take someone extremely obsessed with avoiding Microsoft stuff to go to that extreme.

Or Mac users. But then again, "someone extremely obsessed with avoiding Microsoft stuff" kind of already says that. :p

/me runs away giggling...

But seriously, I work on a Mac and game on a PC. All my dev tools are on the Mac, but I'm going to dust off Developer Studio and work from the PC rather than trying to get Mono working on the Mac. That way, when--not IF--I run into trouble compiling and patching and linking, I'll be using the same stuff everybody else is.

BailaBaila99
10th Jul 2009, 11:04 PM
jadaytime, no worries, I'm about to upload my mod AND a version that includes the latest Indie Stone mod! =)

Kolipoki
10th Jul 2009, 11:10 PM
i'm a little confused on the islam part

I tried running a search to find the ildasm files and nothing came up

lemmy101
10th Jul 2009, 11:17 PM
Have a read of the Koran you'll figure it out. ;D

TigerM
10th Jul 2009, 11:25 PM
But seriously, I work on a Mac and game on a PC. All my dev tools are on the Mac, but I'm going to dust off Developer Studio and work from the PC rather than trying to get Mono working on the Mac. That way, when--not IF--I run into trouble compiling and patching and linking, I'll be using the same stuff everybody else is.

A little OT, but can I tap you as a resource for mac stuff later? My out of game tools I'm writing in C#, and for the next release I purposely went through and cleaned out anything that wasn't compatible with mono. However I could only test it under mono on Linux, so I'd love feedback from someone with a mac if it works. That would, of course, entail getting mono working on a mac, but theoretically it shouldn't be hard. Also if it works, and you know how to do it, I'd love to know if there was a way to make it easier to use, perhaps even to the point of being able to make another package for mac users that has a bundle they can just click on to launch and not have to fuss with the details.

TigerM
10th Jul 2009, 11:30 PM
i'm a little confused on the islam part

I tried running a search to find the ildasm files and nothing came up

I think a little bit of information was missing from the tutorial about that. The Windows SDK mentioned must be installed first from http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx, then you'll have ildasm. Just download the first one listed even though it says For Windows 7 - that just means that it includes Windows 7 support in addition to other releases.

bluegenjutsu
10th Jul 2009, 11:48 PM
There is a link for the .net SDK in the first post, I'm downloading from it right now. So is there some other SDK package that is needed too, TigerM? Bit confused here.

Kolipoki
11th Jul 2009, 12:01 AM
New Insight - Visual C# Studio installs the ildasms on your computer

BailaBaila99
11th Jul 2009, 12:31 AM
That it does. Takes a long time to install but it's worth it if you want to make a big mod. You can't create new dll's without it.

I don't think you need the windows SDK (I could be wrong) if you have the .net SDK. Can anybody verify this as I already have all the files on my computer? =P

Kolipoki
11th Jul 2009, 12:36 AM
I get lost at the part when trying to find it in the command prompt i dont get why we have to do that or why we used the reflector at all.

So instead of changing the directory which i cant seemed to do i put the file where the directory already was i typed this

C:\Documents and Settings\--->ildasm objects.dll /output=objects.il


and got this

'ildasm' is not recognized as an internal or external command,
operable program or batch file.



-edit nvm i had to take the ildasm file and config to the directory as well

BailaBaila99
11th Jul 2009, 12:49 AM
ildasm, ilasm, all their required files, and the files you're working with (the dll's and il's), basicly everything you do has to be in one folder.

I don't know why the DOS folder navigation isn't working for you. It's just "cd Directoryname" (with your folder's name in place of Directoryname). If my folder was in, say, My Documents / Modding / NoShooMod I would type "cd Modding" and then again "cd NoShooMod" (cause by default when my DOS window comes up in it's in My Documents already)

EDIT: Oh and you have to go through all these ridiculous steps because right now there's no way to edit those DLL's directly, without converting them to assembly IL's first. It sucks, I know. The Reflector is there so you can see what you're doing, or what you're going to do, as the il file is very hard to navigate/understand in Notepad++...

TigerM
11th Jul 2009, 01:18 AM
You can make DLLs without Visual Studios, quite easily if you know how and without downloading much. But for people not so familiar with the tools, Visual Studios is much easier.

morgade
11th Jul 2009, 03:06 AM
I posted this tool to merge core mods: http://www.modthesims.info/showthread.php?t=354202.
With this, you don't need to mess with IL to merge your mods into game assemblies, and we can have multiple core mods using a merge process.
I'm working on more documentation, but there are two sample core mods (with sources) that can help a lot !

velocitygrass
11th Jul 2009, 04:48 PM
Thank you very much for this! With the help of the tutorial and the links and notes, I've been able to succesfully test a risky woohoo mod, injecting my own function from my own .dll. (Thanks to TigerM for the tip about csc.exe and /nostdlib! It worked for me without problems.)

Btw, for your point II. F.: I did not install Visual C# 2008 Express Edition and ildasm and ilasm worked fine without it. I only installed Windows SDK.

BailaBaila99
11th Jul 2009, 06:43 PM
Wow, great to hear, velocity grass! Good luck with that, I'd love to see the mod when it's done.

GravixTerman
12th Jul 2009, 05:42 AM
I thought I would post these steps here in order to be able to use ildasm and ilasm without having to have them in the same folder as your dll/il files. This can help avoid lots of duplicates of the executables if you have multiple folders of dll/il files.


First navigate to a folder with either .exe and copy what's in the address bar.
example: C:\ProgramFiles\Microsoft SDKs\Windows\v6.0A\Bin

Click Start > Control Panel > System

Click on the Advanced tab

Towards the bottom is a button that says Environment Variables, Click it.(just above the ok button)

In the System variables list box (the second one) is a variable called PATH highlight it and hit edit.
***Do Not Delete what already is there***

Move to the very end of the value text box and type a ; (no spaces before or after) Then paste the address you copied earlier and end it with a \

Click ok then ok again

Now we are ready to test it. If you already have a command promt (DOS) window open close it and open a new one. (It will not reconize the updated PATH variable if you try using a DOS window that was already open)

Use it to navigate to a directory with dll/il files and no ildasm/ilasm and try the using the command.

**If you get a error saying "ildasm/ilasm is not a internal or external command"go back and check to make sure the path you added to the PATH variable exatly matches the location of your .exe file.

Now just repeat for the other .exe file

What this actually does is when you try to run a program through DOS first it will look in the directory you are currently in. If it can't find it then it will check all the directories in the PATH variable.


Also a useful tidbit about DOS is if you press the up arrow you can repeat commands you have already run. Useful for when you just can't get something to assemble.

BailaBaila99
14th Jul 2009, 06:39 PM
UPDATE: For more help with Core Modding check out Lemmy's new IL / DLL tutorial (http://www.modthesims.info/showthread.php?t=355295)!

Fnap
15th Jul 2009, 06:44 AM
EDIT: Oh and you have to go through all these ridiculous steps because right now there's no way to edit those DLL's directly, without converting them to assembly IL's first. It sucks, I know. The Reflector is there so you can see what you're doing, or what you're going to do, as the il file is very hard to navigate/understand in Notepad++...

Thats not exactly true. Use the (reflexil.0.9.1.bin) plugin for Reflector. It worked for me on the first try. You are supposed to be able to inject c# code in, but i haven't figured that out yet. Basically go to the code you want to change and in the bottom right corner change away, kind of like the old Simpe. When done click on the dll in Reflector and reflexil changes to a compile window with a simple button to save. Poof a patched dll.

Thanks for all the info everyone.

lemmy101
15th Jul 2009, 06:47 AM
Reflexil (0.9.1) screws up the Sims3 DLLs. You may get away with it for a few edits, but eventually you'll end up with a completely screwed DLL that will crash randomly. I used Reflexil at first but moved onto ILDASM/ASM because of this problem.

BailaBaila99
15th Jul 2009, 06:13 PM
Lemmy speaks the truth. It's a good thought, Fnap, and if we can find a way to do this, it'll be much, much easier, but right now, with the tools we have, it's just not doable. You *must* convert to IL first.

lemmy101
15th Jul 2009, 08:00 PM
To be honest after playing with ILDASM for a while, I actually find it the preferable way to work...

quetzilla
15th Jul 2009, 09:43 PM
To be honest after playing with ILDASM for a while, I actually find it the preferable way to work...

I'm sure there's an internet support group for that.

TigerM
15th Jul 2009, 09:47 PM
It actually might be possible to load mods which don't require overriding any code without touching IL or even modifying any of the game's assemblies. However I'm not sure how many mods would fit that category, or even if my idea would work at all.

quetzilla
15th Jul 2009, 10:09 PM
It actually might be possible to load mods which don't require overriding any code without touching IL or even modifying any of the game's assemblies. However I'm not sure how many mods would fit that category, or even if my idea would work at all.

Do explain...

TigerM
15th Jul 2009, 10:59 PM
Well it depends on the behavior of the CLR, and I haven't actually tested how this works thoroughly.

The game loads ALL assemblies when it runs, referenced or not. Then it tried to scan every assembly for tunable parameters, and static persisted data. It uses assembly attributes for this. (The stuff typically in AssemblyInfo.cs that looks like [assembly: ...])

Attributes are just classes that inherit from System.Attribute, and getting an attribute value instantiates the class. So there are three ways (Again, dependant on the behavior of the runtime, which I haven't tested) I can see that resulting in code being executed.

1. If attributes are instantiated the item they are attached to is first used (Similar to static constructors on classes) then for an assembly, that would probably mean when data in it was first accessed.
2. If all attributes are instantiated even when a specific type is requested, it will be done at game load time (Either loading a save, or loading a world).
3. Failing both of the above, if the request for attributes of a specific type returns all attributes derived from that type as well, simply inherit from Sims3.SimIFace.TunableAttribute, and the class will get instantiated when it searches for tunable parameters to set.

Of the three, I'd say the third is more likely the case than the other two. The only way this wouldn't work is if attributes are only instantiated right before they are specifically requested, and requests for a specific type do not return attributes derived from that type.

If any of those work, then just put the code to install yourself in the constructor and you're loaded up, and have bypassed the highlander rule. However until someone tests this and says yea or nay, it's all conjecture on my part.

ETA: This is what the code for the above (Using the third option) would look like.
using Sims3.SimIFace;
[assembly: MyModEntry]
namespace MyMod
{
public class MyModEntryAttribute : TunableAttribute
{
public MyModEntryAttribute()
{
// Do stuff...
}
}
}

jokera_us
16th Jul 2009, 05:05 PM
*edit*
so, in theory could i add my own custom vehicles if i were to try to delve into this coding abyss?

ive downloaded almost evrything in this here tutorial. since im a total noob i think i will back off from this area of the sims game.

ill try to learn the texturing and model editing first. i cant afford to bungle my computer.

:cry:

Keram
18th Jul 2009, 03:14 PM
To do so, select each, one at a time, and press "Value". In the window that pops up, you should see a line that says "ManifestModule:" and after this will be the original filename (it should have .dll at the end). When you've found the one you want to have a go at, make sure it's still selected, and click "Grid", then Import/Export, Export, and navigate to the directory we set up earlier as your workstation. Now, save it as the filename you saw earlier, when you checked the Value. For instance, if you're exporting Sims3GameplaySystems.dll, you'll want to save it as that. And don't forget the .dll!


When I click "Value" I can't see a line "ManifestModule:"
And I can't click "Grid" after click "Value"


Probably, I'll stop trying make mods and hacks...
I made only two very simple mods...

:(

Corrie
18th Jul 2009, 04:28 PM
I'm hoping that you'd be able to help me. I'm attempting to make it so certain services only come in on certain days. But at the moment, Im unable to find the right instance(?) and i was wondering if you knew if it even exists.

I was also told that i could add a variable to the XML tuning, but am unable to find any info on this anywhere.
Hopefully this wasn't too confusing for you. :lol:
Thanks in advanced.

Mootilda
18th Jul 2009, 05:26 PM
Corrie, you've already got a recent thread on this issue; please don't hijack this thread.

Corrie
18th Jul 2009, 05:31 PM
Sorry i thought that someone here might be able to help.

BailaBaila99
20th Jul 2009, 07:38 PM
Keram, not sure why you're having that problem, but yeah, you probably won't be able to click "Grid" until you've closed the dialogue box that comes up when you click "Value."

It may be that there's something wrong with your installation of S3PE, or maybe you don't have the .NET Framework, could you be a bit more specific about the problem you're having?

Keram
21st Jul 2009, 02:12 PM
http://i650.photobucket.com/albums/uu226/keram25/th_screen.png (http://s650.photobucket.com/albums/uu226/keram25/?action=view&current=screen.png) - click to increase
It's only example.
I have .NET framework 3.5
But... What I should select?
I can't see anything with .dll anywhere

I like tutorials with pictures... :P

velocitygrass
21st Jul 2009, 05:16 PM
Keram, try gameplay.package from C:\Program Files\Electronic Arts\The Sims 3\Game\Bin, not GameplayData.package, which has the xml tuning files.

Keram
22nd Jul 2009, 03:02 PM
I've just stopped making mods like that.
It's not easy.
I'm not very clever to make sth like that.

DemonOfSarila
17th Aug 2009, 07:26 PM
As an alternative for people who don't want to download Visual Studios express and are comfortable working in another editor (Like Notepad++) without all the bells and whistles, if you have the .NET framework you already have a C# command line compiler, likely in the same place you found ilasm. It is called "csc.exe". You can find usage information at http://msdn.microsoft.com/en-us/library/78f4aasd(VS.80).aspx. Similarly if you prefer working in VB or JScript you can use vbc.exe or jsc.exe from the same location.
ok, i wanna make sure i'm reading everything right: is there a way to have to code dissembled/turned into into VB or JS or C#?
sorry, i'm a little confused here. (i'm very easy to confuse when it comes to programming topics, due to my small amt of experience...)
cuz if I can actually get the game's stuff in a high-level type of code, then i at least stand a chance of being able to do something with it. (that and basically i should learn JS anyway, and that would be enough to motivate me to do so)

edit: however.... i might have just answered my own question.... it's like 2am here though, so we'll see if i still think that in the morning....

willow2u
24th Aug 2009, 03:45 PM
Hi

I hope some one might be able to assist. I have followed the tutorial step by step. After updating the systemgame.package. I start Sims 3 after some time I lose control over my sims by not having any interaction with other sims when clicking on them?? (no errors where recieved when I assembled the .il file)

Mootilda
24th Aug 2009, 07:42 PM
I have followed the tutorial step by step. After updating the systemgame.package. I start Sims 3 after some time I lose control over my sims by not having any interaction with other sims when clicking on them?? (no errors where recieved when I assembled the .il file)Did you make any code changes, or did you just create a new package with no code changes to see whether your technique is correct?

Obviously, having no errors during assembly says nothing about the number of bugs in your code.

willow2u
25th Aug 2009, 08:28 AM
I changed some values as follow:

IN: .method public hidebysig instance bool CanGetRomantic:
IL_002d: callvirt instance bool Sims3.Gameplay.Socializing.Genealogy::IsSufficientlyRelatedToRuleOutRomance(class Sims3.Gameplay.Socializing.Genealogy)
IL_0032: brfalse.s IL_0036

IL_0034: ldc.i4.0
IL_0035: ret

IL_0036: ldc.i4.s 112 //?? Changed the value to 124
IL_0038: stloc.0
IL_0039: ldsfld int32 Sims3.Gameplay.Actors.Sim::kWooHooUseLikingGate
IL_003e: stloc.1

In: .method public hidebysig instance bool IsSufficientlyRelatedToRuleOutRomance

IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: call bool Sims3.Gameplay.Socializing.Genealogy::IsBloodRelated(class Sims3.Gameplay.Socializing.Genealogy)
IL_0007: brfalse.s IL_000b

IL_0009: ldc.i4.1
IL_000a: ret

IL_000b: ldarg.0
IL_000c: ldarg.1
IL_000d: call bool Sims3.Gameplay.Socializing.Genealogy::IsStepRelated(class Sims3.Gameplay.Socializing.Genealogy)
IL_0012: brfalse.s IL_0016

IsBloodRelated => IsGreatGrandparent & IsStepRelated => IsGreatGrandchild

Hope this makes sens

TX

Chikitulfo
25th Aug 2009, 11:19 AM
Thank you so much for the tutorial!

Now I'm having some problems with s3pe.
I did everything right (or so i think): Extracted GamepplaySystems.dll -> watched with reflector, found what i was looking for -> disassembled -> modified -> reassembled -> reflector again, changes are correct -> and then s3pe to make a new package with the dll, and here comes the problem, I add a resource with same instance group and type IDs(or hex numbers, call it what you want); BUT it receives an exception and i can't open the grid to import my dll.

Error reading resource 073FAA07:00000000:03D6C8D903CE868C
Se produjo una excepción en el destino de la invocación.
No se puede leer más allá del final de la secuencia.
----
Stack trace:
en System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
en System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
en s3pi.WrapperDealer.WrapperDealer.WrapperForType(String type, Int32 APIversion, Stream s)
en S3PIDemoFE.MainForm.browserWidget1_SelectedResourceChanged(Object sender, ResourceChangedEventArgs e)
----
Stack trace:
en System.IO.BinaryReader.ReadByte()
en ScriptResource.ScriptResource.Parse(Stream s)

Translation of Spanish Parts is:

Se produjo una excepción en el destino de la invocación.
No se puede leer más allá del final de la secuencia.
->
An exception occurred on invocation's destiny/target.
Can't read further from the end of the sequence.
(More or less)

So it won't let me add my modded core :(

EDIT: Managed to do a Workaround which works: copied gameplay.package -> opened in s3pe -> remove everything but Sims3gmaeplaySystem.dll -> grid -> import my dll.

EDIT2: Another workaround: open gameplay.package, copy the resource -> new package -> paste resource -> grid and import my dll
This one is even easier because you don't have to copy yourself de instance and type numbers.

Mootilda
25th Aug 2009, 07:46 PM
I changed some valuesHere's the issue: we need to determine whether your problem is with the technique described in the tutorial, in which case this is the correct place to post, or whether your problem is incorrect programming, in which case this is not the correct place to ask for assistance.

My suggestion would be to run through the steps without making any code changes.

If you continue to have problems with no code changes, then report back here.

However if the technique works with no code changes, then the problem is with your source code changes. Help with programming is outside the scope of this thread. You'll probably want to start a new thread for help with your programming issues, although you may not have much luck getting core programming help.

If you do start a new thread, you'll need to explain to people what you're trying to accomplish, and exactly what you believe that you've changed in the code, along with the actual code change. If you decompiled to C++, you might want to include both the C++ code and the assembly code.

Using the techniques in this tutorial to extract, disassmble, decompile, change, recompile, assemble and import the DLLs is the easy part of making a core mod. Getting the code right, so that the game behaves as you want it to, is the difficult part.

Ashleigh825
26th Aug 2009, 07:59 PM
Hmm, nice. It's still a little intimidating for me, but I will definitely give it a shot.

I miss my risky woohoo and miscarriages from Inteenimator. I really want them in TS3.

Ashleigh825
27th Aug 2009, 06:07 AM
Oh, I just noticed that your link to S3PE doesn't work. I just get a 404 error message when I click the link.

EDIT: I also seem to be having trouble opening NotePad ++ (leave it to me to get stumped on the very first step... d'ur...) I can't find the notepad++.exe file anywhere.

chann
27th Aug 2009, 07:11 AM
s3pe is actually on these forums now!

http://www.modthesims.info/forumdisplay.php?f=604

Also, Notepad++ is a completely different program to Notepad. You have to download it, or you can just stick to ordinary Notepad :D

Ashleigh825
27th Aug 2009, 08:08 AM
s3pe is actually on these forums now!

http://www.modthesims.info/forumdisplay.php?f=604

Also, Notepad++ is a completely different program to Notepad. You have to download it, or you can just stick to ordinary Notepad :D

Thanks very much. I'll go download S3PE now.

I did download Notepad ++, just for some reason, I can't find how to actually install it. >.<

EDIT:

Wow... looks like someone really doesn't want me to mod this game. I get this when I try to install the .NET thingy (to get the ildasm files).

http://img354.imageshack.us/img354/7564/wtfh.jpg

I have no idea what this means.

willow2u
27th Aug 2009, 03:02 PM
My suggestion would be to run through the steps without making any code changes.

If you continue to have problems with no code changes, then report back here.



Thanks for the reminder (KISS - Keep It Simple Stupid). It is something that one usually forgets.

So it's back to reading the msil manual for me...

Learing is so Fun :)

Thanks for the tutorial :up:

Drakah
21st Nov 2009, 05:33 PM
Btw, I copied those 5 files (fusion.dll, ildasm.exe, etc.) to the windows\system32 folder, and I was able to use the command in cmd without a problem.

NekoCat
13th Dec 2009, 07:38 AM
I wasn't sure whether to post this problem here or in the S3PE forum... so here it goes. The problem is that I get an error, but I don't know if it is a Simpe problem or if the directions (which are several months old) are wrong. That is, the directions for creating a package using Simpe have changed since this tutorial was written. Any ideas?

I was able to create the dll with no problems (checked it in Reflector and value looks okay), but I can't create a package file. The problem is the following instruction:

" re-open the original gameplay.package (in a new window of S3PE, for your convenience) and find the file you exported before. Now, in the other S3PE window, your new package window (DO NOT ADD ANYTHING TO THE ORIGINAL GAMEPLAY.PACKAGE FILE! Your sims will all die horrible deaths and so will your computer.) go to Resource > Add Resource, and copy in the Type and Instance from the file in gameplay.package EXACTLY. The group should simply be "0x00000000" (that's zero x and 8 zeros). After you've added the resource, select it, and Grid > Import, choose the ILASM'ed DLL and commit, then save, put the package in your mods directory, making sure there's no other core mods present (as they will almost certainly conflict) and you're done!"

As per the directions, I loaded a second instance of S3PE, File -> New and Resource -> Add, typed the values and clicked OK. However, the following error shows up (I'm using the latest simpe -0912-10-1844 )

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.ParseNumbers.StringToInt(String s, Int32 radix, Int32 flags, Int32* currPos)
at System.Convert.ToByte(String value, Int32 fromBase)
at S3PIDemoFE.ResourceDetails.get_EpFlags()
at S3PIDemoFE.MainForm.NewResource(IResourceKey rk, MemoryStream ms, Boolean replace, Boolean compress)
at S3PIDemoFE.MainForm.resourceAdd()
at S3PIDemoFE.MainForm.menuBarWidget1_MBResource_Click(Object sender, MBClickEventArgs mn)
at S3PIDemoFE.MenuBarWidget.OnMBResource_Click(Object sender, MB mn)
at S3PIDemoFE.MenuBarWidget.tsMBR_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


--- edited to correct - was calling S3PE by the wrong name

Mootilda
13th Dec 2009, 05:03 PM
SimPE is a program for editing TS2 files. I assume that you are trying to edit TS3 files, so you need S3PE.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.ParseNumbers.StringToInt(String s, Int32 radix, Int32 flags, Int32* currPos)
Assuming that you are actually using S3PE, this is saying that a value that you are using is out of range. Check that you typed in the values correctly, especially that you included the "0x" prefix to let the program know that you are typing a hex value.

NekoCat
13th Dec 2009, 05:09 PM
I meant S3PE, actually. :( I called it simpe out of habit, I guess.

I attached a screenshot of the values I'm entering in the Resource -> Add window. Is there something I'm missing?


Edit - Workaround

I decided to try Chikitulfo's method (post 50) and it worked. I was able to add my dll and create the package. Now all I have to do is figure out why my core mod doesn't work - but that's outside the focus of this thread :D

dator97
19th Dec 2009, 03:11 AM
i have win7 x64 and net frame stuff installed but i cant find the islam stuff

babyophelia
31st Dec 2009, 05:59 AM
Hi all

I'm glad to say I was able to follow the tutorial and edit the no shoo values, all the way till the end, but my game crashes using the edited gameplay i replaced in my game/bin folder. Would someone please help by giving me a few pointers about where I might have gone wrong and point me in the right direction please?

Btw, I used "door number 1" and just imported. I only changed the part that dealt with general privacy.

Thanks first to bailabaila for making this tutorial, and lemmy for helping. Would really love to learn how to do this myself successfully. Thanks again in advance for your time and consideration!
nb: have base game. no patches. and no WA. (yet i was hoping to get it for xmas... :cry: )

Fawkes
31st Dec 2009, 05:33 PM
Can anybody point me in the right direction?
I have found ildasm.exe in the correct directory, but ildasm.exe.config is not there?
Any help is appreciated!

Fawkes
31st Dec 2009, 06:13 PM
I believe i do.. Ill double check.

babyophelia
31st Dec 2009, 06:14 PM
@ Fawkes, do you have .NET Framework 2.0 Software Development Kit (SDK) (x86) installed?

babyophelia
31st Dec 2009, 06:48 PM
@ fawkes, if you do you could try Program Files\Microsoft.NET\SDK\v2.0\Bin or just do a search for SDK

Fawkes
31st Dec 2009, 07:00 PM
I do, but the ildasm.exe.config still doesnt show up in any folders? when i search fo it, it shows up saying its there, but when i go to the indicated folder, I cant find it, and it doesn't even showing if i view all hidden files?

EDIT: I believe i found it. Thanks babyopheilia!

babyophelia
31st Dec 2009, 07:47 PM
alrighty! now if only someone could help me with my problem...

Fawkes
31st Dec 2009, 08:24 PM
I wish i could help you Opheilia, but i really am stumped after reading your signature...
I really hope you can find whats happening!

On a lighter note, thanks for this tutorial! It was absolutely great and i successfully made a facial slider mod thats compatible up to patch 1.8!

babyophelia
31st Dec 2009, 09:02 PM
bought my copy of sims 3 from ebay from a seller shipping from thailand.... makes me sad that the wait was like 3 weeks and now it is not working as smoothly as i hoped it would. the game came in the case and shrinkwrapped and looked brand new so i'm really hoping it's a legit copy and that the reason i'm having problems is because of my incompetence. (also bought WA myself after NOT getting it for christmas from the same seller...)

i'm gonna take my mind off sims 3 now and try to learn making objects for sims 2. till someone is willing to help me find a solution that is, or till WA comes in the mail and i'll try patching up my sims 3 again... whichever is first.

edit: reason i'm trying to make my own mods is because non of the ones i tried worked or they're only compatible with patched games. I've come across different resource.cfg files and the dll files you're supposed to have for framework, and i've tried different combinations of them. I don't know much about this but from what i've gleaned after hours of reading threads of other people's problems it seems that there a small code changes in these files for different patches and that i need to find the one for un-patched basegame. I did have a combo that made the "buy-all-fish" and the skill increase books work and show up in the game but now they're gone and I will have to try to fix that later. I've reading up everyone on sims 3 for about 2 weeks now. it's time for some sims 2 again. :help: :help: :help:

Fawkes
31st Dec 2009, 09:33 PM
I feel bad for you babyopheilia. The only thing that pops out at me is that it might not be a legitimate copy of the game. I wish i could be of more help :(

babyophelia
2nd Jan 2010, 11:33 PM
waiting for my game to arrive in the mail. i've learned to do some tuning mods myself now, that was really fun. but i couldn't tweak the woohoo for teens, or maybe i haven't found the string, maybe someone who did this can tell me where to look?

marlowe94
9th Jan 2010, 10:55 AM
When i try to search for
<prop name="Comment" propid="Comment" type="string" value="Muscle Blend" />
and
<prop name="Comment" propid="Comment" type="string" value="Thin/Heavy Blend" />
The button Search can't be clicked.

ertt95
22nd Mar 2010, 11:55 PM
...Wow... nice

Codester
2nd Apr 2010, 10:05 PM
After following the tutorial, I get a "FLAGRANT SYSTEM ERROR!". At first, I thought it was a typo in the change I made to the Sims3GameplaySystems.dll that is embedded in my package, but it happens with no changes at all as well. If I simply use ILDASM to generate the IL file, and then use ILASM to put it back, unmodified, into the dll, the error occurs. Do I need to do anything different if I'm on a Win 7 x64 system? I tried searching on the site, but everything seems to pertain to other mods, not how to correct my own. :P

EDIT: This seems to happen only when I'm using Awesome Mod as the base and trying to add my change to it. If I create a new package with just my change in it, it works fine.

Ashleigh825
14th Apr 2010, 07:28 PM
Hi, this is a great tutorial, but I am sadly not good with recognizing what files I need to edit. What file would I need to poke my fingers into if I wanted to add a new moodlet to the game?

taramiranda
7th Jun 2010, 08:58 PM
i have been following all these steps.. but what it wont allow me to do is copy the main files ie)Gameplay package to modify it. it says incorrect IL. I've downloaded everything and tried everything.

Any ideas?

rat1188
8th Jun 2010, 05:04 PM
every time i open any TS3 .dll (ones I've extracted to ones pulled from the cd) i get this error message in the .net Reflector



File is not a portable executable. DOS header does not contain 'MZ' signature.

anyone know how to fix.

SAS_Chester
22nd Jun 2010, 12:26 AM
I followed all the steps to the best of my ability, and I can open GameplayData.package and read everything in it, but when I open Gameplay.package I get this whenever I press Value on any one of the 3 files:


s3pi.ScriptResource, Version=1002.28.16.30193, Culture=neutral, PublicKeyToken=null
Could not load file or assembly '27332608 bytes loaded from s3pi.ScriptResource, Version=1002.28.16.30193, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at ScriptResource.ScriptResource.get_Value()
-----
Bad IL format.

-----Unknown1: 0x02
Unknown2: 0x00000009

I'm trying to create a firefighter mod for Ambitions, but I'm confused as I can't read anything in ANY of the Gameplay.package files (diff expansions) and when I exported the .dll I couldn't read in s3pe, Reflector gave the message:

File is not a portable executable. DOS header does not contain 'MZ' signature.

Any ideas?

Thanks!
SAS_Chester

Enigma86
1st Jul 2010, 12:30 AM
I followed all the steps to the best of my ability, and I can open GameplayData.package and read everything in it, but when I open Gameplay.package I get this whenever I press Value on any one of the 3 files:


s3pi.ScriptResource, Version=1002.28.16.30193, Culture=neutral, PublicKeyToken=null
Could not load file or assembly '27332608 bytes loaded from s3pi.ScriptResource, Version=1002.28.16.30193, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at ScriptResource.ScriptResource.get_Value()
-----
Bad IL format.

-----Unknown1: 0x02
Unknown2: 0x00000009

I'm trying to create a firefighter mod for Ambitions, but I'm confused as I can't read anything in ANY of the Gameplay.package files (diff expansions) and when I exported the .dll I couldn't read in s3pe, Reflector gave the message:

File is not a portable executable. DOS header does not contain 'MZ' signature.

Any ideas?

Thanks!
SAS_Chester

Ditto about the "File is not a portable executable" error message here. Is this something new with Ambitions? Are the people doing core modding right now for the big popular mods getting the same problems?

Ceixari
1st Jul 2010, 03:25 PM
Did you download the latest S3PE version (it might need to be the QA version)? I had those errors, but found I just had an older version.

Zero_Profile
8th Jul 2010, 06:27 PM
question, I think i managed to get all of the basic setup done. i can see everything on reflector and i managed to extract the .il file and use notepad++ to view it.

My question is has anyone found where the ea limit on sims per household is

I found this but I'm not to sure of what I'm doing so any help is appreciated

.method public hidebysig specialname virtual instance string get_TuningKey() cil managed
{ // Code size 6 (0x6) .maxstack 8 IL_0000: ldstr "Family_Size" IL_0005: ret }
// end of method FamilySize::get_TuningKey


after some searching i'm not sure but this might be it

public const int kMembersMax = 8;


any ideas

SAS_Chester
10th Jul 2010, 11:09 PM
Did you download the latest S3PE version (it might need to be the QA version)? I had those errors, but found I just had an older version.

Thank you. I downloaded the latest version and I can properly read the files now in both S3PE & Reflector.

Cheers,
SAS_Chester

Buzzler
11th Jul 2010, 12:53 PM
public const int kMembersMax = 8;I'm not sure what the current state is, but in the beginning that value was hardcoded everywhere and I assume it still is. Actually, you can assume that EAxis uses the kMembersMax constant, but compilers will usually omit constants and instead use their actual value everywhere, because the final app will be faster that way. You will notice that Reflector can't find any place where this constant is actually used.

You will probably have to search for the value 8 all over the place to change the restriction everywhere. Personally, I find twallan's approach of replacing the existing interactions with new interactions that ignore the limit far superior.

Zero_Profile
14th Jul 2010, 04:53 AM
I'm not sure what the current state is, but in the beginning that value was hardcoded everywhere and I assume it still is. Actually, you can assume that EAxis uses the kMembersMax constant, but compilers will usually omit constants and instead use their actual value everywhere, because the final app will be faster that way. You will notice that Reflector can't find any place where this constant is actually used.

You will probably have to search for the value 8 all over the place to change the restriction everywhere. Personally, I find twallan's approach of replacing the existing interactions with new interactions that ignore the limit far superior.

I agree, whole heartedly, however i'm still running 1.7 and i keep running into problems like not being able to become pregnant once the household has 8 people. I know there's ways around that like moving the person out then back in yet this is a tedious action especially since i'm running 6 families

JNAS2006
22nd Dec 2010, 04:55 PM
I've been studying up on core modding today, and decided I wanted to modify the teen vamps a bit.

After not being able to find anything that looked editable I instead decided to try finding "CanIgnorePrivacy" as you did and expected to find this:

http://i160.photobucket.com/albums/t165/NikkiAshley_06/ScreenShot004.jpg

Instead I found:

http://i160.photobucket.com/albums/t165/NikkiAshley_06/ScreenShot003.jpg

Am I doing something wrong?

I converted the .dll file to .il and ran a search in Notepad++ for "CanIgnorePrivacy"(without the " ")

EDIT: Nevermind, I had a dumb moment, but worked it out myself :)

BTW if I wanted to change the # of plasma fruits a vamp is given what would I look for?

And if .0 is false and .1 is true, what would things such as .2/.3/.4/etc. be for?

c228b22
6th Jan 2011, 01:30 PM
I type in ildasm Sims3GameplaySystems.dll /output=Sims3GameplaySystems.il and get the following error:

error : File 'Sims3GameplaySystems.dll' not found or not a PE file

What is causing this and how to I correct it?

Maeldor
18th Feb 2011, 12:45 PM
After following the tutorial, I get a "FLAGRANT SYSTEM ERROR!". At first, I thought it was a typo in the change I made to the Sims3GameplaySystems.dll that is embedded in my package, but it happens with no changes at all as well. If I simply use ILDASM to generate the IL file, and then use ILASM to put it back, unmodified, into the dll, the error occurs. Do I need to do anything different if I'm on a Win 7 x64 system? I tried searching on the site, but everything seems to pertain to other mods, not how to correct my own. :P

EDIT: This seems to happen only when I'm using Awesome Mod as the base and trying to add my change to it. If I create a new package with just my change in it, it works fine.I have the exact same issue. I'm wanting to tweak AwesomeMod slightly, but no matter what I do, I just get "FLAGRANT SYSTEM ERROR" when I start up. The changes I make are completely valid, and like you said, even without making changes and reassembling the exact same DLL/IL, it causes the error. Also Windows 7 x64 here. I wish I knew what was causing this...

Edit: Looks like AwesomeMod has integrity checks in place. I didn't notice at first but in the error it actually says about file conflicts. I guess these checks need to circumvented before any modifications will work. I'm currently looking at Awesome.FileVersionData.Check()... That's all I'll say for now...

Edit 2: Confirmed. Disable the Awesome.FileVersionData.Check and it works (I did it by removing the addition it its constructor, which is on the last line). My tweak to AwesomeMod is now accepted and works as intended, yay!

thelostchicken
24th Feb 2011, 11:50 PM
And if .0 is false and .1 is true, what would things such as .2/.3/.4/etc. be for?

Some more info on IL:
ldc.i4 0 translates down to:
ld = Load
c = constant
.i4 = type (in this case, a 4 byte integer)
0 is the value that is loaded.

If you are writing a function that returns something other than a boolean (true/false), then you might use .2, .3, .4, .36, or whatever the case may be, and in that case .0 would just be 0, not false, and .1 would be 1, not true.

mrcheesy
12th Aug 2011, 11:19 PM
YAY, just made a NoShoo Mod like bailabaila99's, but it works with patch 1.24, the only problem im having is that the message saying 'quit' or 'continue' appears every time i launch the game via the Launcher, saying something about it might cause crashes etc. I pressed continue and it worked fine, just want to know how to stop the error message, i will say thank you with a smiley face if you help me (please help me quickly, i don't want to play my game with my mod till that message has gone, i really want a NoShoo mod, hence why i spent an hour doing this...)

:!: PLEASE HELP :!:

EDIT: Just tryed this again and got the same result...im following the instructions down to the letter... can someone tell me why the error message keeps appearing please, or point out places that may have been done wrong that i need to correct that may cause this to happen

Sharner
17th Aug 2011, 08:41 PM
I have .NET 4.0. and can't find the exe's (ilasm.exe, ilasm.exe.config, fusion.dll ildasm.exe and ildasm.exe.config). Can anyone help me?

bethiedoll
3rd Dec 2011, 11:44 PM
hello is these step useful for updating core mod.thx

Therin
7th Mar 2012, 06:38 PM
For anyone that reads thru 4 pages of posts...

I'd like to add that it is possible to use the ildasm.exe & ilasm.exe without the hassle of navigating thru the command prompt screen.

Here is what you can do:
1) Using Windows Explorer navigate to your mod workstation (the directory where you have all the dlls, reflector, islam & ildasm) **
2) Right click in the file list pane (not on a file)
3) Choose the option New, then the option Text Document.
4) Rename the new .txt file to something.bat (where you replace something with something that makes sense and has meaning to you) -- I used abildasm.bat
5) Right click on the file and choose Edit
6) Notepad should open up. Type in the command call that you would have done in the command prompt.
For Example:
ildasm Sims3GameplayObjects.dll /output=Sims3GameplayObjects.il
7) Save the file.
8) Now all you have to do is double click on the .bat file you just created and the .dll will be disassembled

Do note if you tend to disassemble several .dlls you may enter all the commands in one file and they'll all disassemble at the same time (well one right after the other).

If you add REM in front of any command line it will be skipped.

While you could use one .bat file for both disassembling and assembling I would recommend using two .bat files (one for ildasm & one for ilasm) to help prevent any confusion.

** Alternatively you could just open Notepad and after typing in the command line code select File then Save As and choose the location where your modding workstation is located.

ZippyZX3
6th Apr 2012, 01:06 AM
On the subject What Therin said you can create a file with this in it.


@ECHO OFF
ildasm.exe %~1 /output=%~1.il


And rename it with the CMD extension. Mine is named "Dissemble_DLL_File.cmd" Then all you have to do is drag the dll onto the file and poof it disassembles it.

Tim