• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 28, 2024, 04:53:53 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Trying to figure out an asm formula

Started by RavenCurow, April 14, 2018, 08:20:39 am

RavenCurow

April 14, 2018, 08:20:39 am Last Edit: April 14, 2018, 08:54:32 am by RavenCurow
So I'm trying to figure out this asm formula to get the status on the formula and I can't seem to figure the math. So I set x to 27 and that gives me the status block that looks like this

   0x80 -
   0x40 - Crystal
   0x20 - Dead
   0x10 - Undead
   0x08 - Charging
   0x04 - Jump
   0x02 - Defending
   0x01 - Performing

Now the status that gets added is the Y value and so you plug that number in. Where it gets complicated is that Y will add multiple statuses to the formula because it adds the statuses together. For example if I put in 1 I'll get performing. 2 will get defending. But 3 will get both defending and performing. Now I want to just have Undead, but putting in 10 will of course get me defending and charging. So I'm not exactly sure what number to use to get what I need.

Edit: After much trial and error I came upon the correct number which is 16. I'm still not quite sure why that number is correct. The only reason I made a guess at it is because all of the statuses before it combine to 15 so I tried 16 which I figured was just as likely to get me Undead, jump, and defending.
  • Modding version: PSX
Ramza: Delita, your hurt?
Delita: No, really? Did you think I was taking a nap down here?

Glain

The 0x prefix designates a hexadecimal (base 16) number.  Place value is based on 16, not 10.  0x10 = 16 * 1 + 0 = 16.
Each number is double the previous, and represents a different bit inside the status byte.
  • Modding version: Other/Unknown

RavenCurow

Oh okay. I was thinking 0x10 was A lol. Shows how much I've picked up. Thanks for explaining that.
  • Modding version: PSX
Ramza: Delita, your hurt?
Delita: No, really? Did you think I was taking a nap down here?