View Full Version : Overriding in-game (non-object) text
Menaceman44
12th May 2012, 03:38 PM
Does anyone know of an easy way or easy to follow set of instructions on how to go about changing the text that appears in the little game message notification window from time to time?
I have noted spelling and grammar errors with messages relating to the consignment system and the mining tunnels which I would like to correct, seeing as EA don't seem to class fixing this sort of thing amongst their "polish to existing features" mentioned on so many patch notes.
I have attempted to look into this in the past but all I managed to do was create a package that seemingly removed ALL text from the game!
Any tools I found or was pointed in the direction of last time were outdated or too complicated for me to understand without help.
Buzzler
12th May 2012, 07:12 PM
Well, I'm not so sure about the "easy" part. EA's localization keys do follow a certain pattern. The key for the notification that appears when a sim tries to overclock a computer and breaks it in the process is "Gameplay/Objects/Electronics/Computer/Overclock:BreakComputer" for example. The FNV64 hash of that key is what you can use to find the related entry in the related STBL.
Still, there's probably no way to actually guess the localization keys. I'd say the easiest way would be to get e.g. ILSpy and open up the game libraries in it. Finding the right class shouldn't be much more difficult than your average Google search. Notifications are usually shown after certain actions, and most of the action happens in an interactions Run() method. If you look at the Overclock class that's nested in the Computer class and there in the Run() method, there's e.g. the following call:
base.Actor.ShowTNSIfSelectable(LocalizeString("BreakComputer", new object[] { base.Actor }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, base.Actor.ObjectId);
ShowTNSIfSelectable is a call to show a notification. The other is Notification.Show(). As long as you are able to point out where a notification is shown, you should be good. Inside of the method call, there's a call LocalizeString(). Explicit localization will always look like this. Sometimes there's the whole localization key already in there. In this particular case, the call only contains the last part of the key - the "BreakComputer" part - and goes to a sort of intermediary that adds the rest. Clicking on LocalizeString brings you to said intermediary. There you'll see the "Gameplay/Objects/Electronics/Computer/Overclock:" part.
If you take both together and use e.g. the Hash tool in S3PE, you can calculate the FNV64 hash and then override it with a custom STBL.
Sorry if that doesn't quite meet your standard of easy. ;) I can't think of an easier way right now. If you have an actual example, we could through it step by step if you want.
Menaceman44
13th May 2012, 01:49 PM
Oh good grief! Why can't it be as simple as it was in the days of The Sims 2?! That was always just a simple case of find the text, extract it to a new package and change what you wanted.
I have never been anywhere near an FNV64 hash before so this may be a slow and painful process for the both of us, if I can muster up the will power to continue on with it.
Either way, here is one of the pieces of text that I would like to alter:
http://i806.photobucket.com/albums/yy346/Alistu-/Sims/message.jpg
As you can see, there is an extra, unrequired "you" in that message. This message appears after using the "Buy" option on a consignment cash register (or "Buy Items" option on the Consignment Specialist Sim), switching to the Consign tab when the interface appears, selecting items to consign, and then exiting out of the consignment interface.
Buzzler
13th May 2012, 08:17 PM
Did you get ILSpy and opened the game libraries in it?
To find the point where the "stuff" happens, just click on the Search button (or F3) in ILSpy and enter the search word. What search word? Well, you're looking for something that happens in the context of the Consignment Register, right? ;)
If you found the ConsignmentRegister class, expand it and have a look at it. Methods are shown in pink and hardcoded strings are shown blue in the decompiled code. I suggest you try to find the method that shows the notification. Shouldn't be that many possibilities. It isn't the obvious one, though. ;)
Menaceman44
13th May 2012, 08:38 PM
I'm already stuck. I have no idea how I am supposed to be opening the game libraries with ILSpy.
I run ILSpy, select the Open option, navigate to the Sims 3 installation files and then have no idea what I should be looking for. Nothing seems to be what I think I should be looking for as it either can't be opened or if it can, has no editable data in it.
Buzzler
13th May 2012, 09:25 PM
Oops, sorry about that. Open the package files in Game\Bin\ with S3PE and export the S3SA resources to files. These are the core libraries you can open up in ILSpy.
Menaceman44
13th May 2012, 10:05 PM
I can't seem to make that work either.
I opened up the gamplay.package file found in The Sims 3>Game>Bin with S3PE and it contained four S3SA resources. I selected them all and chose Export to File and chose the desktop as my location. Now I have four .S3SA files on my desktop that still cannot be opened with ILSpy as it will only open .dll, .exe, and .winmd files, which these are not.
I'm honestly not trying to be difficult.
Consort
13th May 2012, 10:22 PM
Export to .dll by doing this:
Select the s3sa resource
click "grid" at the bottom
in the popup, click the down-arrow next to "Assembly"
select "export"
Or what Buzzler suggests :)
Buzzler
13th May 2012, 11:33 PM
I selected them all and chose Export to File and chose the desktop as my location.Right-click on them and select "Export DLL".
I'm honestly not trying to be difficult.Well, that's more my fault actually. I just take certain stuff for granted by now, so I fail to mention it. ;)
misukisu
14th May 2012, 06:15 AM
Hi, I'm not much help right now, but it looks I have inherited Tiger's Stubble (http://www.modthesims.info/showthread.php?t=362186&highlight=stubble). The tool itself seems to be still functional, but the string collector is broken. I'll try and see if I can get that fixed. I'm just telling this in case you are not in a hurry to fix this. It will probably take me some time to get a publishable version out.
Menaceman44
14th May 2012, 05:23 PM
How do you people understand this stuff? Most of this is going over my head.
I have got the libraries extracted and can now open them in ILSpy.
I've searched for "ConsignmentRegister" and clicked on the entry at the top of the window with the same name.
The data then decompiles below and I can click on the little + symbols to expand the code.
Then I'm lost again as I can't seem to find anyting mentioning "Show".
Buzzler
15th May 2012, 05:26 PM
Click on the pink names (methods) on the left to have the methods decompiled one by one. I think there are only a few - two actually - that sound interesting judging by their name. ;)
Menaceman44
15th May 2012, 07:37 PM
D:
I can't find any pink text anywhere though.
I see black, blue, red, teal, and brown, but no pink. Well, I see one piece of pink text that says "ref" and can't be clicked on.
I assume I've misunderstood where I should be looking.
This is what I'm seeing;
http://i806.photobucket.com/albums/yy346/Alistu-/ILSpyShot.jpg
dim4sim
15th May 2012, 09:32 PM
Try expanding the [...]s. They will contain class and method definitions. Remember, you are looking for Run() definitions, which contain the localization keys that you are looking for.
Buzzler
18th May 2012, 01:37 PM
Menaceman44, scroll the left window down some and you'll see pink text for methods. Methods contain the actual behavior.
Menaceman44
18th May 2012, 03:56 PM
Do you mean I will see text with pink blocks to the left of it? I still see no actual pink coloured text.
I can see 13 entries that start with ShowTNS that have pink blocks next to them.
This is going so far over my head it's unreal.
Buzzler
18th May 2012, 04:24 PM
Yeah, I'm doing a terrible job at explaining this. ICONS! I meant to write PINK ICONS! :faceslap:
Ok, a picture that says more than thousand words. I hope. ;)
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.