Author Topic: Altering enemys sizes from hex editer is it possible?  (Read 24953 times)

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #25 on: 2009-02-18 22:49:33 »
Wait, are we editing different cactuars again?

I was editing the one in scene58; it looks like you're editing the one in scene65.

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #26 on: 2009-02-18 22:51:09 »
*Cries* Yeah thats the one from scene 65 ill start editing the 1 from scene 58 now XD sorry!

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #27 on: 2009-02-18 22:52:11 »
I assume that you don't want to fight a Jumbo Cactuar in Corel Prison  :lol:

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #28 on: 2009-02-18 22:53:57 »
I assume that you don't want to fight a Jumbo Cactuar in Corel Prison  :lol:

Meh why not :-P Anyway im tempted to have alook and see if i can find the codes for the battle models (Cloud,Tifa,Sephiroth etc)

Enemy IDs (Battle model)
To ADD enemies to a scene you have to find a scene that isn't full (has 3 enemies), and then add a ID. This part is the easy part 'cause the IDs is in the very beginning of the scenes. The 6 1st bytes. Which means each ID is 2 bytes long. To begin with, you should find a scene you know where the encounters in the game are. For testing purpose.

Lets say you want to use the MP's battle model. I believe the ID here is 0x0010. Then if ID 1 is XXXX and ID 2 is YYYY then ID 3 will be 0x0010.

Taken form Gjoerulv's guide
« Last Edit: 2009-02-18 22:57:09 by ff7rules »

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #29 on: 2009-02-18 22:57:40 »
Wait, are you looking for those codes so that you can use them for enemy IDs?  :?

If so, don't!  :-o

I've tried to make allies into enemies that way and it doesn't quite work. There's trouble with weapons and the game freezes whenever they do anything.  :cry:

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #30 on: 2009-02-18 23:01:20 »
Wait, are you looking for those codes so that you can use them for enemy IDs?  :?

If so, don't!  :-o

I've tried to make allies into enemies that way and it doesn't quite work. There's trouble with weapons and the game freezes whenever they do anything.  :cry:

Is that http://www.youtube.com/watch?v=AyTaerNzGqw&feature=channel_page only possible because his AI is already in the game?

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #31 on: 2009-02-18 23:03:30 »
I'm not sure how that's done.

Although Sephiroth might not have the weapon problem that the other characters have...

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #32 on: 2009-02-18 23:11:33 »
Well watching Gameshark videos from GarlandtheGreat ff7 doesn't like it when something is cloned and it gets to close to it could be the case with this? Maybe try an ally that is not in the battle say Aerith since shes well you know.... However when you fight Yuffie with Yuffie the game is fine might be worth having alook at her script?

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #33 on: 2009-02-18 23:14:26 »
Yuffie as an enemy has her own special battle model, so there won't be the normal problems there.

In other news, I'm finally going to stop posting tonight, since I'm tired now...

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Altering enemys sizes from hex editer is it possible?
« Reply #34 on: 2009-02-18 23:49:54 »
Yeah lol ill try what you posted now. Ill update when i have the answer if it worked or not.
Edit what excatly did you change? Mines seems to be different to that one



Oh i see now! nvm i thought it was all 1 thing! its the 2 separated. I only just relized i need more sleep :-P

Your Header is wrong. The main script is pointing to a place still in the init script.

It should be:
Code: [Select]
20 00 36 00 FF FF FF FF FF FF FF FF FF FF D2 00
FF FF FF FF FF FF FF FF FF FF FF FF FF FF F2 00

If we're past this then just ignore me. ;)

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #35 on: 2009-02-19 00:01:53 »
I have a werid problem. Jumbo Cactuar does nothing and just dances i treid what LKM said to do it works he goes big and everything but then it freezes and the screen goes black anyone know what im doing wrong?

gjoerulv

  • *
  • Posts: 1225
  • me
    • View Profile
    • My Youtube
Re: Altering enemys sizes from hex editer is it possible?
« Reply #36 on: 2009-02-19 11:27:44 »
Make sure all the pointers are correct. Inside the sections as well. They should be if you only change the attacks in the AI. NFITC1 corrected the pointers ^. I haven't read the whole thread, but if you added attacks you must remember to tie an animation to each attack. If you altered the AI there can be problems in the AI itself.

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #37 on: 2009-02-19 13:13:48 »
Ok i didn't add any attacks to Cactuar yet so its not that i will look at the headers now though and see if there as there should be is the headers the old start the script?    I was editing the wrong Cactaur earlier aswell so i confused everyone (including myself)

Akari

  • *
  • Posts: 766
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #38 on: 2009-02-19 16:17:15 »
Quote
I think the command 92 (Attack) has other arguments than 20 and 24. Sephiroth's has 01 and 02. This might be significant.

20 and 24 are ID of action.
Posible actions are
Code: [Select]
800f692c + 03 []       action type (0x01 - player attack
                                    0x02 - player magic
                                    0x03 - player summon
                                    0x04 - player item
                                    0x05 - player steal
                                    0x06 - player sense
                                    0x07 - player coin
                                    0x08 - player throw
                                    0x09 - player morph
                                    0x0A - player deathblow
                                    0x0B - player manipulate
                                    0x0C - player mime
                                    0x0D - player enemy skill
                                    0x0E - ???
                                    0x0F - ???
                                    0x10 - ???
                                    0x11 - player mug
                                    0x12 - player change
                                    0x13 - player defend
                                    0x14 - player limit
                                    0x15 - this replaces with magic after modification
                                    0x16 - this replaces with summon after modification
                                    0x17 - this replaces with item after modification
                                    0x18 - player slash-all
                                    0x19 - player 2x-cut
                                    0x1A - player flash
                                    0x1B - player 4x-cut
                                    0x1C - ???
                                    0x1D - ???
                                    0x1E - ???
                                    0x1F - ???
                                    0x20 - enemy attack
                                    0x21 - ???
                                    0x22 - run scripts
                                    0x23 - ???
                                    0x24 - ???
                                    0x25 - ???

Else things that you can modify in battle unit data are as follows
Code: [Select]
800f83e0               unit data structure. (size 0x68). (address 0x4000).
800f8580               enemy start
00 [][][][] current status. Init with 0. Set sandess/fury flags from savemap structure in case of player. Add 0x00000001 if current hp of character is 0.
04 [][][][] some flags. Init with 0 in case of enemy. Set +0c in battle formation &0x1f here in case of enemy.
            00000002 - looks like if this bit set we are left fighters (right otherwise) in case of side battle.
            00000008 - seems like enabled units in battle. Init with this in case of player.
            00000010 - units with activates auto script 0x01 (action).
            00000020 - remove this flag if we add action with priority >= 2. Looks like defend flag (if we in defend state or not).
            00000040 - set this bit if we in back row.
            00000080 - set this bit for: enemies in case of battle type 0, player in case of battle 2, left row an player 2 in case of battle 4. func1b19ac.
            00000100 - looks like nullify phisical attack.
            00000200 - looks like nullify magic attack.
            00000800 - probably bit for temporary unreachable unit (set in battle_update_unit_mask).
            00002000 - set this bit if unit is dead in battle (if unit was dead at the begin of battle flag is not set).
            00004000 - invisibility flag. All attack will miss this target.
08 []       index. Init with 0xff. Set player character id here in case of player. Set index in case of enemy.
09 []       level. Init with player level.
0a
0b []       store minimum elemental influence here (0 - death, 2 - 200%damage, 3 - normal, 4 - 50%damage, 5 - 0%damage, 6 - 100%absorb, 7 - fully recover)
0c []       formation number. Init with 0. If we init second unit of this type we increment this value by 1 for this unit. If 6 same unit on field they will have 0,1,2,3,4,5 as this value. Set player character id + 0x10 in case of player.
0d []       attack power (strength in enemy data format).
0e []       magic power (magic in enemy data format).
0f []       set evade from armor in case of player (defense% in game).
10 []       init with 0. Set 0x10 during player init. Idle action id.
11 []       init with 5 in case of player. Init with 1 in case of enemy. Hurt action id.
12 []       back damage multiplier. set from +a2[] in enemy data (usually 0x10).
13 []       model scale (just changing doesn't work)?. init with 10.
14 []       dexterity.
15 []       luck.
16 []       init with 0 in case of player.
17 []       store 0xff here at start of funcabb0c
18 [][]     attack mask set during run command.
1a [][]     - some mask (maybe mask of those who attack this unit)
1c [][]     -
1e [][]     -
20 [][]     defense. Multiplied by 2 in case of enemy.
22 [][]     magic defense. Multiplied by 2 in case of enemy.
24 [][]     init with 0xffff. Set enemy id here.
26 [][]     elements mask. add this to absorb elements mask during damage calc.
28 [][]     current MP.
2a [][]     max MP.
2c [][][][] current HP.
30 [][][][] max HP.
34
35
36
37
38
39
3A
3B
3C
3D
3E
3F
40
41
42
43
44 [][][][] Init with 0. Store status of this unit here during initialization.
48
49
4a
4b
4c []       Init with 1.
4d []       set magic evade (magic defense% in game) from armor equipped in case of player.
4e []       store row from battle formation here during init.
4f []       init with 0xff.
50 [][]     init with 0.
52 [][]     init with 0xffff.
54 [][]     elements mask. add this to no damage elements mask during damage calc.
56 []       store 2 here during init in case of enemy. Init with 8 in case of player.
56 [][]     ap.
58 [][][][] gil.
5c [][][][] exp.
60
61
62
63
64
65
66
67

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Altering enemys sizes from hex editer is it possible?
« Reply #39 on: 2009-02-19 20:23:02 »
Posible actions are
Code: [Select]
800f692c + 03 []       action type (0x01 - player attack
                                    0x02 - player magic
                                    0x03 - player summon
                                    0x04 - player item
                                    0x05 - player steal
                                    0x06 - player sense
                                    0x07 - player coin
                                    0x08 - player throw
                                    0x09 - player morph
                                    0x0A - player deathblow
                                    0x0B - player manipulate
                                    0x0C - player mime
                                    0x0D - player enemy skill
                                    0x0E - ???
                                    0x0F - ???
                                    0x10 - ???
                                    0x11 - player mug
                                    0x12 - player change
                                    0x13 - player defend
                                    0x14 - player limit
                                    0x15 - this replaces with magic after modification
                                    0x16 - this replaces with summon after modification
                                    0x17 - this replaces with item after modification
                                    0x18 - player slash-all
                                    0x19 - player 2x-cut
                                    0x1A - player flash
                                    0x1B - player 4x-cut
                                    0x1C - ???
                                    0x1D - ???
                                    0x1E - ???
                                    0x1F - ???
                                    0x20 - enemy attack
                                    0x21 - ???
                                    0x22 - run scripts
                                    0x23 - ???
                                    0x24 - ???
                                    0x25 - ???
Nice. Changing the 60 02 to 60 14 made the difference. So 92 is "Perform Command YY with index XXXX". Terrific! Cosmo Memory is working. However, he doesn't shrink back down after performing it. He kept getting bigger until he no longer fit on the screen and then shrunk back down to size 10h. Very strange.

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #40 on: 2009-02-20 11:52:46 »
I tried what LKM said to change and it still doesn't work heres what i have.

http://www.imagenerd.com/uploads/jumbo_cactuar_script_wrong-s53tq.png

Any ideas? Sorry to bother you again. Note this is the cactuer from scene 58, the other one was the one from scene 65.
« Last Edit: 2009-02-20 11:58:38 by ff7rules »

gjoerulv

  • *
  • Posts: 1225
  • me
    • View Profile
    • My Youtube
Re: Altering enemys sizes from hex editer is it possible?
« Reply #41 on: 2009-02-20 12:17:08 »
The header is wrong. The 1st pointer is correct. The 2nd must be 0x0053 (not 0x0049), and the 8th 0x00C9 (not 0x00BF). I haven't seen more into it though, might be more.
« Last Edit: 2009-02-20 12:36:31 by gjoerulv »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Altering enemys sizes from hex editer is it possible?
« Reply #42 on: 2009-02-20 12:26:16 »
The header is wrong. The 1st pointer is correct. The 2nd must be 0x0052 (not 0x0049), and the 8th 0x00C8 (not 0x00BF). I haven't seen more into it though, might be more.

No. The second must be at 0x53. 0x52 points to the 73h that ends the script so it wouldn't have a main if you did that. You have to point to the byte after the 73h.

ff7rules, do you even know what we mean when we're talking about a header? Read this. If you still have questions feel free to ask again.

gjoerulv

  • *
  • Posts: 1225
  • me
    • View Profile
    • My Youtube
Re: Altering enemys sizes from hex editer is it possible?
« Reply #43 on: 2009-02-20 12:36:12 »
Sorry, you're correct. Dumb mistake. It's corrected. And it's 0x00C9 not 0x00C8.

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #44 on: 2009-02-20 12:40:50 »
Ok i get where the headers are and everything and they mostly consist of FFs however how do you work out where the new header is like the hex value? thats what i don't get sorry if this is really obvious. Does it always point to the starty of a new script or something?
« Last Edit: 2009-02-20 12:55:29 by ff7rules »

gjoerulv

  • *
  • Posts: 1225
  • me
    • View Profile
    • My Youtube
Re: Altering enemys sizes from hex editer is it possible?
« Reply #45 on: 2009-02-20 12:59:40 »
See the first 73h in the picture you posted? The Header for the enemy you're modding starts right after it. 73hs are easy to recognize as marks in the AI, just make sure it isn't used inside an argument, like 72GoTo(0173) (this really is annoying when making AIs). Each pointer is 2 bytes long. (you knew this :P)

The 1st pointer is 0x20
The 2nd pointer is 0x49 should be 0x53
The 8th pointer is 0xBF should be 0xC9

These bytes represent the offset inside the AI. The offset they represent are the start of a section. They always land after a 73h, except the 1st which starts right after the header.

1st section is the SETUP
2nd section is MAIN
8th is PRE-TURN

Note that the header is also counted in when finding the offset. The 1st byte in the header is offset 0x00 of that enemy's AI. The 1st byte after the header is always offset 0x20, thus the 1st used pointer is always 0x20. If setup isn't used MAIN is in almost all cases 0x20 (Setup is then 0xFFFF). 0xFFFF simply means that the section isn't used.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Altering enemys sizes from hex editer is it possible?
« Reply #46 on: 2009-02-20 13:16:22 »
The 8th section is actually Post-Attack. It did seem like it MIGHT have been Pre-turn, but it's really executed immediately after any attack is performed by any actor to any target. Otherwise it would activate when PCs' menus come up.

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #47 on: 2009-02-20 13:47:38 »
I think I get it now! so its referring to what byte in the enemy's AI so if you move it any at all its best to make a note of how much its moved by then add it to what it once was is this correct? Sorry if i seem thick but this is all new to me.

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Altering enemys sizes from hex editer is it possible?
« Reply #48 on: 2009-02-20 13:57:09 »
Wait, there's a difference between our scripts; ff7rules, you've got another ten bytes in there that I didn't have. I've highlighted them. That's what went wrong.


gjoerulv

  • *
  • Posts: 1225
  • me
    • View Profile
    • My Youtube
Re: Altering enemys sizes from hex editer is it possible?
« Reply #49 on: 2009-02-20 14:04:58 »
The 8th section is actually Post-Attack. It did seem like it MIGHT have been Pre-turn, but it's really executed immediately after any attack is performed by any actor to any target. Otherwise it would activate when PCs' menus come up.

You are prob right. It's been ages since I did any modding. Yeah, post-turn/attack sounds more correct as I recall. This script is run after each command by any battler.

I think I get it now! so its referring to what byte in the enemy's AI so if you move it any at all its best to make a note of how much its moved by then add it to what it once was is this correct? Sorry if i seem thick but this is all new to me.

At least if you insert or delete bytes inside the AI (add or remove). Basically if a section is longer or shorter that what it used to, all section's pointers after the one you altered needs to be adjusted to land after the 73hs.
Lets say I alter the MAIN section. The COUNTER GENERAL section's pointer is 0x0125, but MAIN got 5 bytes shorter. Thus I need to adjust the COUNTER GENERAL pointer to 0x0120. I don't need to adjust the SETUP pointer 'cause it's offset is unaffected by me altering MAIN. But every offset after MAIN is affected, thus the pointers needs to be adjusted for those sections.

Hope this made any sense.

And, just in case, you need to check the main pointers for the AI. You know the 6 1st bytes of the AI section in the scene. If you're altering the last enemy in the scene it doesn't matter, but if you alter the 1st or 2nd you need to adjust these pointers as well. These points to the offset of the Enemy's AIs. The 1st will always be 0x06.