The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script How to fix an error with dynamic pokemon expansion?

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old April 10th, 2021 (1:07 PM). Edited April 10th, 2021 by DevidraGaming.
DevidraGaming's Avatar
DevidraGaming DevidraGaming is offline
 
Join Date: Mar 2021
Posts: 17
I've been working on expanding the pokedex for my hack, and I've encountered an error I'm not quite sure how to fix.
Error:
Spoiler:
Finding free space...
Repointing base_stats to offset 0xe5633c
Repointing poke_front_img to offset 0xe5cb78
Repointing poke_back_img to offset 0xe5e940
Repointing poke_sprite_pal to offset 0xe60708
Repointing shiny_sprite_pal to offset 0xe624d0
Repointing icon_img to offset 0xe64298
Repointing icon_pal to offset 0xe6517c
Repointing poke_names to offset 0xe65535
Traceback (most recent call last):
File "C:\Users\devid\Desktop\Pokemon Romhack\PokeExpansion-master\PokeExpansion-master\scripts\expansion.py", line 314, in <module>
offset = repoint_table(rom, offset, i)
File "C:\Users\devid\Desktop\Pokemon Romhack\PokeExpansion-master\PokeExpansion-master\scripts\expansion.py", line 228, in repoint_table
genIV_V_VI_names = open("scripts//new_names.bin", 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'scripts//new_names.bin'

It's giving me the error despite the new_names.bin file being in the same folder, so I'm not quite sure what to do. I've tried it with changing the names enabled and disabled, and it gives the same error each time. Do i maybe need to change the free space, or what should I do?

Edit: Figured out the problem, it was looking for a file named scripts//new_names.bin rather than just new_names.bin

Edit 2: How can I edit pokemon added through the expander? PGE crashes when attempting to load anything repointed by the expansion, and I get this error when I try to load then Pokemon editor.
Spoiler:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: InvalidArgument=Value of '65535' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at PokemonGameEditor.Pokemonedit.Baseload()
at PokemonGameEditor.Pokemonedit.PKMNames_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at PokemonGameEditor.Pokemonedit.Pokemonedit_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
PokemonGameEditor
Assembly Version: 3.8.1.0
Win32 Version: 3.8.1.0
CodeBase: file:///C:/Users/devid/Desktop/Pokemon%20Romhack/PGE/PokemonGameEditor.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Also, on the expanded rom, cries of pokemon that already exist don't play at all. That's the only other thing I've noticed.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old April 10th, 2021 (2:22 PM).
Meister_anon~Master_o f_None Meister_anon~Master_o f_None is offline
 
Join Date: Dec 2020
Posts: 852
Quote:
Originally Posted by DevidraGaming View Post
I've been working on expanding the pokedex for my hack, and I've encountered an error I'm not quite sure how to fix.


Edit 2: How can I edit pokemon added through the expander? PGE crashes when attempting to load anything repointed by the expansion, and I get this error when I try to load then Pokemon editor.
you can edit the added pokemon through the files in dpe before you compile, or you can use a hex editor like Hex Maniac Advance to edit their values after you've already compiled.

The latter option also works for edits after you've applied cfru.

*using HMA will probably require a little setup to make all the values correctly formatted in the program, but it works well for most things.
__________________
The A-non Team




Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Rapidash
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Flareon
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Roselia
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Entei
Hatch @ 793
Level 100 @ 1,018
Shiny: No
Points: 100

Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old April 10th, 2021 (2:32 PM). Edited April 10th, 2021 by Tacobell24.
Tacobell24's Avatar
Tacobell24 Tacobell24 is offline
 
Join Date: Nov 2018
Posts: 232
I'm not sure how to fix the error, but can I ask why you need PGE at all if you're using the DPE?
__________________
Praise the Solrock
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old April 10th, 2021 (2:38 PM).
DevidraGaming's Avatar
DevidraGaming DevidraGaming is offline
 
Join Date: Mar 2021
Posts: 17
Quote:
I'm not sure how to fix the error, but can I ask why you need PGE at all you're using the DPE?
The expansion doesn't give you an option to edit the individual pokemon (At least that I've found, the one I got was here - https://www.pokecommunity.com/showthread.php?t=380296), so I'd need a separate program to actually edit the pokemon that the expansion adds
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old April 10th, 2021 (2:41 PM). Edited April 10th, 2021 by DevidraGaming.
DevidraGaming's Avatar
DevidraGaming DevidraGaming is offline
 
Join Date: Mar 2021
Posts: 17
Quote:
Originally Posted by Meister_anon~Master_o f_None View Post
you can edit the added pokemon through the files in dpe before you compile, or you can use a hex editor like Hex Maniac Advance to edit their values after you've already compiled.

The latter option also works for edits after you've applied cfru.

*using HMA will probably require a little setup to make all the values correctly formatted in the program, but it works well for most things.
How would I use HMA to edit the pokemon? I know how to edit the sprites through HMA but I don't know how to edit anything else

Also, sorry if I seem kind of dumb here, I'm still fairly new to romhacks, but what is cfru?
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old April 10th, 2021 (2:46 PM).
Meister_anon~Master_o f_None Meister_anon~Master_o f_None is offline
 
Join Date: Dec 2020
Posts: 852
Quote:
Originally Posted by DevidraGaming View Post
How would I use HMA to edit the pokemon? I know how to edit the sprites through HMA but I don't know how to edit anything else
depends on what you're trying to do. you can change abilities, stats, names, other data in the stats table.

learnsets, tutor moves, egg moves, tmhm compatability etc.

what kind of thing are you trying to do?


after you expand with dpe cfru, some fields may disappear from hma, but you can get them back by editing your .toml file with the updated address and formatting information.
but I haven't used it in a while, so newer versions may handle the change easier. but if a table or something is missing compared to a vanilla rom, the method
above will work.
__________________
The A-non Team




Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Rapidash
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Flareon
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Roselia
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Entei
Hatch @ 793
Level 100 @ 1,018
Shiny: No
Points: 100

Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old April 10th, 2021 (2:48 PM).
Tacobell24's Avatar
Tacobell24 Tacobell24 is offline
 
Join Date: Nov 2018
Posts: 232
But I thought part of adding them was adding their data to the various tables.

Like the base stats, learnsets and whatever.

I.e. you should just be able to copy existing entries and modify them in the samw format.
__________________
Praise the Solrock
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old April 10th, 2021 (3:04 PM).
DevidraGaming's Avatar
DevidraGaming DevidraGaming is offline
 
Join Date: Mar 2021
Posts: 17
Quote:
Originally Posted by Meister_anon~Master_o f_None View Post
depends on what you're trying to do. you can change abilities, stats, names, other data in the stats table.

learnsets, tutor moves, egg moves, tmhm compatability etc.

what kind of thing are you trying to do?


after you expand with dpe cfru, some fields may disappear from hma, but you can get them back by editing your .toml file with the updated address and formatting information.
but I haven't used it in a while, so newer versions may handle the change easier. but if a table or something is missing compared to a vanilla rom, the method
above will work.
I want to add the gen 4-8 mons as well as some of my own. The expander adds more than enough to do that, I just don't know how to edit them

Quote:
Originally Posted by Tacobell24 View Post
But I thought part of adding them was adding their data to the various tables.

Like the base stats, learnsets and whatever.

I.e. you should just be able to copy existing entries and modify them in the samw format.
Where would I find the files to edit if I was going to edit them that way then? I've looked through the expansion files and I can't find anything that seems like I could edit to change actual pokemon
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old April 10th, 2021 (3:18 PM).
Tacobell24's Avatar
Tacobell24 Tacobell24 is offline
 
Join Date: Nov 2018
Posts: 232
The src folder has most of the stuff.

Just so I'm clear on what you're tyobg to do, are you expanding the Dex with 'mons beyond the ones already included, or just like with up to Gen VII or VIII mons?
__________________
Praise the Solrock
Reply With Quote
  #10   Link to this post, but load the entire thread.  
Old April 10th, 2021 (3:39 PM).
DevidraGaming's Avatar
DevidraGaming DevidraGaming is offline
 
Join Date: Mar 2021
Posts: 17
Quote:
Originally Posted by Tacobell24 View Post
The src folder has most of the stuff.

Just so I'm clear on what you're tyobg to do, are you expanding the Dex with 'mons beyond the ones already included, or just like with up to Gen VII or VIII mons?
I want to go beyond, but only up to the 999 limit, so not too many extra
Reply With Quote
  #11   Link to this post, but load the entire thread.  
Old April 10th, 2021 (6:01 PM).
Meister_anon~Master_o f_None Meister_anon~Master_o f_None is offline
 
Join Date: Dec 2020
Posts: 852
ok gotcha, so here's what you need to do. DPE alone will add the gen 4-8 pokemon, as well as remove the sprite limit that prevents adding more from base game.

now to add custom pokemon, you need to pretty much follow this guide.
https://github.com/pret/pokeemerald/wiki/How-to-add-a-new-Pok%C3%A9mon-species

but that's for decomp so a few things are slightly different. but for the most part I'm sure you should be able to figure what's what.

once you have the important stuff, (i.e front sprite, back sprite, icon sheet, & palette [just copy one from an existing similar colored pokemon should work] )
into dpe, it should build and from there you can add the rest in HMA.

oh don't forget to adjust the species names, file as well. that's really important.

Once the graphics and number of names are setup, you should be able to see the new pokemon in the base stats table.

in HMA you use ctrl G, to bring up the goto menu, and from there you can get anywhere you need to, either by typing in, or clicking the buttons pyramid till you get what you want.

from the stats table you'll be able to edit/add whatever you need to for the pokemon.
Screenshot (1091).png
Screenshot (1090).png
__________________
The A-non Team




Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Rapidash
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Flareon
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Roselia
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Entei
Hatch @ 793
Level 100 @ 1,018
Shiny: No
Points: 100

Reply With Quote
  #12   Link to this post, but load the entire thread.  
Old April 10th, 2021 (6:06 PM).
Meister_anon~Master_o f_None Meister_anon~Master_o f_None is offline
 
Join Date: Dec 2020
Posts: 852
Quote:
Originally Posted by DevidraGaming View Post
I want to add the gen 4-8 mons as well as some of my own. The expander adds more than enough to do that, I just don't know how to edit them



Where would I find the files to edit if I was going to edit them that way then? I've looked through the expansion files and I can't find anything that seems like I could edit to change actual pokemon
forgot to quote so you get an alert, but check my message above. just in case you missed it I gave some likes too.

anyway that should solve your problem.
__________________
The A-non Team




Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Rapidash
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Flareon
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Roselia
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Entei
Hatch @ 793
Level 100 @ 1,018
Shiny: No
Points: 100

Reply With Quote
  #13   Link to this post, but load the entire thread.  
Old April 10th, 2021 (8:56 PM).
DevidraGaming's Avatar
DevidraGaming DevidraGaming is offline
 
Join Date: Mar 2021
Posts: 17
Quote:
Originally Posted by Meister_anon~Master_o f_None View Post
ok gotcha, so here's what you need to do. DPE alone will add the gen 4-8 pokemon, as well as remove the sprite limit that prevents adding more from base game.

now to add custom pokemon, you need to pretty much follow this guide.
https://github.com/pret/pokeemerald/wiki/How-to-add-a-new-Pok%C3%A9mon-species

but that's for decomp so a few things are slightly different. but for the most part I'm sure you should be able to figure what's what.
Thanks for your help! I'm working on some other things tonight but I'll be sure to check that out tomorrow!
Reply With Quote
  #14   Link to this post, but load the entire thread.  
Old April 12th, 2021 (9:03 PM).
Meister_anon~Master_o f_None Meister_anon~Master_o f_None is offline
 
Join Date: Dec 2020
Posts: 852
Quote:
Originally Posted by DevidraGaming View Post
I've been working on expanding the pokedex for my hack,
Hey just remembered I wrote an entire tutorial covering how to adjust HMA to read DPE CFRU created roms.
So here.

https://www.pokecommunity.com/showthread.php?p=10272555#post10272555
__________________
The A-non Team




Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Rapidash
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Flareon
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Roselia
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Entei
Hatch @ 793
Level 100 @ 1,018
Shiny: No
Points: 100

Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:17 AM.