IN-GAME SCRIPTS
Modifying New 'n' Tasty in-game functions/scripts (i.e. "how the game world reacts to your actions") is possible with .NET Reflector decompiler + Reflexil Add-In tool (Windows only).
1) Install .NET Reflector
2) Extract and put Reflexil main directory to .NET Reflector's Addins directory, eg.
C:\Program Files (x86)\Red Gate\.NET Reflector\Desktop 8.5\Addins
3) Make a backup copy of your
NNT_Data\Managed directory (with all dll contents included, of course)
4) Open .NET Reflector. Go to Tools -> Add-Ins... and add
Reflexil.Reflector.dll to the list.
5)To open a dll file, go to File -> Open Assembly
Basically you want open dll libraries located in your
NNT_Data\Managed folder.
6) Have fun! Make yourself familiar with Reflexil tool, it shouldn't be too hard to learn it.
7) To reassemble your modified dll file, simply right-click the parent of your dll assembly file name -> Reflexil v1.9 -> Inject assembly reference -> Save as... -> Replace the original dll file and check out the in-game changes.
I say this only once: Incorrect modifications may cause the game to act in weird ways.
Always, always take backups!. You've been warned so do not blame me if you need to re-install your game because you just broke your game. Thank you.
-------------------------------------------------------
What are these dll files? What do they contain?
Assembly-CSharp.dll library file contains all compiled in-game scripts written in
C# programming language.
Assembly-CSharp-firstpass.dll contains all compiled scripts which are compiled during the first-pass in Unity (C# language).
For more information, use Google.
Scripts are output to either Assembly-CSharp-firstpass, Assembly-UnityScript-firstpass, or Assembly-Boo-firstpass, depending on the language. (
Unity 3D Wiki)
-------------------------------------------------------
About animation functions
For every animation function, there are three stages: Enter, Execute and Exit. These are for...
Enter = Actions while starting animation sequence
Execute = Actions while executing the animation
Exit = Actions while exiting the animation sequence
-------------------------------------------------------
How to find a feature?
1) An example regarding to slaves' chattering feature. How did I disable it?
I had done some background work so I knew what I was looking for: a string called "workidle". At that time, I had already searched for that string inside every binary file in NNT_Data. No match, not even a single one. Still I knew there *must* be a match somewhere. How did I know it? How did I know particularly to look for "workidle" string?
Because
a) soundbank xml files had many variable references to that string
b) sound files referred under that "workidle" variable and played with RavioliGametools matched 100% with the in-game sounds for Mudokon slaves while they were washing floors
After all, finding "workidle" string was bit tricky. None of the binary files didn't match and that's why I ended up focusing on dll files inside NNT_Data\Managed\ folder. I found many references for "Mudokon" in Assembly-CSharp.dll file with several Linux command line tools which drew my attention.
If you look inside Assembly-CSharp.dll file with a hex editor or with any editor that is capable to look for human-readable strings, you can't find a single reference to "workidle" string. It's highly probable that the dll file is encrypted or compressed somehow. However, with proper tools, you can easily open, modify and reassemble it.
So, eventually, I found an efficient way to look inside Assembly-CSharp.dll file with Red Gate .NET Reclector decompiler. Soon after that I finally found a string match: CleanFloorExecute() function in MudokonSlave class had a string "Play_vox_mudslave_workidle". It was not just a match but perfect one, too! All I had to do was to rename the string from "Play_vox_mudslave_workidle" -> "", reassemble Assembly-CSharp.dll file and put it back into the game. Vola! Silent slaves!
2) How to make Abe die instantly from high falls?
a) Open Assembly-CSharp.dll with Red Gate .NET Reclector decompiler + Reflexil
b) Go to Abe -> LandDamageExecute () : Void
c) Make the LandDamageExecute function to look like this:
d) Reassemble Assembly-CSharp.dll file
-------------------------------------------------------
Interesting findings
1) Your mudokon savior status is determined by the following percentages:
0% = Traitor
1% - 24% = Flunky
25% - 49% = Slacker
50% - 75% = Shepherd
75 - 99% = Savior
100% = Messiah
You can change these percentage values to whichever you want.
The values can be found from
MudokonList -> GetRescueStatusForPercentage(Int32) : RescueStatus
2) There are several level stuff, classified as "Not Used":
LevelList -> ScriptedEventLevels ->
NotUsed_Paramonia_Background
NotUsed_Paramonia_p1_2
NotUsed_Paramonia_p2_3
NotUsed_Paramonia_p3_4
NotUsed_Zulag4_p5
What were these supposed to be used for? Dunno. Maybe some transitions between scenes.
-------------------------------------------------------
OPENING UNITY ASSETS
I still don't know an efficient way to
modify Unity Assets (eg. modifying in-game textures or models). Anyway, you can explore them with editors such as:
The output of these different Unity editors varies. Disunity is best for the models and fonts. Disunity extracts models in obj format which can be opened on 3ds Max. UVW Maps included.
Asset Editor is handy to preview texture files (though laggy).
With Assets Explorer you can extract assets such as .mat (Unity material file) and .ani (mesh animation) files better than with Asset Editor.
For some reason, extracted textures look drastically darker than if just previewed in Unity Asset Editor. The reason is unclear to me.
Several New 'n' Tasty assets and files they include:
- resources.assets: all language files, lots of Unity shaders, dds/tga textures
- sharedassets0.assets: movies, fonts, Unity shaders, dds/tga textures (gamepad, mudokon head...)
- sharedassets2.assets: 3D mesh files for in-game menus, dds/tga textures for menu meshes more shaders, movie preview images
- sharedassets3.assets: Abe, Slig, Elum, Slave etc. meshes and textures
etc. etc...
Btw. FYI. You can't modify .mat files easily because they are relatively linked with meshes inside assets. I've managed to remove texture and illumination effect from Abe's eyes but nothing else so far.