12-27-2015, 09:46 PM
(This post was last modified: 12-28-2015, 11:55 AM by Kugawattan.)
There seems to be a gigantic amount of things you need to change to have what seems like a relatively simple task. I'm going to try to list them all, but there will be stuff I'm gonna miss.
1) Create an NPC on the map and place it somewhere, preferably next to the other characters my making a slight map edit; give the character an event.
2) Using your hex editor go to the event you've assigned your character and give it a code using this base found at CC/C3EB:
3) Notice it calls subroutines twice. You need to edit those too; you need to add a new line to the code that accounts for the new NPC:
and
^You're most likely going to have to make more space for this to happen; you'll need to call a subroutine, which if you're reading this you may already know what that is; Madsiur has a great tutorial over there.
3) Remember you must add a new line at every other character's block of events to account for the new character, otherwise your new character may appear twice. This is the line you'll need to add:
If you have moved the code, you'll need to account for that when it calls subroutines; they must call the correct location.
4) We're not done however. If you talk with your new character someone else, you'll notice you'll make the new character disappear. The answer is at CC/C379
You'll need to add a block of new commands to account for the new characters:
You'll need to make new changes: It has to branch to the new location of FE. Depending on which character you need to add, you'll also have to change the corresponding bit (at the first line):
Now, be sure to go to the Level Editor and make sure each NPC has his corrent event associated; if we've moved the code to make space, this will surely need to be corrected.
See the save point? If you step on it, the character's places will return to their original position. I don't see the point of this and I don't think it is necesary at all. Since you'll need to also take account for the new character, the simplest thing to do would be removing the code and replacing it with a regular Save point. It won't make a diference and you'll have a few lines to write custom events, such as this one.
Now, to actually add Shadow as one of the fighters to put in the character selection screen:
If you wish to give him/her a line while on the battle:
Add your piece of code there and give it a subroutine where it plays this:
Edit it as you please.
Also, when Banon yells "They're coming!", if you made your character the party leader, you might want to give him/her a custom "ready" pose:
Add a command line to refer to the new character.
Conglaturation !!! You have sucessfully added a new character into the Narshe battlefield event! ...probably.
1) Create an NPC on the map and place it somewhere, preferably next to the other characters my making a slight map edit; give the character an event.
2) Using your hex editor go to the event you've assigned your character and give it a code using this base found at CC/C3EB:
Code:
CC/C3EB: B2 Call subroutine $CCC35B
CC/C3EF: B2 Call subroutine $CCC379
CC/C3F3: 42 Hide object $31
CC/C3F5: 45 Refresh objects
CC/C3F6: 3D Create object $XX (the actor you've added)
CC/C3F8: 3F Assign character $XX (Actor in stot XX) to party 1
CC/C3FB: 45 Refresh objects
CC/C3FC: 01 Begin action queue for character $XX (Actor in stot XX), 3 bytes long (Wait until complete)
CC/C3FE: D7 Center screen on vehicle/entity
CC/C3FF: CE Turn vehicle/entity down
CC/C400: FF End queue
CC/C401: 3C Set up the party as follows: $XX (Actor in stot 1), $FF (<Invalid Character>), $FF (<Invalid Character>), $FF (<Invalid Character>)
CC/C406: 41 Show object $XX
CC/C408: 45 Refresh objects
CC/C409: 3F Remove character $04 (Actor in stot 4) from the party
CC/C40C: 3F Remove character $06 (Actor in stot 6) from the party
CC/C40F: 3F Remove character $00 (Actor in stot 0) from the party
CC/C412: 3F Remove character $05 (Actor in stot 5) from the party
CC/C415: 3F Remove character $02 (Actor in stot 2) from the party
CC/C418: 3F Remove character $0B (Actor in stot 11) from the party
XX/XXXX: 3F Remove character $01 (Actor in stot 1) from the party <-Add this one. You have to add a remove character bit for all other characters that appear there.
CC/C41B: 45 Refresh objects
CC/C41C: 42 Hide object $YY (the NPC number)
CC/C41E: 45 Refresh objects
CC/C41F: B2 Call subroutine $CCC36A
CC/C423: 3A Enable player to move while event commands execute
CC/C424: FE Return
3) Notice it calls subroutines twice. You need to edit those too; you need to add a new line to the code that accounts for the new NPC:
Quote:78 YY Enable ability to pass through other objects for object $YY (NPC $YY)
and
Code:
36 YY Disable ability to pass through other objects for object $YY (NPC $YY)
^You're most likely going to have to make more space for this to happen; you'll need to call a subroutine, which if you're reading this you may already know what that is; Madsiur has a great tutorial over there.
3) Remember you must add a new line at every other character's block of events to account for the new character, otherwise your new character may appear twice. This is the line you'll need to add:
Code:
3F Remove character $XX (Actor in stot XX) from the party <-Add this one. You have to have a remove character for all other characters that appear there.
If you have moved the code, you'll need to account for that when it calls subroutines; they must call the correct location.
4) We're not done however. If you talk with your new character someone else, you'll notice you'll make the new character disappear. The answer is at CC/C379
Code:
CC/C379: DE Load CaseWord with the characters in the currently active party?
CC/C37A: C0 If ($1E80($1A0) [$1EB4, bit 0] is clear), branch to $CCC38A
CC/C380: 3D Create object $11
CC/C382: 11 Begin action queue for character $11 (NPC $11), 3 bytes long (Wait until complete)
CC/C384: D7 Center screen on vehicle/entity
CC/C385: 82 Move vehicle/entity down 1 tile
CC/C386: FF End queue
CC/C387: 41 Show object $11
CC/C389: 45 Refresh objects
CC/C38A: C0 If ($1E80($1A1) [$1EB4, bit 1] is clear), branch to $CCC39A
CC/C390: 3D Create object $12
CC/C392: 12 Begin action queue for character $12 (NPC $12), 3 bytes long (Wait until complete)
CC/C394: D7 Center screen on vehicle/entity
CC/C395: 82 Move vehicle/entity down 1 tile
CC/C396: FF End queue
CC/C397: 41 Show object $12
CC/C399: 45 Refresh objects
CC/C39A: C0 If ($1E80($1A6) [$1EB4, bit 6] is clear), branch to $CCC3AA
CC/C3A0: 3D Create object $13
CC/C3A2: 13 Begin action queue for character $13 (NPC $13), 3 bytes long (Wait until complete)
CC/C3A4: D7 Center screen on vehicle/entity
CC/C3A5: 82 Move vehicle/entity down 1 tile
CC/C3A6: FF End queue
CC/C3A7: 41 Show object $13
CC/C3A9: 45 Refresh objects
CC/C3AA: C0 If ($1E80($1A4) [$1EB4, bit 4] is clear), branch to $CCC3BA
CC/C3B0: 3D Create object $15
CC/C3B2: 15 Begin action queue for character $15 (NPC $15), 3 bytes long (Wait until complete)
CC/C3B4: D7 Center screen on vehicle/entity
CC/C3B5: 82 Move vehicle/entity down 1 tile
CC/C3B6: FF End queue
CC/C3B7: 41 Show object $15
CC/C3B9: 45 Refresh objects
CC/C3BA: C0 If ($1E80($1A5) [$1EB4, bit 5] is clear), branch to $CCC3CA
CC/C3C0: 3D Create object $16
CC/C3C2: 16 Begin action queue for character $16 (NPC $16), 3 bytes long (Wait until complete)
CC/C3C4: D7 Center screen on vehicle/entity
CC/C3C5: 82 Move vehicle/entity down 1 tile
CC/C3C6: FF End queue
CC/C3C7: 41 Show object $16
CC/C3C9: 45 Refresh objects
CC/C3CA: C0 If ($1E80($1A2) [$1EB4, bit 2] is clear), branch to $CCC3DA
CC/C3D0: 3D Create object $14
CC/C3D2: 14 Begin action queue for character $14 (NPC $14), 3 bytes long (Wait until complete)
CC/C3D4: D7 Center screen on vehicle/entity
CC/C3D5: 82 Move vehicle/entity down 1 tile
CC/C3D6: FF End queue
CC/C3D7: 41 Show object $14
CC/C3D9: 45 Refresh objects
CC/C3DA: C0 If ($1E80($1AB) [$1EB5, bit 3] is clear), branch to $CCC3EA
CC/C3E0: 3D Create object $17
CC/C3E2: 17 Begin action queue for character $17 (NPC $17), 3 bytes long (Wait until complete)
CC/C3E4: D7 Center screen on vehicle/entity
CC/C3E5: 82 Move vehicle/entity down 1 tile
CC/C3E6: FF End queue
CC/C3E7: 41 Show object $17
CC/C3E9: 45 Refresh objects
CC/C3EA: FE Return
You'll need to add a block of new commands to account for the new characters:
Code:
CC/C3DA: C0 If ($1E80($1AB) [$1EB5, bit 3] is clear), branch to $CCC3EA
CC/C3E0: 3D Create object $YY
CC/C3E2: 17 Begin action queue for character $YY (NPC $YY), 3 bytes long (Wait until complete)
CC/C3E4: D7 Center screen on vehicle/entity
CC/C3E5: 82 Move vehicle/entity down 1 tile
CC/C3E6: FF End queue
CC/C3E7: 41 Show object $YY
CC/C3E9: 45 Refresh objects
CC/C3EA: FE Return
You'll need to make new changes: It has to branch to the new location of FE. Depending on which character you need to add, you'll also have to change the corresponding bit (at the first line):
Code:
1A0 B4:0 Multipurpose bit for Terra; CaseWord bit 0
1A1 B4:1 Multipurpose bit for Locke; CaseWord bit 1
1A2 B4:2 Multipurpose bit for Cyan; CaseWord bit 2
1A3 B4:3 Multipurpose bit for Shadow; CaseWord bit 3
1A4 B4:4 Multipurpose bit for Edgar
1A5 B4:5 Multipurpose bit for Sabin
1A6 B4:6 Multipurpose bit for Celes
1A7 B4:7 Multipurpose bit for Strago
1A8 B5:0 Multipurpose bit for Relm
1A9 B5:1 Multipurpose bit for Setzer
1AA B5:2 Multipurpose bit for Mog
1AB B5:3 Multipurpose bit for Gau
1AC B5:4 Multipurpose bit for Gogo
1AD B5:5 Multipurpose bit for Umaro
1AE B5:6 Multipurpose bit for guest 1
1AF B5:7 Multipurpose bit for guest 2
Now, be sure to go to the Level Editor and make sure each NPC has his corrent event associated; if we've moved the code to make space, this will surely need to be corrected.
See the save point? If you step on it, the character's places will return to their original position. I don't see the point of this and I don't think it is necesary at all. Since you'll need to also take account for the new character, the simplest thing to do would be removing the code and replacing it with a regular Save point. It won't make a diference and you'll have a few lines to write custom events, such as this one.
Now, to actually add Shadow as one of the fighters to put in the character selection screen:
Code:
CC/C642: 4B Display dialogue message $036E, wait for button press
You'll fight in 3 groups.
Use the Y Button to switch between them.
Defeat Kefka before his men reach Banon. Otherwise, you lose!
CC/C645: D4 Set event bit $1E80($2F1) [$1EDE, bit 1]
CC/C647: D4 Set event bit $1E80($2F2) [$1EDE, bit 2]
CC/C649: D4 Set event bit $1E80($2F4) [$1EDE, bit 4]
CC/C64B: D4 Set event bit $1E80($2F5) [$1EDE, bit 5]
CC/C64D: D4 Set event bit $1E80($2F6) [$1EDE, bit 6]
CC/C64F: D4 Set event bit $1E80($2FB) [$1EDF, bit 3]
CC/C651: D4 Set event bit $1E80($2F0) [$1EDE, bit 0]
CC/C653: D5 Clear event bit $1E80($2F3) [$1EDE, bit 3] < The character you wish to have on the selection screen you set the event bit (switch D5 to D4)
CC/C655: D5 Clear event bit $1E80($2F7) [$1EDE, bit 7]
CC/C657: D5 Clear event bit $1E80($2F8) [$1EDF, bit 0]
CC/C659: D5 Clear event bit $1E80($2F9) [$1EDF, bit 1]
CC/C65B: D5 Clear event bit $1E80($2FA) [$1EDF, bit 2]
CC/C65D: D5 Clear event bit $1E80($2FC) [$1EDF, bit 4]
CC/C65F: D5 Clear event bit $1E80($2FD) [$1EDF, bit 5]
CC/C661: B2 Call subroutine $CACBAF
CC/C665: 99 Invoke party selection screen (3 groups) (force characters: [$0000] ()
CC/C669: 46 Make party 1 the current party
CC/C66B: B2 Call subroutine $CACCA4
CC/C66F: DD Clear event bit $1E80($61B) [$1F43, bit 3]
CC/C671: DC Set event bit $1E80($628) [$1F45, bit 0]
CC/C673: 6B Load map $0016 (Narshe, hills maze (WoB)) instantly, (upper bits $3000), place party at (20, 10), facing left
CC/C679: 3D Create object $00
CC/C67B: 3D Create object $01
CC/C67D: 3D Create object $06
CC/C67F: 3D Create object $04
CC/C681: 3D Create object $05
CC/C683: 3D Create object $02
CC/C685: 3D Create object $0B < Make sure you create your character here
CC/C687: 45 Refresh objects
If you wish to give him/her a line while on the battle:
Code:
CC/C6C6: 7A Change event address for object $00 to address $CCC8AB
CC/C6CB: 7A Change event address for object $01 to address $CCC8B3
CC/C6D0: 7A Change event address for object $04 to address $CCC8C3
CC/C6D5: 7A Change event address for object $05 to address $CCC8CB
CC/C6DA: 7A Change event address for object $02 to address $CCC8D3
CC/C6DF: 7A Change event address for object $0B to address $CCC8DB
CC/C6E4: 7A Change event address for object $06 to address $CCC8BB
Add your piece of code there and give it a subroutine where it plays this:
Code:
CC/C8AB: 00 Begin action queue for character $00 (Actor in stot 0), 2 bytes long (Wait until complete)
CC/C8AD: 20 Do vehicle/entity graphical action $20
CC/C8AE: FF End queue
CC/C8AF: 48 Display dialogue message $036F, continue executing commands
TERRA: Kefka…
He stuck that crown on me?
CC/C8B2: FE Return
Edit it as you please.
Also, when Banon yells "They're coming!", if you made your character the party leader, you might want to give him/her a custom "ready" pose:
Code:
CC/C6F8: 00 Begin action queue for character $00 (Actor in stot 0), 2 bytes long (Wait until complete)
CC/C6FA: 0A Do vehicle/entity graphical action $0A
CC/C6FB: FF End queue
CC/C6FC: 02 Begin action queue for character $02 (Actor in stot 2), 2 bytes long (Wait until complete)
CC/C6FE: 0A Do vehicle/entity graphical action $0A
CC/C6FF: FF End queue
CC/C700: 01 Begin action queue for character $01 (Actor in stot 1), 2 bytes long (Wait until complete)
CC/C702: 0A Do vehicle/entity graphical action $0A
CC/C703: FF End queue
CC/C704: 0B Begin action queue for character $0B (Actor in stot 11), 2 bytes long (Wait until complete)
CC/C706: 4A Do vehicle/entity graphical action $0A, flipped horizontally
CC/C707: FF End queue
CC/C708: 05 Begin action queue for character $05 (Actor in stot 5), 2 bytes long (Wait until complete)
CC/C70A: 0A Do vehicle/entity graphical action $0A
CC/C70B: FF End queue
CC/C70C: 06 Begin action queue for character $06 (Actor in stot 6), 2 bytes long (Wait until complete)
CC/C70E: 0A Do vehicle/entity graphical action $0A
CC/C70F: FF End queue
CC/C710: 04 Begin action queue for character $04 (Actor in stot 4), 2 bytes long (Wait until complete)
CC/C712: 4A Do vehicle/entity graphical action $0A, flipped horizontally
CC/C713: FF End queue
Add a command line to refer to the new character.
Conglaturation !!! You have sucessfully added a new character into the Narshe battlefield event! ...probably.
Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!