Alright, so with the addition of the Hex editor for map code, you can do a lot of neat new stuff if you know how. Today I'm gonna give you some info useful for changing around when/which party members are added during the game.
The function for removing party members is located at 0x080AD110 in the ROM. One place in the game that this function is called is at 0x02009ABE in the code for map 5 (VT001) Apparently at the very beginning of the game Felix & Jenna are both in the party, but Felix is removed at the end of the cutscene between Jenna, Kraden, and Alex. If you look back 1 command at 0x02009ABC, this "mov r0, #0x04" is where it tells it to do it to Felix, if you switch over the hex editor, and change the 0x04 value at that location to 0x05 you can remove Jenna from the party instead. You'll still play as Jenna, but during battles and in menus Felix will be your only party member.
As for adding party members, that is controlled by a function located at 0x080AD0F8, which is often called through a function at 0x080C8048 used to display an accompanying "so-and-so joined your party." message on screen. If you go to map 9 (OTMP0008) you'll find several places this function is used:
Talk to Jenna, 0x0200847A
Talk to Sheba, 0x02008620
Try to leave without Jenna, 0x02008A84
Try to leave without Sheba, 0x02008CD6
Look for a command that begins with "mov r0" before the function call, that's where it sets who joins the party, by changing the value at the location of that command to something between 0-7 you can add any other party member at that time. Anything above 7 won't work, and will likely result in glitches.
The switch between Jenna & Felix at the beginning of the game is somewhere in the code of map 0 (It happens when the title screen is displayed after Felix & Sheba wash up on the island) It uses a slightly different method at that point, more information on it will come later.
Piers joins the party on map 111 (KBMB10) at 0x0200A03C
Sweet, nice work! By the way, have you searched for Party 1's locations yet, or should we expect this later in the future?
Thanks for finding them so far Atrius, my hack will surely depend on this information!
Have a nice day.
map 237 (GAI_ROOM01)
I'll have to look into it more for the specific locations in the code later on.
Sweet, thanks. The map is good enough, since I can play with the data to see what happens. I might do some research on the scripts that make Jenna and Sheba leave on Jupiter Lighthouse, since I would imagine that they are not far away from the Party 1 code.
So it is around there? By the way, could you please tell me what the commands are that enable joining?
Have a nice day.
It would be in the code for the map that it happens on which is 263 (JTO_M) unless if I'm mistaken.
Commands that enable joining? It's done through a function call. Let's look at the code for adding Jenna when you talk to her.
(http://img.photobucket.com/albums/v698/AtriusV/Games/Golden%20Sun%20Project/JennaJoin_ASM0.jpg)
This code is the function call, it sets the arguments, then branches to another part of the map code where the functions location is stored, 0x0200B1C8, which if we look at:
(http://img.photobucket.com/albums/v698/AtriusV/Games/Golden%20Sun%20Project/JennaJoin_ASM1.jpg)
It simply loads the location of the function (0x080C8048, though here the location of the function has 1 added to it so that the processor knows to execute it in THUMB format rather than ARM), then redirects the processor to it.
mov r1, #0x01
mov r0, #0x05
bl $0200B1C8
Is all of the code used to add Jenna to the party in the script for the cutscene with her, the function redirect later in the map code, and then the function itself takes care of the rest. Whats put into r0, and r1 are the values the function uses to know exactly what it needs to do with r0 being the party member 0-7 to add, and r1 set to either 1 or 0 telling it if it should display the message that says "so-and-so joined your party." or not.
QuoteBy the way, have you searched for Party 1's locations yet, or should we expect this later in the future?
Quotemap 237 (GAI_ROOM01)
I'll have to look into it more for the specific locations in the code later on.
I would also be interested in knowing where it is in the last ROOM Shoptest, for when you enter this room through the Debug Menu as
Door 99.
QuoteI would also be interested in knowing where it is in the last ROOM Shoptest, for when you enter this room through the Debug Menu as Door 99.
0x020086F4, it's a separate function (0x080AD240) that doesn't appear to take any arguments.
Ok after successfully having Garet and Isaac join the party instead of Jenna and Sheba at the beginning of the game, once Echo joins the party is reset and Jenna and Sheba show up instead of Garet and Isaac. I would like to know if there is any way i can keep this from happening and have echo join at the same time.
As I seem to remember, the party is reset when you meet Echo, to prevent a case where the player somehow doesn't get the others to join the party and thus continue the game without them.
Yeah, they included that because of sanctum warping. IIrc, it locks you out of the idejima zoomed-in area once you leave it, so they didn't want you to be able to leave your party members behind permanently, making the game unwinnable. Come to think of it... wouldn't TLA have been rendered unwinnable if you sanctum warped and saved after beating the doom dragon? Or even if you just used retreat and saved... Unless they lock out both saving and using retreat after the doom dragon fight, you should be able to screw yourself in some form or another. Since if the teleport lapis was on another character, I don't think you could make it back to the top of mars lighthouse.
Where do I go to get to there? Is that the memory viewer? Because mine looks different.
And if its not too much trouble, what characters are what numbers 0-7.
Quote from: Atrius on 06, November, 2010, 07:22:48 PM
It would be in the code for the map that it happens on which is 263 (JTO_M) unless if I'm mistaken.
Commands that enable joining? It's done through a function call. Let's look at the code for adding Jenna when you talk to her.
(http://img.photobucket.com/albums/v698/AtriusV/Games/Golden%20Sun%20Project/JennaJoin_ASM0.jpg)
This code is the function call, it sets the arguments, then branches to another part of the map code where the functions location is stored, 0x0200B1C8, which if we look at:
(http://img.photobucket.com/albums/v698/AtriusV/Games/Golden%20Sun%20Project/JennaJoin_ASM1.jpg)
It simply loads the location of the function (0x080C8048, though here the location of the function has 1 added to it so that the processor knows to execute it in THUMB format rather than ARM), then redirects the processor to it.
mov r1, #0x01
mov r0, #0x05
bl $0200B1C8
Is all of the code used to add Jenna to the party in the script for the cutscene with her, the function redirect later in the map code, and then the function itself takes care of the rest. Whats put into r0, and r1 are the values the function uses to know exactly what it needs to do with r0 being the party member 0-7 to add, and r1 set to either 1 or 0 telling it if it should display the message that says "so-and-so joined your party." or not.
You can only edit the map code in the editor since it's compressed. The hex editor for map code is accessed in the map viewer by clicking the button that says "Map" and selecting "Code Hex"
The characters are in the same order as in the party member editor.
0 - Isaac
1 - Garet
2 - Ivan
3 - Mia
4 - Felix
5 - Jenna
6 - Sheba
7 - Piers
Ah. I was trying to figure out how the game adds Felix, Jenna, and Sheba to your party during the Echo scene, but I have had little to no luck figuring this out so far. If someone with a bit more coding experience can figure it out, that would be great. However, I am going to take a break from this for the rest of the night. Currently, I have the following pointers:
x02000458 - Felix
x02000459 - Jenna
x0200045A - Sheba
Possibly related:
x080AFDD9
x080AFE14
Who knows, it might be right under my nose?
Edit: Wait wait!!! I somehow managed to have my team turned into two Jennas and one Mia. I shall get back to everyone on this.
You probably should have traced it back once more.
02009EB6 = This area clears all party members.
02009EE6 = Adds Party Members 4, 5, and 6.
So you solved it? Excellent, thanks for looking into it for, well, everyone!
Edit: So we pretty much know about all of this now, don't we? Or... um, oh - Party 1 is still a bit mysterious.
So, exactly how many different functions are Party Member related?
080AD0F8 (080AFDD8) = Add Party Member
080AD0100 (080AFE78) = ??? (Party Member Related.)
080AD0108 (080B04BC) = ??? (No idea.)
080AD110 (080AFE1C) = Remove Party Member
080AD240 (080AE6E4) = Add Isaac's Party
080C8048 (080D23D8) = Add Party Member w/ Dialogue
Is that it? All you had to do, was place aThumb Breakpoint at 080AD0F8 and see what was at R14 (LR) Register to find where the code was that adds the party members. If there is dialogue, or if the first one fails you, you should do it at 080C8048.
Well I found where the different numbers are ... but not exactly sure which one to change >_<
Here is a Snapshot of the Hex Editor ...
(http://i1095.photobucket.com/albums/i468/Qais_Zaid/World-02009EB6.png)
Ah, I have an image that might help, when it comes to highlighting.
(http://i856.photobucket.com/albums/ab125/Salanewt/EchoMemberGuideGS.png)
This only shows where each character is in the script, and does not show/change who joins/leaves. However, with a bit of knowledge, one can easily change this to make the whole party join if they wish.
Don't you think it would be much easier to look at that in 16-bit?
So I've been thinking about this lately. Does anybody know how to make someone other than Felix join your party when the game cuts out to the title screen on Idejima? To be a bit more helpful, I'll contribute something myself.
x080ADEF6 - Adds Felix as a starting PC before creating a file (this stored a value into R0 from R3, but changing it to 200# should work).
x080ADEFC - Adds Jenna as a starting PC before creating a file (2005, where x05 is Jenna).
The above code executes even before a file is created, so Felix and Jenna will always the default party members when a file isn't selected. It should be noted that these characters will stay in your party when creating a new file, and that Felix' replacement will not be removed from the party at Venus Lighthouse without actually modifying the code that removed him.
Easiest method is to use VBA-SDL-H. Place a breakpoint write on 02000040. On breakpoint, you'll want to continue executing the code until you ext the function, which will probably give you your location. (But if you aren't completely out of the party member adding function, you may need exit by executing code again.... I forget if there are function calls in the party member adding function itself.)
I tried a while ago, but I had no luck finding it. I even tried replacing/deleting code in the title screen room's assembly, but I don't think that worked either.
>.< Why must I do everything? ; (Heh. Don't take this line seriously.)
When you get a breakpoint, you'll be at 08016DOE ; This is in the WRITE BIT function, so let's exit it by doing:
n<enter>
See? You are at 080AFDE8, this is in the ADD CHARACTER function, so you'll need to exit this function as well. (Keep doing: n<enter>.)
We are now at 080AE104. Now what is right above this is what you want. Simply easy peasy. (I wouldn't be surprised if the change of leader happens somewhere around here as well, but I have not looked yet. Edit: 080AE0FA)
This function is called from 020081BA. So if you want to investigate, good luck.
Oh gosh, lol. I just used your call locator tool, and I found it there too. I think I'm... Special. On the positive side, I don't think there is much else to find in regards to this topic.
Anyway, thanks for helping me out with this!