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
#26 Old 11th Jul 2009 at 6:43 PM
Wow, great to hear, velocity grass! Good luck with that, I'd love to see the mod when it's done.
Advertisement
Test Subject
#27 Old 12th Jul 2009 at 5: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.
Lab Assistant
Original Poster
#28 Old 14th Jul 2009 at 6:39 PM
UPDATE: For more help with Core Modding check out Lemmy's new IL / DLL tutorial!
Test Subject
#29 Old 15th Jul 2009 at 6:44 AM
Quote: Originally posted by BailaBaila99
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.
Field Researcher
#30 Old 15th Jul 2009 at 6: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.
Lab Assistant
Original Poster
#31 Old 15th Jul 2009 at 6: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.
Field Researcher
#32 Old 15th Jul 2009 at 8:00 PM
To be honest after playing with ILDASM for a while, I actually find it the preferable way to work...
Lab Assistant
#33 Old 15th Jul 2009 at 9:43 PM
Quote: Originally posted by lemmy101
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.
Lab Assistant
#34 Old 15th Jul 2009 at 9: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.
Lab Assistant
#35 Old 15th Jul 2009 at 10:09 PM
Quote: Originally posted by TigerM
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...
Lab Assistant
#36 Old 15th Jul 2009 at 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.
Code:
using Sims3.SimIFace;
[assembly: MyModEntry]
namespace MyMod
{
    public class MyModEntryAttribute : TunableAttribute
    {
        public MyModEntryAttribute()
        {
            // Do stuff...
        }
    }
}
Lab Assistant
#37 Old 16th Jul 2009 at 5:05 PM Last edited by jokera_us : 16th Jul 2009 at 5:11 PM. Reason: too much d'loading for this tutorial
*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.

Test Subject
#38 Old 18th Jul 2009 at 3:14 PM
Quote:
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...

Anime Addict
#39 Old 18th Jul 2009 at 4: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.
Thanks in advanced.

My Alter Ego's
MTS | The Sim Supply | The Exchange


"I used to have Multiple Personality Disorder but we're ok now"
"Click here to find out how to keep an idiot busy for hours"
Site Helper
#40 Old 18th Jul 2009 at 5:26 PM
Corrie, you've already got a recent thread on this issue; please don't hijack this thread.
Anime Addict
#41 Old 18th Jul 2009 at 5:31 PM
Sorry i thought that someone here might be able to help.

My Alter Ego's
MTS | The Sim Supply | The Exchange


"I used to have Multiple Personality Disorder but we're ok now"
"Click here to find out how to keep an idiot busy for hours"
Lab Assistant
Original Poster
#42 Old 20th Jul 2009 at 7: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?
Test Subject
#43 Old 21st Jul 2009 at 2:12 PM
- 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
Inventor
#44 Old 21st Jul 2009 at 5: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.
Test Subject
#45 Old 22nd Jul 2009 at 3:02 PM
I've just stopped making mods like that.
It's not easy.
I'm not very clever to make sth like that.
Field Researcher
#46 Old 17th Aug 2009 at 7:26 PM Last edited by DemonOfSarila : 18th Aug 2009 at 7:25 AM.
Quote: Originally posted by TigerM
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/lib...asd(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....
Test Subject
#47 Old 24th Aug 2009 at 3: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)
Site Helper
#48 Old 24th Aug 2009 at 7:42 PM
Quote: Originally posted by willow2u
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.
Test Subject
#49 Old 25th Aug 2009 at 8: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
Test Subject
#50 Old 25th Aug 2009 at 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.

Code:
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.
Page 2 of 4
Back to top