Terraria 1.2.0.1 Source Code

Posts 16–30 of 32 · Page 2 of 3
I ran into a small setback. I need to get 25 posts to be able to post the virus scans, or else it won't be approved
Hope you get there soon, I'd love to mess with the source and create a few things.
The thread was deleted by an Administrator, I'll be looking into the rules and trying to get it out there without breaking any.
How about a walkthrough on fixing the decompile?

I am able to decompile with dotPeek (use x86; the x64 version always crashes) and I see all the errors you described (the extraneous (string) references, bracket errors, improper casts, etc.) but like OblivionGun my compiled solution crashes.
So, thanks to Infinest, I have a version of 1.2.0.2's source code that almost works 100%. There are some flaws though...

imgur/BtJxLdG,gqK8piN,mYyyHGt

Image 1: the actual items in your inventory aren't either read from your character file, or aren't displayed at all. Your armor and vanity slots are also missing.

Image 2: Your hot bar also is void of items, and you dont have a health or mana bar, nor can you hover over things like npcs or enemys to see their name

Image 3: Health is still counted though, and you can die from being attacked. Also health bars work.
I have the source all compiled and ready to go, I just need to contact an admin and see the lines on warez, so that I can re-post it.
Maybe you should delete all the graphics sound, and exe files?
Recompile Terraria 1.2
You will need to use JetBrains dotPeek 1.1 to decompile Item class. To decompile everything else I used ILSpy.

During compiling fix the errors as follows:

Operator '??' cannot be applied to operands of type 'int' and 'int'
Example:
Change:
Code:
int num61 = num56 ?? -1;
To:
Code:
int num61 = (num56 != null) ? num56 : -1;
Only assignment, call, increment, decrement, and new object expressions can be used as a statement
Comment out the line that the error is on:
Code:
// this.velocity != value2;
Cannot implicitly convert type 'int' to 'short'. An explicit conversion exists (are you missing a cast?)
Example:
Change:
Code:
Main.tile[num3 + 1, num].frameX = num2 + 18;
To:
Code:
Main.tile[num3 + 1, num].frameX = (short)(num2 + 18);
Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?)
Example:
Change:
Code:
color.R = Main.mouseTextColor / 2;
To:
Code:
color.R = (byte)(Main.mouseTextColor / 2);
For error with Steam:
In Program.cs comment out the following lines as shown (make sure you don't comment out main.Run();:
Code:
//Steam.Init();
 //if (Steam.SteamInit)
 //{
     main.Run();
 //}
 //else
 //{
 //    MessageBox.Show("Please launch the game from your Steam client.", "Error");
 //}
In Mian.cs comment out Steam.Kill(); in the QuitGame function:
Code:
protected void QuitGame()
 {
     //Steam.Kill();
     base.Exit();
 }
Last thing is do not forget to copy the files in the Content folder from the game into the Content folder where the project files reside in <location of your project folder>bin/x86/debug folder. (You may need to first compile the program in order for the folder to be created first before you locate it.
Quote Originally Posted by pepsi_cola View Post
-snip-
Oh, my god. I love you so much, for the fact that this worked. Have my babies.

Quote Originally Posted by Northern_Lights View Post
ILSpy keeps crashing. All I've gotten so far:
ChatLine.cs
keyBoardInput.cs
Lighting.cs
Recipe.cs
Lang.cs

Items.cs, NPC.cs, Main.cs and Projectile.cs are also in the folder, however, their file sizes are all 0 KB, so I'm assuming that it's one of these files that is causing the problem.. Anybody else having this problem, and if so, any advice?

Not entirely sure if this is the right place to ask, however, this is the only thread I've seen about decompiling 1.2.0.1/1.2.0.2, and I didn't feel it appropriate to make a new thread.
Well, what I did was the following:

'Decompile' with both ILSpy and dotPeek, but only saved dotPeek as a project.
Then, I saved over all the files that needed to be replaced, in ILSpy.
Quote Originally Posted by pepsi_cola View Post
During compiling fix the errors as follows:

Operator '??' cannot be applied to operands of type 'int' and 'int'
Example:
Change:
Code:
int num61 = num56 ?? -1;
To:
Code:
int num61 = (num56 != null) ? num56 : -1;
This is not correct, an int can never be null therefore it will always be true... I believe it should be:

Code:
int num61 = (num56 != 0) ? num56 : -1;
This is what's causing the settings bug where you can increase volume/parralax but not decrease it.
Quote Originally Posted by leleweh View Post
This is not correct, an int can never be null therefore it will always be true... I believe it should be:

Code:
int num61 = (num56 != 0) ? num56 : -1;
This is what's causing the settings bug where you can increase volume/parralax but not decrease it.

What line & what file is that code located at, I accidently deleted it, not knowing how to resolve it. I want to see if you're correct about that increase/decrease bug, because in my source, you can decrease, but not increase.
ILSpy keeps crashing. All I've gotten so far:
ChatLine.cs
keyBoardInput.cs
Lighting.cs
Recipe.cs
Lang.cs

Items.cs, NPC.cs, Main.cs and Projectile.cs are also in the folder, however, their file sizes are all 0 KB, so I'm assuming that it's one of these files that is causing the problem.. Anybody else having this problem, and if so, any advice?

Not entirely sure if this is the right place to ask, however, this is the only thread I've seen about decompiling 1.2.0.1/1.2.0.2, and I didn't feel it appropriate to make a new thread.
The reason that "ilspy" and some other .Net Decompiler crash are the function "SetDefaults(int,bool)" in the item.cs.
I dont get it why JetBrains Dotpeek work..
mhmm atleast it work~

Sorry for my bad english!
oh and hi im new.
Any new hacked clients out ? XD
Posts 16–30 of 32 · Page 2 of 3

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us