Jump to content

Recommended Posts

  • Replies 112
  • Created
  • Last Reply

Top Posters In This Topic

Posted

The IV's are a little tricky.

So the IV block is 32 bits. Let that be an integer. Read that like this:

BitConverter.ToUInt32(binary, offset)

An IV is 5 bits. You grabbed 32 bits. Now to remove the rest.

HP is the easiest to get. In the below, suppose all IVs are 31 except HP. Converting the IV block integer to binary results in this:

11111111111111111111111111100000

You don't necessarily know what the data where the 1's are when finding HP. But you don't need to. You just need to set all of those bits to 0.

Dim HP as Byte = (IVBlock Or &HFFFFFFE0) - &HFFFFFFE0

The above will set all those irrelevant bits to 1 then subtract that number. Something like this:

     11111111111111111111111111101010
   -11111111111111111111111111100000
   ---------------------------------
                               01010 - the value you wanted

And there you go. The HP.

Now for the Attack. A little harder.

In this case, if the attack was all 0, it would be:

11111111111111111111110000011111

How do we solve that? A Bit Shift!

Basically, before you do the Or-ing like above, use: (IVBlock >> 5) Or &H111.. whatever.

The >> is a right shift. It moves all the bits to the right, 5 times. So, it makes 11111111111111111111110000011111 become 11111111111111111111111111100000.

I'm sure you want more than the explanation I gave above, but I wanted you to know what I was doing before I posted some code I conveniently already wrote.

  Reveal hidden contents
Posted

please tell me what im doing wrong

  Reveal hidden contents

also made a few modifications

  Reveal hidden contents
Posted (edited)

Finished function ARGenerator, will post code later.

Here it is:

  Reveal hidden contents

Uploaded current screenshots

Edited by wraith89
Merged posts; please learn to use the Edit Button
Posted

I think you need tomake ARGenerator a function that returns the new line.

Also, you should look into String.PadLeft. You might not have to use it here, but the more you know, the more you know. (Yes, I'm quoting BrainPop's motto.)

Posted
  evandixon said:
Don't forget to set pkm equal to something. You cannot set item x of an array equal to something if the array is null.

Try this:

Dim pkm(900 - 1) As G5_PC_PKM

What this does is make pkm an array with 900 items. (The -1 is because the number in the parentheses specifies the last index of the array, not the number of items.)

...
Posted (edited)

tried out my save reader for the box slots, I got this for the nickname

  Reveal hidden contents

please tell me what I'm doing wrong

It does this for every blank slot

Edited by LEGOanimal22

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...