Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Fixed Offsets for the new Game Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkIrata committed Nov 22, 2016
1 parent 6fe6153 commit ddf27ab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions TerrariaUSaveEditor/Helper/OffsetHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public static class OffsetHelper
public static int NameLengthInformation => 0x02;
public static int Name => 0x03;
public static int Difficutly => OffsetDiff + 0x00;
public static int Gender => OffsetDiff + 0x02;
public static int Gender => OffsetDiff + 0x04;

// Color Offsets
public static int HairColor => OffsetDiff + 0x0B;
public static int HairColor => OffsetDiff + 0x0D;
public static int BodyColor => HairColor + 0x03;
public static int EyeColor => BodyColor + 0x03;
public static int ShirtColor => EyeColor + 0x03;
Expand All @@ -32,13 +32,13 @@ public static class OffsetHelper

// Equip Offsets
/*
* Equip get saved right after Colors. 1 Accessory take 3 Bytes "ID ID ?PREFIX?"
* Equip get saved right after Colors. 1 Accessory take 3 Bytes "ID ID PREFIX"
* Again 2 Bytes as "00 00" if the slot is empty.
* Based on this informations for accessory's, equipable items like armor should behave the same.
* */

// Inventory Offsets
public static int Inventory => OffsetDiff + 0x03D;
public static int Inventory => OffsetDiff + 0x53;

public static int CalcOffsetDiffInventory(List<InventoryData> invData)
{
Expand Down
7 changes: 4 additions & 3 deletions TerrariaUSaveEditor/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions TerrariaUSaveEditor/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public partial class MainForm : Form
public MainForm()
{
this.InitializeComponent();

this.Text += $" v{Application.ProductVersion}";

this.InitializeInventoryTab();
this.Editor.ChangesSavedEvent += Editor_ChangesSavedEvent;

Expand Down
4 changes: 2 additions & 2 deletions TerrariaUSaveEditor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.2.0")]
[assembly: AssemblyFileVersion("0.6.2.0")]
[assembly: AssemblyVersion("0.6.3.0")]
[assembly: AssemblyFileVersion("0.6.3.0")]

22 comments on commit ddf27ab

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the hell did the game update!? Why the hell did they have to change offsets too damn it? Oh well... Just a minor setback I guess... Btw, I will also start assisting with development if you don't mind

@bendevnull
Copy link
Contributor

@bendevnull bendevnull commented on ddf27ab Nov 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Und, bist du Deutscher? Ich spreche ein wenig.

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont now. Some people reported problems. Looked into it, and that's what it found.
I'm appreciating every help i get, since i dont have much time working on this project.

And yes, i'm from germany.

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm going to assume that I don't have to start finding new offsets then. Sweet! I am trying to get the offsets for armor and equippables now and I will make a pull request with a file that contains the offsets. I'm not that good with C#... I've been learning with your code

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, we all have to start somewhere. :)
The accessory offsets should be around the first block after the colors.

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the armor is right near the first quick slot because I've edited armor before. I will get my dump/inject workspace ready and start testing

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I've also seen the first slot of accessories too

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also have one more thing to say. Be VERY careful when editing the header of the file. You can crash your Wii U if you edit the wrong thing

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already have the Header informations. 1 Byte looks like is the save version number.

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the offset for a 1 character name for the save version number?

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x01 => (MAYBE) Save Version
0x02 => Name Length
0x03 => Name start

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x01 is 15 for a 1 character name. Is this what you have for that offset?

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. 0x02 is name.
0x01 is 15 for all chars from the new version. Last version was 13

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have 01 at 0x02 though. That can't be right

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy me your bytes from 00 to 0F

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

00150131000100000100640064000000
The character's name is 1 btw. I was testing with name lengths

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's correct. 31 => Char for 1 and 01 at 0x02 is the length of the char name. 1 char

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to ascii, the start of the name is at 0x03
I will also copy over the first line of my other test characters to show you that 0x02 was correct when you first had it

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name: 12
Hex 00 - 0F: 00150231320028000001006400640000

Name: 123
Hex 00 - 0F: 00150331323300040000010064006400

Name: 1234
Hex 00 - 0F: 00150431323334002C00000000640064

Name: 12345
Hex 00 - 0F: 00150531323334350014000001006400

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bendevnull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So 0x02 is name length and 0x03 is the start of the name depending on it's length. Well, that sure as hell helps when dealing with the inventory and trying not to crash the Wii U LOL

@DarkIrata
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. That's why it's a hell of a fun to work with the offsets for this game... and why i dont use hardcoded offsets except for the name length and name start offset.

Please sign in to comment.