The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script How to fix an error with dynamic pokemon expansion? (https://www.pokecommunity.com/showthread.php?t=448473)

DevidraGaming April 10th, 2021 1:07 PM

How to fix an error with dynamic pokemon expansion?
 
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.

Meister_anon~Master_o f_None April 10th, 2021 2:22 PM

Quote:

Originally Posted by DevidraGaming (Post 10334688)
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.

Tacobell24 April 10th, 2021 2:32 PM

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?

DevidraGaming April 10th, 2021 2:38 PM

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

DevidraGaming April 10th, 2021 2:41 PM

Quote:

Originally Posted by Meister_anon~Master_o f_None (Post 10334748)
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?

Meister_anon~Master_o f_None April 10th, 2021 2:46 PM

Quote:

Originally Posted by DevidraGaming (Post 10334758)
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.

Tacobell24 April 10th, 2021 2:48 PM

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.

DevidraGaming April 10th, 2021 3:04 PM

Quote:

Originally Posted by Meister_anon~Master_o f_None (Post 10334761)
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 (Post 10334763)
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

Tacobell24 April 10th, 2021 3:18 PM

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?

DevidraGaming April 10th, 2021 3:39 PM

Quote:

Originally Posted by Tacobell24 (Post 10334778)
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

Meister_anon~Master_o f_None April 10th, 2021 6:01 PM

2 Attachment(s)
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.
Attachment 96591
Attachment 96592

Meister_anon~Master_o f_None April 10th, 2021 6:06 PM

Quote:

Originally Posted by DevidraGaming (Post 10334769)
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.

DevidraGaming April 10th, 2021 8:56 PM

Quote:

Originally Posted by Meister_anon~Master_o f_None (Post 10334820)
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!

Meister_anon~Master_o f_None April 12th, 2021 9:03 PM

Quote:

Originally Posted by DevidraGaming (Post 10334688)
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


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


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.