PHO - Pokémon Hackers Online
Go Back   PHO - Pokémon Hackers Online > Other Generations Hacking > Guides & Documentation

Guides & Documentation Learn how to make your own Pokémon game through the process of ROM Hacking, or help out the community by sharing your information.

Reply
 
Thread Tools Display Modes
Old 14th July 2017, 06:23 PM   #1
Javi4315♪
n00b
 
Javi4315♪'s Avatar
 
Join Date: Mar 2012
Age: 23
Posts: 4
Javi4315♪ is on a distinguished road
Default [FR] Continue after losing a battle

This routine allows you to continue running the script (in the case of a trainerbattle) or playing (in the case of a wildbattle) after losing with no white out. It is quite simple, just follow the steps!

Step 1:

First, open your favourite hex editor (I recommend HxD) and search for a free space. You will need 64 (0x40) bytes. Make sure that the offset you choose ends in 0, 4, 8 or C. Write down the offset!

Step 2:

Now, we are going to insert the routine that I wrote:

Quote:
push {r0,r2}
nop @just to align
ldr r2, sub_var_8000
mov r0, #0x1
strh r0, [r2] @var 0x8000 = 0x1 // Means you have lost the battle for scripting porpouses
ldr r0, =(0x00000203) @Flag that controls the system // You can change it
ldr r2, sub_flag_decrypt
bl sub_call
cmp r0, #0x1
beq sub_flag_on
pop {r0,r2}
mov r0, #0x1 @Original response
pop {r1}
bx r1

sub_flag_on:
ldr r0, =(0x080A0059) @Heal the party
bl sub_call_2
pop {r0, r2}
mov r0, #0x0 @Hacked response
pop {r1}
bx r1

sub_call:
bx r2

sub_call_2:
bx r0

sub_flag_decrypt: .word 0x0806E6D1
sub_var_8000: .word 0x020370B8
And this is the code:

Quote:
05 B4 C0 46 0B 4A 01 20 10 80 0B 48 08 4A 00 F0 0D F8 01 28 03 D0 05 BC 01 20 02 BC 08 47 07 48 00 F0 05 F8 05 BC 00 20 02 BC 08 47 10 47 00 47 D1 E6 06 08 B8 70 03 02 03 02 00 00 59 00 0A 08
That in bold is the flag (in reverse) that controls the system. Feel free to change it for any other flag.

Step 3:

Insert the code on the offset you chose in step 1. Then, add a "08" to that offset and reverse it. For example, if you chose the offset 904000, do this:

904000 => 08904000 => 08 90 40 00 => 00 40 90 08

Now, you have make your offset into a pointer. Write it down!

Step 4:

Go to the following offset: 0x800EC

You will find the same pointer to times in a row:

Quote:
04 01 08 08 04 01 08 08
Replace them with your pointer two times too. For example, if your pointer is 00 40 90 08, you have to write this:

Quote:
00 40 90 08 00 40 90 08
Now, you have inserted the system.

Understanding how it works:

It is quite easy. You have chosen a flag, in my case the flag 0x203.

If the flag is deactivated, the system won't be working. That means that if you lose a battle, you will be whited out as usual.

If the flag is activated, the system will be working. That means that if you lose a battle, you won't be whited out and will continue playing. In this case, var 0x8000 will be set to 0x1, that will allow you to know that you have lost the battle. So, if you want to do a trainerbattle that you can lose, add a "setvar 0x8000 0x0" before the trainerbattle command.

You have to make your script like this:

Quote:
(...)
setvar 0x8000 0x0
trainerbattle (config) //you can use any type of trainerbattle
compare 0x8000 0x1
if 0x1 goto @youlost
(here what happens if you win)

#org @youlost
(here what happens if you lose)
Example:

I am spanish, so I made a tutorial in spanish that you won't be able to follow if you don't speak spanish. But you can go to the minute 11:54 if you want to see a video example of the system working.

Javi4315♪ is offline   Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes

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. The time now is 06:05 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc. User Alert System provided by Advanced User Tagging (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo.
Pokémon Hackers Online (PHO) is in no way affiliated with or endorsed by Nintendo LLC, Creatures, GAMEFREAK inc,
The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast.
All forum/site content (unless noted otherwise) and site designs are © 2006-2013 Pokémon Hackers Online (PHO).
Green Charizard Christos TreeckoLv100

"Black 2" by ARTPOP. Kyurem artwork by XOUS.

no new posts