Miscellaneous Forums > Gameplay

[WIP] Custom Game Settings (FF7)

<< < (2/30) > >>

Wutai Clan:
Well, that function definitely get's called, but only after the healing occurs, so it's not the right function. (It does have the proper item. Probably related to item removal..)

I was able to make my custom edit to potion values using it, but, it works like this.

Heal function called
Item used function called
Set global value (For tracking item use, ie, storing 512)

So it didn't work on the first run..

However, on the second run, since I had successfully set my tracking variable the first run, it did work.

So I'm close, if I can just find the right item used function. (I still need to write a parser to read the .ini file too, then I should be able to release with a few values exposed.)

nfitc1:

--- Quote from: Wutai Clan on 2011-04-14 08:26:03 ---Right now, I need to find the "Item Used" function, if it even exist, I'm guessing there is a function that get's called when an item is used, I need to get the values from it that represent what item was used.

...

A function that returns character data, HP, MP, STR, etc,. (ie, I can feed it an NPC, and get data about that NPC.)

A function that increases\decreases item counts. (Inventory, etc,.)

A function to get the NPC occupying a slot. (ie, Slot1 = Cloud)

.... More to come.

--- End quote ---

I know where most of those are, but of course I've put my laptop away and I don't have time to fish it back out. Maybe tonight I'll update. I know exactly where the menu-based item handler is and how it works. I can find the item increase/decrease function too, but I haven't looked for the "NPC to battle slotX" function is.

EDIT:
Item Menu Usage handler begins at 0x715105. It's a long function too, running through 0x717599. It's really each item's function all squished together.

return character data is at 0x6CB98E. Give it a byte (formation index) and get the pointer to that position's stats. That will only return an active character (in the party), but that's probably all you'd need anyway. The game mostly ignores the characters NOT in the party.

Decrease Item count function is 0x6CBE5F. Pass it the item index ORd with ( quantity to remove << 9 ) like an item inventory data. XXXXXXXY:YYYYYYYY where XXXXXXX is the item quantity and YYYYYYYYY is the item index.
Increase Item is different because decrease is unsigned. It's at 0x6CBFFA and can either increase an existing item's quantity or put it in the first blank space it comes to. Input format is identical to Decrease Item.

Get Character occupying a slot is not a function. Each sub that wants to know that info manually derives what that is if necessary. It's always 0xDBA498 + 440h * Slot.


As for that healing function you've been messing with, that's almost exclusively used out of battle. It's more for item menu usage and magic menu use (which starts at 0x710DFA and ends at 0x71441B). Only a few others use it. Handle_Cats_Bell (0x6CC4A8), some full_heal function (0x61F6B0) that restores HP, MP and FurySadness flag I don't know what calls it (inn maybe?), a heal HP/MP function (0x61F793) that increments some counter (not sure what), and a similar one to that (0x61F977) that increases the same counter by 5.

Wutai Clan:
@NFITC1, awesome, I appreciate it, it will greatly help this project. :)

(Aali helped me a bit with the .ini file end of things, so I will start working on that tonight, just crawled out of bed. We should be able to get a working demo up in no time.)

--

Edit:

@NFITC1, I need to get a global function hooked, ie, a function that always get's called by the game(every frame). I need this for things like mp regen. (I also need a way to tell if I'm in game, in menu, or still on the start menu, in order to control when my custom code should run.)

So if you know anything on this front, that would be great, I can probably find the global function, there are generally lot's of things being called by the game every frame. But I definitely need to know if I'm still on the start menu, running party based code for regen, with no party, is bad.

nfitc1:
Just edited my above post. Check it out.

Wutai Clan:

--- Quote from: NFITC1 on 2011-04-15 01:34:25 ---Just edited my above post. Check it out.

--- End quote ---

Excellent, thanks for that. :)

On the subject of the generic healing function, yeah, I mainly need it for making dynamic changes to values(potion = 250), I thought that it worked on spells, because when I was testing, Healing Wind triggered it, but that makes sense with what you've told me.

Will character stats returned by 0x6CB98E include the character name(is this an array, or are the values separate variables?), I want to use that for debugging, rather than returning Slot1\Slot2, just return the name of the character. (Though it will probably get used for more as the project matures.)

Anyways, thanks for all this, most helpful. :)

----

That item use function you listed 0x00715105, any idea what the input arg is?

Here is a sample of the log I get when hooking it.


--- Code: ---ItemUse: Executing
ItemUse: 72
ItemUse: Executing
ItemUse: 73
ItemUse: Executing
ItemUse: 74
ItemUse: Executing
ItemUse: 75
ItemUse: Executing
ItemUse: 76
ItemUse: Executing
ItemUse: 77
ItemUse: Executing
ItemUse: 78
ItemUse: Executing
ItemUse: 79
ItemUse: Executing
ItemUse: 80
ItemUse: Executing
ItemUse: 81
ItemUse: Executing
ItemUse: 82
ItemUse: Executing
ItemUse: 83

--- End code ---

This went on for quite some time, all the way up to around 400+, I don't think I can use that one for my purpose, it seems to be called constantly, and keeps incrementing some counter. (Though this may work for my global function hook, depends on where it gets called in the game loop.)

Is there another function that only get's called once when you use an item, and has an input arg that equates to the item? That's what I really need, so I can track item usage. (It needs to be called before GenericHeal too, so RemoveItems won't work, unless I damage the HP to make up the difference, but that's really hacky.)

The function will probably be in the same range as the decrease\increase item functions. (Or around that area.)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version