Author Topic: [FFVII] Is it possible to alter actor AP worth from a battle script?  (Read 5029 times)

Husbjörn

  • *
  • Posts: 36
    • View Profile
I noticed that the experience and gil rewards for defeating an enemy can be altered by changing its 0x42e0 and 0x42c0 values.
this page similarly suggests that tha AP value resides at offset 0x42b0.
It however turned out that changing this value has no discernible effect at all. I first thought that it might be that something else has the final say in what the AP value will be, but upon checking the value stored at Actor<word>[0x42b0] with the following simple counter script, it appears that this isn't even set to the actor's AP value as set in scene.bin at all:


0000| 02    2060        # Push self mask value
0003| 02    42B0        # Push AP reward offset value
0006| 80                # Resolve AP reward value of self and push it onto the top of the stack (as a 16-bit word)
0007| 61    03E8        # Push constant 16-bit word value (1000; corresponds to actor AP value set in scene.bin)
000A| 40                # Push true if the top values of the stack (popped) are equal, or false otherwise
000B| 70    0015        # Jump to offset if the values were not equal
000E| 93    "Equal\0"
0015| 93    "Not equal\0"
0026| 73


Memory scanning further reveals that the actual location of the AP value once loaded into RAM is always 15 bytes prior to the gil value, which is 4 bytes wide and followed immediately by the EXP value, occupying another 4 bytes. It is off course possible that the actual memory used by the process does not reflect the actor-data offsets used by the 0x80 instruction and no, altering the value at Actor<word>[0x4248] does not change the AP value either.


Is the memory offset suggested by the above wiki link incorrect or is something else at play here? Any thoughts or theories?

Edit: and what the heck, when previewing this post I notice that it automatically shows "off course" as "off course" even though it doesn't say that in the textarea I submitted? Some easter egg trolling?  ::)
Edit 2: apparently it happens in the final post as well; just to be clear "of course" is spelled with an "of" not an "off", unless you want the whole meaning changed... x)

Sega Chief

  • *
  • Posts: 4087
  • These guys is sick
    • View Profile
So THAT'S what's going on. I thought it was odd that everyone was suddenly saying 'off course' all of a sudden, but I figured it was just some trend that had caught on 'cause of that Battle Square typo. Should it be changed, though? No, way!





Covarr

  • Covarr-Let
  • Administrator
  • *
  • Posts: 3941
  • Just Covarr. No "n".
    • View Profile
So THAT'S what's going on. I thought it was odd that everyone was suddenly saying 'off course' all of a sudden, but I figured it was just some trend that had caught on 'cause of that Battle Square typo. Should it be changed, though? No, way!
Nah, I added it to the board's word filter.

Husbjörn

  • *
  • Posts: 36
    • View Profile
Haha, I see. I wasn't aware of such a typo in the battle square, might have to go re-explore now.

As for the actual topic in question it unfortunately doesn't seem like the AP value can be changed from a script; I used the following to brute force change most any non-animation related actor value and still it stays the same:
Code: [Select]
12 2060
11 4048
80
60 01
90
12 2060
11 4050
80
60 01
90
12 2060
11 4058
80
60 01
90
12 2060
11 4068
80
60 01
90
12 2060
11 4070
80
60 01
90
12 2060
11 4078
80
60 01
90
12 2060
11 4090
80
60 01
90
12 2060
11 4098
80
60 01
90
12 2060
11 40A0
80
60 01
90
12 2060
11 40A8
80
60 01
90
12 2060
11 40B0
80
60 01
90
12 2060
11 40B8
80
60 01
90
12 2060
11 40C0
80
60 01
90
12 2060
11 40C8
80
60 01
90
12 2060
11 40D0
80
60 01
90
12 2060
11 40D8
80
60 01
90
12 2060
11 40E0
80
60 01
90
12 2060
11 40E8
80
60 01
90
12 2060
11 40F0
80
60 01
90
12 2060
11 40F8
80
60 01
90
12 2060
11 4100
80
60 01
90
12 2060
11 4108
80
60 01
90
12 2060
11 4110
80
60 01
90
12 2060
11 4118
80
60 01
90
12 2060
11 4120
80
60 01
90
12 2060
11 4128
80
60 01
90
12 2060
11 4130
80
60 01
90
12 2060
11 4138
80
60 01
90
12 2060
11 4140
80
60 01
90
12 2060
11 4148
80
60 01
90
12 2060
11 4150
80
60 01
90
12 2060
11 4158
80
60 01
90
12 2060
11 4160
80
60 01
90
12 2060
11 4168
80
60 01
90
12 2060
11 4170
80
60 01
90
12 2060
11 4178
80
60 01
90
12 2060
11 4180
80
60 01
90
12 2060
11 4188
80
60 01
90
12 2060
11 4190
80
60 01
90
12 2060
11 4198
80
60 01
90
12 2060
11 41A0
80
60 01
90
12 2060
11 41A8
80
60 01
90
12 2060
11 41B0
80
60 01
90
12 2060
11 41B8
80
60 01
90
12 2060
11 41C0
80
60 01
90
12 2060
11 41C8
80
60 01
90
12 2060
11 41D0
80
60 01
90
12 2060
11 41D8
80
60 01
90
12 2060
11 41E0
80
60 01
90
12 2060
11 41E8
80
60 01
90
12 2060
11 41F0
80
60 01
90
12 2060
11 41F8
80
60 01
90
12 2060
11 4200
80
60 01
90
12 2060
11 4208
80
60 01
90
12 2060
11 4210
80
60 01
90
12 2060
11 4218
80
60 01
90
12 2060
11 4220
80
60 01
90
12 2060
11 4228
80
60 01
90
12 2060
11 4230
80
60 01
90
12 2060
11 4238
80
60 01
90
12 2060
11 4240
80
60 01
90
12 2060
11 4248
80
60 01
90
12 2060
11 4250
80
60 01
90
12 2060
11 4258
80
60 01
90
12 2060
11 4260
80
60 01
90
12 2060
11 4268
80
60 01
90
12 2060
11 4270
80
60 01
90
12 2060
11 4278
80
60 01
90
12 2060
11 4280
80
60 01
90
12 2060
11 4288
80
60 01
90
12 2060
11 4290
80
60 01
90
12 2060
11 4298
80
60 01
90
12 2060
11 42A0
80
60 01
90
12 2060
11 42A8
80
60 01
90
12 2060
11 42B0
80
60 01
90
12 2060
11 42B8
80
60 01
90
12 2060
11 42C0
80
60 01
90
12 2060
11 42C8
80
60 01
90
12 2060
11 42D0
80
60 01
90
12 2060
11 42D8
80
60 01
90
12 2060
11 42E0
80
60 01
90
12 2060
11 42E8
80
60 01
90
12 2060
11 42F0
80
60 01
90
12 2060
11 42F8
80
60 01
90
12 2060
11 4300
80
60 01
90
12 2060
11 4308
80
60 01
90
12 2060
11 4310
80
60 01
90
12 2060
11 4318
80
60 01
90
12 2060
11 4320
80
60 01
90
12 2060
11 4328
80
60 01
90
12 2060
11 4330
80
60 01
90
12 2060
11 4338
80
60 01
90
12 2060
11 4340
80
60 01
90
12 2060
11 4348
80
60 01
90
12 2060
11 4350
80
60 01
90
12 2060
11 4358
80
60 01
90
12 2060
11 4360
80
60 01
90
12 2060
11 4368
80
60 01
90
12 2060
11 4370
80
60 01
90
12 2060
11 4378
80
60 01
90
12 2060
11 4380
80
60 01
90
12 2060
11 4388
80
60 01
90
12 2060
11 4390
80
60 01
90
12 2060
11 4398
80
60 01
90
12 2060
11 43A0
80
60 01
90
12 2060
11 43A8
80
60 01
90
12 2060
11 43B0
80
60 01
90
12 2060
11 43B8
80
60 01
90
12 2060
11 43C0
80
60 01
90
12 2060
11 43C8
80
60 01
90
12 2060
11 43D0
80
60 01
90
12 2060
11 43D8
80
60 01
90
12 2060
11 43E0
80
60 01
90
12 2060
11 43E8
80
60 01
90
12 2060
11 43F0
80
60 01
90
12 2060
11 43F8
80
60 01
90
73

Might have to go off the course then...  ;)
« Last Edit: 2015-06-04 10:32:20 by Husbjörn »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
 ;D haha

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
I typed up an actual answer to this question, but it appears to have gotten lost. :(

No. You cannot dynamically change AP values through AI. It only reads from the entry in the scene.bin file. Severely missed opportunity there. It would be really cool to have enemies change state and be worth more AP when in "magically charged." EXP and Gil can still be edited though, but I don't think EXP is ever changed in vanilla.

Husbjörn

  • *
  • Posts: 36
    • View Profile
Missed opportunity indeed!
Out of curiosity, does any encounter have a non-static gil reward? (I haven't actually played through the game in ages).

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Missed opportunity indeed!
Out of curiosity, does any encounter have a non-static gil reward? (I haven't actually played through the game in ages).

An enemy called TrickPlay does this action called Gold Mountain that increases dropped gil by 800 every time it does it. I don't think there's another example in all of the vanilla game that does this for gil or EXP, but both should be possible.

Husbjörn

  • *
  • Posts: 36
    • View Profile
An enemy called TrickPlay does this action called Gold Mountain that increases dropped gil by 800 every time it does it. I don't think there's another example in all of the vanilla game that does this for gil or EXP, but both should be possible.

Ah yes I remember that one, though I don't think I ever realized that increased the dropped gil. That's pretty cool!

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
I never did either, but that's because gil is WAY too easy to come by... totally breaks the mechanics.

I am thinking of making it so that only bosses drop it (from the enemy side) in my difficulty mod.  Certainly I won't allow huge gil gains.