Friday, May 28, 2010

Another random update

Since I'm leaving town for the weekend I won't be able to touch any of these. Let me tell you how things are going now.

These are looking good. I made an enemy copy/paste option at the request of Armorvil. I THINK it's working correctly. The only thing it doesn't do is add that enemy to the formations. That's a dangerous thing to do anyway so I may not do it even though I was considering replacing them with the enemies you copy over (but imagine copying Diamond Weapon and pasting it over Grangalan Jr.Jr. INCLUDING it's formations! )% ). That wouldn't work because of Grangalan (& Jr.)'s AI. They are the ones that call out the invisible, untargetable Jr Jrs at a certain point. Also for this reason it's dangerous to just blank out enemy formations. This kind of stuff is also just as dangerous with the Chocobos. Trying to copy them or replace them is dangerous. Well, copying them isn't that bad, you'd just need to change the AI dramatically. :)
Another note is that I found a simple one-line function to replace a two line function I've been using since Sept '08 when I started using this. Go figure, right? ;) I'm constantly reminded how little I really know about what I'm doing. :D

Tiny Bronco:
If you remember me mentioning this you deserve a cookie. I've been tinkering with this prog for a while, but I don't want to say too much about it since I'm not sure it's going anywhere. However, I've recently decided to look at it again. It's a mess. I haven't done anything with it in so long I've forgotten how it all works. It looks sloppy too.

I was playing around with the Item properties trying to see how some of them work when lo and behold, I found the Enemy AI data in the memory! The game does something really strange with it. It seems to write to it, make a pointer to it, then ignore it. I didn't find where that pointer went so it's a little worthless at the moment. Still, it's a step in the right direction of figuring out what the ASM does with different values. I believe Akari already knows where this is handled, but it's exciting to have found this by myself too. :)

So I was playing around with a TIM viewer of my own design when sl1982 (Head of Team Avalanche) requests a TEX dumper. Because of the work I've done on Tiny Bronco I suggested that I could throw one together real quick combining the two. So I did. :) He's happy with the result and I'm now apparently the Head Programmer of Team Avalanche. :D So far that's all I've contributed. That's apparently enough at the moment, but I'm sort of on retainer for any other extracting app they might need. Those won't likely be released because they're real specific need things. Oh well.

Can't think of anything else right now. Have a good weekend! Happy Memorial Day to those whom it applies!

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
if character has sadness
cure sadness
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.