Thursday, May 20, 2010

Sad news (but not TOO sad)

I'm not giving up on these projects. I still have several pending ideas for it. Now that I've laid those fears to rest. :)

I've just been digging through the executable trying to find the data the game uses to manage the in-menu/out-of-battle item usage. Turns out it's all hard-coded. Not just the data, but the functions are hard-coded into the executable. D: This makes it nigh impossible to just edit to achieve a particular result such as healing only a certain percentages of HP/MP.

HOWEVER, I did find that it's possible to remove functions from items entirely! This can be done in one of two ways: Changing the item's function location to what I call "Item Use Complete" which is just a series of jumps to the end of the over-all "use item" function. Or just disabling their use in the menu via WallMarket.

Here's how menu item usage works:

When you select an item the "use item" function will search through a list to see what function that particular item has. It's just a list based off the items' index. There are 13 functions. Then one of THOSE functions are called and things happen. If the item happened to be a source then it goes through another list of functions based on the source index. Here's some pseudocode on using a Hyper:

Item Index is 0D
ItemFunction(0D) is 8
do function 8

function 8:
if character does have fury
play "incorrect" sound
else
if character has sadness
cure sadness
else
inflict fury
end if
play "item use" sound
decrease item quantity
end if

The phoenix down is kind of odd. Since the death flag doesn't carry over out of battle it checks if the character's HP are 0. The only conclusion for the game to make if that is true is that the character is dead (this is how the battle engine decides if a character is dead at the beginning). Then it heals the character by it's maxHP bit shifted right by two (1/4 MHP).

In case you're curious and want to explore more, the address of the item functions can be found at 0x7175E2.

No comments:

Post a Comment