• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[ARCHIVE] Simple Questions (SEARCH BEFORE ASKING A QUESTION)

Status
Not open for further replies.

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
Thanks, redriders!
Yeah, I know about all the pallets changing if you import another into it, which is why I would be pretty scared, haha.

The rematches are pretty complicated, but if this wasn't too much to ask, is there any chance you could show me a script from one of the rematchable trainers in FR and point out where the section you mentioned is located? So that way I can analyze it and teach myself how to use it effectively.

Well, unfortunately, a fair amount of a rematchable trainer is undercover, in ASM. All the rematched trainer scripts have this format:

Spoiler:

Commented, if need be.

Now, when it branches, it appears to call the exact same trainer battle, but this is not the case. It calls one of the other trainerbattles associated with that base. The table mentioned in my previous post will "link" up to five trainers together. So the ASM will load one of those trainerbattles, and NOT the 0x75 trainerbattle. Each rematchable person has basically five trainerbattles associated with them.

Another thing I forgot to mention is that certain trainerbattles are "unlocked" after setting certain flags. For example, no trainers are rematchable until flag 0x292 is set. All rematchable trainers jump to the next level when flag 0x896 (Celadon City visited) is set. All rematchable trainers jump ANOTHER level when flag 0x897 (Fuschia City visited) is set. They jump a fourth level when flag 0x82C (E4 beaten) is set. And they reach their highest level once flag 0x844 (RSE Trading established) is set.
 
154
Posts
11
Years
  • Seen Jan 8, 2017
Well, unfortunately, a fair amount of a rematchable trainer is undercover, in ASM. All the rematched trainer scripts have this format:

Spoiler:

Commented, if need be.

Now, when it branches, it appears to call the exact same trainer battle, but this is not the case. It calls one of the other trainerbattles associated with that base. The table mentioned in my previous post will "link" up to five trainers together. So the ASM will load one of those trainerbattles, and NOT the 0x75 trainerbattle. Each rematchable person has basically five trainerbattles associated with them.

Another thing I forgot to mention is that certain trainerbattles are "unlocked" after setting certain flags. For example, no trainers are rematchable until flag 0x292 is set. All rematchable trainers jump to the next level when flag 0x896 (Celadon City visited) is set. All rematchable trainers jump ANOTHER level when flag 0x897 (Fuschia City visited) is set. They jump a fourth level when flag 0x82C (E4 beaten) is set. And they reach their highest level once flag 0x844 (RSE Trading established) is set.
Wow, this is perfect, thank you! I think for my hack I'll just need to change when those flags are set, because I might keep the trainers on their own, but if I changed their Pokemon in Atrainer and just replaced their offset in their script so the new changes to heir party would apply, does this mean that the vs seeker will apply those changes to the party as well? Or would I have to make a whole new script for them?
And just to make sure I understand this, I would be putting the same trainer battle in the script, then setting flags for each and once the flag is set, it will pass the original battle and move on to the next unchecked flag? And does the rematch special in the script level up/evolve the pokemon when you fight them later? Meaning you don't have to make five seperate trainers for the same battle.
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
Wow, this is perfect, thank you! I think for my hack I'll just need to change when those flags are set, because I might keep the trainers on their own, but if I changed their Pokemon in Atrainer and just replaced their offset in their script so the new changes to heir party would apply, does this mean that the vs seeker will apply those changes to the party as well? Or would I have to make a whole new script for them?
And just to make sure I understand this, I would be putting the same trainer battle in the script, then setting flags for each and once the flag is set, it will pass the original battle and move on to the next unchecked flag? And does the rematch special in the script level up/evolve the pokemon when you fight them later? Meaning you don't have to make five seperate trainers for the same battle.

The upping of the levels isn't automatic...the levels being "upped" is actually you fighting a completely different trainer, with the same party, just with higher leveled Pokemon.

For example, open up a clean Firered ROM in A-trainer. Navigate to trainer number 0x092...Named Jeff, and has a Level 16 Spearow and a Level 16 Raticate. Now navigate to battle number 0x273...Named Jeff, with a Level 21 Spearow and a Level 21 Raticate. Number 0x274 is also named Jeff, with a Level 29 Fearow and a Level 29 Raticate. Number 0x275 is ALSO named Jeff, with a Level 54 Fearow and a Level 54 Raticate. Even though the script doesn't explicitly call all four of those battles in the conventional sense, each of them is linked on the table I mentioned earlier. Meaning, the only way to edit the "linked" trainers is with a hex editor.

Also, the "rematch" trainer battle uses trainerbattle 0x5, and not trainerbattle 0x0. That's important.

JPANs hack engine has a nifty feature that allows you to change the levels of a battled Pokemon by setting a variable, and I plan to use this as an alternative to having five different trainers for each rematch.

To change which flags activate which levels, you only need to change the half-words at 0x10CCD8, 0x10CCE0, 0x10CCE8, 0x10CCF0, and 0x10CD10. Remember, they're reversed, so flag 0x0800 would be written as 00 08.
 
Last edited:

FrozenInfernoZX

What is out there?
756
Posts
11
Years
I am currently doing some scripting. Not wanting to waste free space I decided to start off by editing existing scripts (reusing their offsets to create entirely new events). If my new script is larger than the original script in terms of size, does the script editor automatically repoint the script to a place with free space or would other scripts/things in rom get overwritten?
 
1
Posts
11
Years
  • Seen May 26, 2013
Sorry if this has been asked before but I absolutely cannot find it. How can I edit the beginning talk with prof. Oak in FR/LG right when the game starts like when Oak asks what your name is, what your rival's name is, etc.
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
I am currently doing some scripting. Not wanting to waste free space I decided to start off by editing existing scripts (reusing their offsets to create entirely new events). If my new script is larger than the original script in terms of size, does the script editor automatically repoint the script to a place with free space or would other scripts/things in rom get overwritten?

Yes, it will overwrite the other scripts. That's why I'm a strong proponent of Rom Bases with every script removed. It gives you greater control of scripts and where they go, and you aren't limited to a pre-existing script size.

The SS is in the attachment.

Also, do you happen to know which palette you used while editing this?

Sorry if this has been asked before but I absolutely cannot find it. How can I edit the beginning talk with prof. Oak in FR/LG right when the game starts like when Oak asks what your name is, what your rival's name is, etc.

Using Advance Text will allow you to edit the dialogue. Nothing but ASM will let you edit the intro itself.
 

FrozenInfernoZX

What is out there?
756
Posts
11
Years
Okay, so I currently have 6-7 scripts inserted to my first city. So I should be fine as long as keep scripting here on out? Such as not reusing any other scripts and just reusing the offsets? (By offsets, I mean that box you put the $ number in Advance Map).

Or just delete all the scripts in the game, (manually through each map). The thing is that if all the existed scripts are deleted, and I want to reuse the offset, where would I be able to find the offset? Or when deleting a script through advance map, does the script turn into freespace?
 
115
Posts
12
Years
  • Seen Dec 30, 2012
When I try to open my APIE I'm told that the INIs are not compatible. Can anyone help?
I'm hacking fire red so it should be BPRE right? I've gone down my list of all my INIs and none of them are supposedly compatible with my ROMs.

To be more specific my error message is "the ROM is not compatible with any files in the INIs folder"
 
Last edited:

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
Okay, so I currently have 6-7 scripts inserted to my first city. So I should be fine as long as keep scripting here on out? Such as not reusing any other scripts and just reusing the offsets? (By offsets, I mean that box you put the $ number in Advance Map).

Or just delete all the scripts in the game, (manually through each map). The thing is that if all the existed scripts are deleted, and I want to reuse the offset, where would I be able to find the offset? Or when deleting a script through advance map, does the script turn into freespace?

Deleting scripts can be done a few ways. Open XSE and do one of the following:

1. #removeall 0xOFFSET. This will completely delete a single script from the game, turning the space it occupied into 0xFF. This includes strings, Pokemart data, applymovement data, goto and call commands.

2. #remove 0xOFFSET. This will delete one part of a script: Basically, just the commands. Strings, Pokemart data, applymovement data, and scripts that are called via "goto" or "call" are preserved for future use.

Note: #removemart, and #removemove also exist. They remove Pokemart data and Applymovement data, respectively.

3. #erase 0xOFFSET 0xLENGTH. This will take the bytes starting at 0xOFFSET, and ending LENGTH bytes from that offset, and turn it into free space. Example: #erase 0x800000 0x5 will erase 0x800000, and the five bytes after it.

4. #eraserange 0xOFFSET1 0xOFFSET2. This will take the bytes between OFFSET1 and OFFSET2 and turn it into free space. Example: #eraserange 0x800000 0x900000 will erase everything between 0x800000 and 0x900000.
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
If I knew the pallette, I would change with APE and fix it to normal colors.

The badges' palette is odd...when I tried to use other colors besides the first five, the game would crash when I opened the trainer card. Be careful if you do edit the palette...it might cause similar pitfalls. Make a backup, of course, and if the game does do something crazy, you'll just have to use the old palette.

Anyway, the palette is either at 0x3CD2C0 or0x3CD2E0. Both of the palettes at these offsets are identical, so there's nothing I can do to determine which is the right one. Just try both and see what you get.

Okay, I used it. And now the script has a bunch of #raw 0xFF. Then the old script is all the way at the bottom. Is that normal?

The commands I gave you fill the space occupied by the script with 0xFFs. They would be interpreted as #raw 0xFFs by XSE if you tried to decompile them like a script. So yes, it is normal.

Actually, which of the four did you use? When I use #removeall, nothing shows up at all when I decompile the script.
 
Last edited:

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
Okay, and when looking for freespace, how do I know how much to look for? The default in pksv is 0x100. Thanks for the help by the way.

Just use dynamic offsets...no need to look for free space, since XSE will do it automatically. As for the people who use the free space finder to find offsets, and then take those offsets and use them for dynamic offsets, you're wasting your time. Just being every script with #dynamic 0x800000...its less work for everyone :)
 
115
Posts
12
Years
  • Seen Dec 30, 2012
Oh, I figured it out. In case anyone else was wondering how to fix this you just have to reinstall the INIs that come with the main program.
 

FrozenInfernoZX

What is out there?
756
Posts
11
Years
Thanks alot man. I appreciate it. I am starting to get the hang of things. Almost finished my first town with fully functional events!

Edit - Quick question. What exactly does setvar do?
 
Last edited:

Renegade

Time for real life...
995
Posts
12
Years
I have a question. Does anyone know if there is any limit to how many scripts you can assign to one map? Or is it basically infinite?
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
I have a question. Does anyone know if there is any limit to how many scripts you can assign to one map? Or is it basically infinite?

As far as I can tell, the theoretical max for each type of script (Person, script, or signpost) is 255 per. However, only 16 person events can be displayed at a given time on a given screen. Otherwise, I think that's it...although it'd probably lag if you put that many scripts on a map.
 
Status
Not open for further replies.
Back
Top