• 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?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

[EM] Battle Engine Upgrade (On Halt, Will undergo reboot!)

Status
Not open for further replies.

Trainer 781

Guest
0
Posts
Thank you so much for these ressources Dizzyegg and KDS, its amazing!

One question about the learnsets. I see gen 4-6 pokemon learnsets commented out in the learnsets.c file, would removing the comments and adding the expanded pokemon names make the script automagically give them the correct moves? Thanks in advance

Yes, but additionally you need to edit line 1493 to add the proper references to the master learn set tablel while following the pokemon index order accounting for unknown/limbo slots as well.
For example,
Code:
&CHIMECHO_MOVESET[0], &EMPTY_MOVESET[0], &EMPTY_MOVESET[0], &TURTWIG_MOVESET[0]
 
794
Posts
10
Years
Quick Update

Fixed a couple of bugs(full list in the github commit's description) and made it possible to insert learnsets for expanded pokemon for gen4, gen5 and gen6. Also made it possible to not build learnsets at all.
 
131
Posts
9
Years
  • Age 22
  • Seen yesterday
Two issues to report:

Firstly, this occurred before the latest update, but I suspect it hasn't been fixed: Random trainers can have shinies. A trainer in my hack had a shiny Ledyba; he did not have the shiny Ledyba when I reset and rebattled him, it was only the one time. This is probably something that should be fixed just for the sake of people not raging when they encounter a trainer with a shiny they can't catch.

Secondly, the game seems to crash upon entering battle if you haven't built the learnsets. It works fine if you build them (I added the data at 0x1000000) but without them it doesn't seem to work.
 

Wesley FG

Pokémon Kalos Advance !! Gba Hack
338
Posts
15
Years
Quick Update

Fixed a couple of bugs(full list in the github commit's description) and made it possible to insert learnsets for expanded pokemon for gen4, gen5 and gen6. Also made it possible to not build learnsets at all.

i not understand why but the old version works fine for me,

but this update the mega evolution animation has completly bugged and crash the game,
and when you execute script PGEinidump.py, occur error in line 60 "file not found" learnsetcathy r (something like this)

the only think i make diferent is insert expansion first and used it again for make learnset work 4-6 gen.
 
794
Posts
10
Years
Two issues to report:

Firstly, this occurred before the latest update, but I suspect it hasn't been fixed: Random trainers can have shinies. A trainer in my hack had a shiny Ledyba; he did not have the shiny Ledyba when I reset and rebattled him, it was only the one time. This is probably something that should be fixed just for the sake of people not raging when they encounter a trainer with a shiny they can't catch.

Secondly, the game seems to crash upon entering battle if you haven't built the learnsets. It works fine if you build them (I added the data at 0x1000000) but without them it doesn't seem to work.

1. Shiny issue is probably because of competitive trainers feature from the various features.
2. It will crash if the learnsets aren't in your game or you overwrote them while updating the engine.

i not understand why but the old version works fine for me,

but this update the mega evolution animation has completly bugged and crash the game,
and when you execute script PGEinidump.py, occur error in line 60 "file not found" learnsetcathy r (something like this)

the only think i make diferent is insert expansion first and used it again for make learnset work 4-6 gen.

Both thing should be fixed with the latest version.

Another (maybe not so)small update
Added pokemon animating after mega evolution.
Made it possible to force a specific background for a battle.
And added a new feature which is trainers saying stuff in the middle of a battle. Currently you can make your trainer say something when:
- first pokemon is down
- last pokemon is sent out
- last pokemon is at low health
Example screenshots:
XWNRm56.png
test_01.png

Will provide instructions on how to use that soon.
 

Wesley FG

Pokémon Kalos Advance !! Gba Hack
338
Posts
15
Years
1. Shiny issue is probably because of competitive trainers feature from the various features.
2. It will crash if the learnsets aren't in your game or you overwrote them while updating the engine.



Both thing should be fixed with the latest version.

Another (maybe not so)small update
Added pokemon animating after mega evolution.
Made it possible to force a specific background for a battle.
And added a new feature which is trainers saying stuff in the middle of a battle. Currently you can make your trainer say something when:
- first pokemon is down
- last pokemon is sent out
- last pokemon is at low health
Example screenshots:
XWNRm56.png
test_01.png

Will provide instructions on how to use that soon.

thanks and awesome new updates,
i really like to test it, plz make the instructions for use it.
 
1,085
Posts
14
Years
  • Age 23
  • Seen Aug 26, 2023
Dizzy asked me to write a post on how to use some of the new features recently implemented into the battle engine, such as trainer slide-in messages and customizable battle backgrounds. Here is a post describing how to use the new features!

-Trainer Slide In Messages

Trainers can now have slide-in messages! One that plays when the first Pokémon is knocked
out, one that plays when the last opposing Pokémon is sent out, and finally, one that plays
when the final opposing Pokémon is on red health (Only for trainers more than one Pokémon!)
To configure this, you'll need to go to the "src\trainer_msg_sliding.c" directory.
(I recommend using Notepad++ to edit these files!)

Now, inside, you'll see this:
Spoiler:


Now, under "struct trainer_slide_info sliding_trainers[NO_OF_SLIDING_MSG_TRAINERS]" (on line 11),
you'll see this:

"{0, 0, NULL, NULL, NULL},"

As you can see, there are five parameters here.
You can make more of these "entries" just below this one, for more trainers with sliding messages.

The first parameter is for the trainer's ID.
To find the trainer's ID, you can use a program such as Hopeless Trainer Editor or G3T.

The next parameter does not need to be edited for now.

The third parameter, which is the first "NULL", is the pointer to the text which will occur when the last
Pokémon is sent out. Now, this should be replaced with a pointer to your offset with the compiled text.
You can compile the text using a program like XSE, and when it compiles, note the offset.
The "NULL" parameter should be replaced into something like this: "(void*)(0x08XXXXXX)"
The XXXXXX being the offset to your compiled text.
(Note, if your compiled text is in data above 16MB (0x1000000 and above) you'll need to use
the "0x09" prefix instead of "0x08" for the pointer to the text.

The fourth parameter works similarly to the third, however it's displayed for the slide-in when the last Pokémon
for the trainer is on red health.

And finally, the fifth parameter is once again similar, displayed after the first Pokémon is knocked out.

-------

-Customizable Battle Backgrounds

The battle backgrounds can now be customized in any battle! For example, you can load an indoors battle background
in an outside map, and a grassy battle background indoors. It can all be done in a script using XSE.
For example:

In a XSE script, before the trainerbattle command, you'll need to use the writebytetooffset command.
You'll also need a list of IDs for each battle background. Here they are (in the spoiler below):

Spoiler:


Now, you can use writebytetooffset in XSE like this:
"writebytetooffset [ID OF BG] [OFFSET TO WRITE BYTE TO]"

So for example, if I wanted a background to be Team Aqua (ID of "18") in a battle, before the battle I would
have this:

"writebytetooffset 19 0x2022FF1"

As you can see, I have used "19" instead of "18". This is because you'll need to add +1 to the ID when using the command.
So, for example, 22 (Elite Four Drake) would have to be: "writebytetooffset 23 0x2022FF1".

Now the reason why "0x2022FF1" is the offset we are writing to, is because it is where the byte is stored to decide
what battle background will be used in the next battle.
Once the battle is over, the battle background will reset to the default in that map/area.

Test it, and it should work in-game!

-------

If you want to add new battle backgrounds to the ID list, here's what you'd do:

Spoiler:

 
Last edited:

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
1. Shiny issue is probably because of competitive trainers feature from the various features.
2. It will crash if the learnsets aren't in your game or you overwrote them while updating the engine.



Both thing should be fixed with the latest version.

Another (maybe not so)small update
Added pokemon animating after mega evolution.
Made it possible to force a specific background for a battle.
And added a new feature which is trainers saying stuff in the middle of a battle. Currently you can make your trainer say something when:
- first pokemon is down
- last pokemon is sent out
- last pokemon is at low health
Example screenshots:
XWNRm56.png
test_01.png

Will provide instructions on how to use that soon.

You monster now I have to make second frames for the megas LOL
 
16
Posts
6
Years
  • Age 28
  • Seen Aug 7, 2017
I have some quetions about this. How to use the inbattle form change ? what's the meaning of the form index defined in config.h? And ILLUSION can not work well.
 
794
Posts
10
Years
Big Update

You can customize partner tag battles by choosing the partner's sprite, partner pokemon, opponents and the battle type. You can also (similarly to a battle background) set the player back sprite to the one you want. Adding more battle back sprites is now easy as you just provide a pointer to the table. All that will be soon explained in detail.

Here's a screenshot:
Spoiler:


Also fixed Mud&Water Sport and made Embargo forbid you from using items from bag on an affected pokemon. Sadly, no one cares about these moves :/
 
Last edited:
16
Posts
10
Years
  • Age 29
  • USA
  • Seen Aug 30, 2022
Pardon me if I somehow missed an answer to this problem I'm having. Also know that I have no experience with python.
Now then..
After digging through this thread, uninstall and reinstalling python, downloading and trying the PGE ini that KDS linked in this thread pages back, downloading and replacing PGEinidump.py and finally trying the PGE 3.8 ini, I can not for the life of me get a working PGE ini for this battle engine to generate properly.

This is the current issue I am facing:
[S-HIGHLIGHT] File "scripts\PGEinidump.py", line 7
<!DOCTYPE html>
^
SyntaxError: invalid syntax[/S-HIGHLIGHT]

Before this error that I am now getting with the replaced PGEinidump.py, I was having a unicode error pop up but now that seems to have been corrected (knock on wood :P ).
 
794
Posts
10
Years
Pardon me if I somehow missed an answer to this problem I'm having. Also know that I have no experience with python.
Now then..
After digging through this thread, uninstall and reinstalling python, downloading and trying the PGE ini that KDS linked in this thread pages back, downloading and replacing PGEinidump.py and finally trying the PGE 3.8 ini, I can not for the life of me get a working PGE ini for this battle engine to generate properly.

This is the current issue I am facing:
[S-HIGHLIGHT] File "scripts\PGEinidump.py", line 7
<!DOCTYPE html>
^
SyntaxError: invalid syntax[/S-HIGHLIGHT]

Before this error that I am now getting with the replaced PGEinidump.py, I was having a unicode error pop up but now that seems to have been corrected (knock on wood :P ).

Download the latest version from github, build the engine then the same way you did 'python scripts/make.py' you do 'python scripts/PGEinidump.py'. If that doesnt work, can you show me what the console output is?

EDIT2:
Try again, I made some small changes to the PGEinidump.py file.
 
Last edited:
16
Posts
10
Years
  • Age 29
  • USA
  • Seen Aug 30, 2022
Download the latest version from github, build the engine then the same way you did 'python scripts/make.py' you do 'python scripts/PGEinidump.py'. If that doesnt work, can you show me what the console output is?

I am using the latest version.
CFayMK1.png


Edit: Here is the error I get if I use the included PGEinidump.py in the full github folder:
zMTnz02.png

The first, other error is from me downloading only the PGEinidump.py from the github and replacing the one that comes in the master-folder.

Edit2: Don't wanna spam the thread with images, taken to messages.
 
Last edited:
131
Posts
9
Years
  • Age 22
  • Seen yesterday
Emerald_Advanced_026.png


I believe Electro Ball's animation is broken, because, uh. This happened. The particles consistently mess up when this move is used until the screen is refreshed. Note that as far as I can tell the attack itself functions fine, it's just that the animation does weird things with the graphics.
 
794
Posts
10
Years
Emerald_Advanced_026.png


I believe Electro Ball's animation is broken, because, uh. This happened. The particles consistently mess up when this move is used until the screen is refreshed. Note that as far as I can tell the attack itself functions fine, it's just that the animation does weird things with the graphics.

Are you sure you're using the latest update? I'm sure I fixed it two days ago.
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
Help~ I'm getting an error. I don't follow much but at the end of the error in cmd, it says "Access is denied." Here's a screenshot of the error.
QyPmMMg.png

I tried using both devkit r45 and r46 just to be sure. Both threw me those errors.
 

Trainer 781

Guest
0
Posts
Help~ I'm getting an error. I don't follow much but at the end of the error in cmd, it says "Access is denied." Here's a screenshot of the error.
QyPmMMg.png

I tried using both devkit r45 and r46 just to be sure. Both threw me those errors.

Try running command prompt as an admin.
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
Try running command prompt as an admin.
Same thing happened even after running as admin.

If it helps, my Python is 3.6 64-bit. My system is 64-bit. I typed "python scripts//make.py" as stated in the github repo but also tried "python scripts//build.py". When I installed devkit, I added it to PATH and changed the slashes to correct it. Python is also in my PATH. I think I've stated everything so far? :/ I'm so dumbfounded now.

EDIT: Crap. So turns out, I should have NOT added devkit to PATH. -.- Okay now. Everything is assembling fine. Sorry for the troubles.
 
16
Posts
6
Years
  • Age 28
  • Seen Aug 7, 2017
sorry for bothering again. Recent days I meet some bugs after the new update.
1.The move animation of petal blizzard and feint attack will cause the ROM crash
2.The Primal Reversion doesn't have a animation and the pokemon can't change its form when the battle start but after I change the game interface it changes
3.When in a double battle , the move discharge will cause the ROM crash after the foe swaps his pokemon if I use this move to beat down my other pokemon and one of the foe's.
4.When I use the history vesion, I can connect to friends to battle.But now only the exchange can work well, the link battle will cause the game crash. Thanks.
 
Last edited:

Trainer 781

Guest
0
Posts
sorry for bothering again. Recent days I meet some bugs after the new update.
1.The move animation of petal blizzard and feint attack will cause the ROM crash
2.The Primal Reversion doesn't have a animation and the pokemon can't change its form when the battle start but after I change the game interface it changes
3.When in a double battle , the move discharge will cause the ROM crash after the foe swaps his pokemon if I use this move to beat down my other pokemon and one of the foe's.
4.When I use the history vesion, I can connect to friends to battle.But now only the exchange can work well, the link battle will cause the game crash. Thanks.

No need to be sorry. Thanks for reporting, we'll look into these.
 
Status
Not open for further replies.
Back
Top