• 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.

Bug when changing the Roaming Pokémon HEX

7
Posts
3
Years
  • Age 46
  • Seen Aug 6, 2022
Good morning together :)

I want to change the Roaming Pokémon and make Mew appear instead of one of the legendary dogs. Therefore I edit the hex variables from xF3,xF4 and xF5 to x97 an mentioned here: https://www.pokecommunity.com/showpost.php?p=8909304&postcount=757

It worked fine, now Mew on lvl 50 is roaming but you can't really fight against it because it flees right before you can do your first attack. Does anybody know how to fix that?
 
438
Posts
6
Years
  • Age 37
  • Seen Apr 20, 2024
Good morning together :)

I want to change the Roaming Pokémon and make Mew appear instead of one of the legendary dogs. Therefore I edit the hex variables from xF3,xF4 and xF5 to x97 an mentioned here: https://www.pokecommunity.com/showpost.php?p=8909304&postcount=757

It worked fine, now Mew on lvl 50 is roaming but you can't really fight against it because it flees right before you can do your first attack. Does anybody know how to fix that?

If you want roamers to not flee, you could probably accomplish that by changing the roaming ai script.
 
7
Posts
3
Years
  • Age 46
  • Seen Aug 6, 2022
Hey Anon, thanks for answering my question. There's only one detail missing in my first post. I'm working on the german firered version, and I couldn't found a decompiled version for the german firered, do you know an other way to fix the fleeing mew?
 
438
Posts
6
Years
  • Age 37
  • Seen Apr 20, 2024
Hey Anon, thanks for answering my question. There's only one detail missing in my first post. I'm working on the german firered version, and I couldn't found a decompiled version for the german firered, do you know an other way to fix the fleeing mew?
The same approach will work regardless of if you're decomp hacking or binary hacking, but it will likely be harder with binary hacking.
I don't know if there are any battle AI script editors for binary hacking, but if there aren't, you'll have to edit the script in hex. You can look at the decomp's macros to see what bytes each command corresponds with.

You'll of course need to find the script before you can edit it. You might locate it in the English rom by looking at the symbol map. You can then search for the byte sequence around that location to find it in the German version.

Obviously the easiest solution would be to hack the English rom instead, preferably with the decomp.
 
7
Posts
3
Years
  • Age 46
  • Seen Aug 6, 2022
Thanks for ya answer, but i tired an other way (a little bit)

The original AI Script in the english Fire Red is:
Code:
AI_Roaming::
	if_status2 AI_USER, STATUS2_WRAPPED, AI_Roaming_End
	if_status2 AI_USER, STATUS2_ESCAPE_PREVENTION, AI_Roaming_End
	get_ability AI_TARGET
	if_equal ABILITY_SHADOW_TAG, AI_Roaming_End
	get_ability AI_USER
	if_equal ABILITY_LEVITATE, AI_Roaming_Flee
	get_ability AI_TARGET
	if_equal ABILITY_ARENA_TRAP, AI_Roaming_End

I changed to:
Code:
AI_Roaming::
	if_status2 AI_USER, STATUS2_WRAPPED, AI_Roaming_End
	if_status2 AI_USER, STATUS2_ESCAPE_PREVENTION, AI_Roaming_End
	get_ability AI_TARGET
	if_equal ABILITY_SHADOW_TAG, AI_Roaming_End
	get_ability AI_USER
	if_equal ABILITY_LEVITATE, [COLOR="Red"]AI_Roaming_End [/COLOR]
	get_ability AI_TARGET
	if_equal ABILITY_ARENA_TRAP, AI_Roaming_End

I compiled both versions and compared the HEX. The only difference between them is at x1DBCC8. The value changed from xD4 to xD5.

So i looked as the same structure in the german FireRed Version. I located the patterb at x1DFF60, as seen in the Screenshot (left the english version, right the german)

bildschirmfoto2022-08jnk6q.png


So if the changend and compiled english fire red version leads to a change from xD4 to xD5, I assume that i have to change in the german version the Value from x6C to x6D (to match the pattern). I changed it and checked the rom with a savegame just before I meet Ceilo with the saphire, which activates the romaing event). Mew on lvl 50 spawned, but again it flee :/

Maybe the change in the AI Roaming was wrong?
 
Last edited:
438
Posts
6
Years
  • Age 37
  • Seen Apr 20, 2024
Thanks for ya answer, but i tired an other way (a little bit)

The original AI Script in the english Fire Red is:
Code:
AI_Roaming::
	if_status2 AI_USER, STATUS2_WRAPPED, AI_Roaming_End
	if_status2 AI_USER, STATUS2_ESCAPE_PREVENTION, AI_Roaming_End
	get_ability AI_TARGET
	if_equal ABILITY_SHADOW_TAG, AI_Roaming_End
	get_ability AI_USER
	if_equal ABILITY_LEVITATE, AI_Roaming_Flee
	get_ability AI_TARGET
	if_equal ABILITY_ARENA_TRAP, AI_Roaming_End

I changed to:
Code:
AI_Roaming::
	if_status2 AI_USER, STATUS2_WRAPPED, AI_Roaming_End
	if_status2 AI_USER, STATUS2_ESCAPE_PREVENTION, AI_Roaming_End
	get_ability AI_TARGET
	if_equal ABILITY_SHADOW_TAG, AI_Roaming_End
	get_ability AI_USER
	if_equal ABILITY_LEVITATE, [COLOR="Red"]AI_Roaming_End [/COLOR]
	get_ability AI_TARGET
	if_equal ABILITY_ARENA_TRAP, AI_Roaming_End

I compiled both versions and compared the HEX. The only difference between them is at x1DBCC8. The value changed from xD4 to xD5.

So i looked as the same structure in the german FireRed Version. I located the patterb at x1DFF60, as seen in the Screenshot (left the english version, right the german)

bildschirmfoto2022-08jnk6q.png


So if the changend and compiled english fire red version leads to a change from xD4 to xD5, I assume that i have to change in the german version the Value from x6C to x6D (to match the pattern). I changed it and checked the rom with a savegame just before I meet Ceilo with the saphire, which activates the romaing event). Mew on lvl 50 spawned, but again it flee :/

Maybe the change in the AI Roaming was wrong?

The change you made prevents the roamer from fleeing IF it has levitate. Mew doesn't have levitate so it can still flee.
If you don't want the roamer to flee under any circumstances, you should change the script to:
Code:
AI_Roaming::
	end

But that would make the script shorter which won't work nicely with your binary hacking approach. Instead you might try replacing the "flee" command in the script with "end".
 
7
Posts
3
Years
  • Age 46
  • Seen Aug 6, 2022
The change you made prevents the roamer from fleeing IF it has levitate.

Ah okay thats the reason why it not worked ... Thanks now its pretty obvious

Now I changed it to
Code:
AI_Roaming::
	end

now I compiled and compared again the versions and spotted the difference. Again theres only one byte which has chaged. Luckily the roamer doesn't flee anymore :)

If anybody got the same problem just change the byte from 0x45 to 0x5A at Offset:
German Version: 0x1DFF6C
English Version: 0x1DBCD4

Thanks a lot !
 
Back
Top