The PokéCommunity Forums Anthroyd
Conversation Between Anthroyd and FBI

Conversation Between Anthroyd and FBI
Showing Visitor Messages 1 to 13 of 13
  1. FBI
    October 2nd, 2016 2:37 PM
    FBI
    It's definitely a worthwhile skill to learn when it comes to ROM hacking, though takes some commitment. There will be people to help if you get stuck :)
  2. Anthroyd
    October 2nd, 2016 2:09 PM
    Anthroyd
    Thank you. I really feel like I should learn ASM and how all of that works so I can be more independent when it comes to this kind of intricate work.
  3. FBI
    October 2nd, 2016 1:23 PM
    FBI
    Check 0x2023E8A to figure out of the last battle was won or lost. It should be 0 if you lost the battle & the routine ran. Else it will be 1 if you won normally.
  4. Anthroyd
    October 2nd, 2016 12:33 PM
    Anthroyd
    Background: When the player fights a trainer and loses, the trainer's flag remains cleared. When the player fights a trainer and wins, the trainer's flag is set. I often use the checktrainerflag command to determine if the player won or lost some past battle.

    Problem: After 2 hours of attempts, I've come to realize that your ASM routine actually sets a trainer's flag regardless of whether the player won or lost the battle. This is bad, since I can no longer act on the result of a trainer battle.

    Question: To your knowledge, is there any way to know if the player won or lost a battle after returning to the overworld? Possibly a byte I could reference?
  5. Anthroyd
    September 29th, 2016 1:19 PM
    Anthroyd
    I'm very glad that trainerbattle 0x1 continues upon loss when using this. Clears my worries that the player will just be left with a fainted party, haha.
  6. FBI
    September 29th, 2016 1:13 PM
    FBI
    I assume it worked now, and yes the table needs to be terminated with 00s because that's how the routine determines it's finished running all the other routines :)
  7. Anthroyd
    September 29th, 2016 1:08 PM
    Anthroyd
    Ahh no I completely forgot that line existed! I didn't understand what it meant at first so I guess I just forgot about it.

    By the way, what does that mean? ^_^
    Are you saying to add the 00 00 00 00 pointer to the end of the table?

    EDIT: Yes, that's what you're saying. Thanks for your assistance!
  8. FBI
    September 29th, 2016 1:06 PM
    FBI
    "The last pointer in the routine NEEDS to be 00 00 00 00." Did you do this too? It should read last pointer in the table of routines, but I make a small typo :)
  9. Anthroyd
  10. FBI
    September 29th, 2016 10:38 AM
    FBI
    can you link me to the post again please?
  11. Anthroyd
    September 29th, 2016 10:12 AM
    Anthroyd
    Changed to 0x8FFFA00, recompiled, reinserted at same offset. Unfortunately nothing changed. :/
    Is there maybe supposed to be more to the routine table? It's literally four bytes long.
  12. FBI
    September 29th, 2016 9:35 AM
    FBI
    The ".word 0x[pointer to routine table]" was replaced with: 0xFFFA00.

    Replace it with ".word 0x8FFFA00"
  13. Anthroyd
    September 29th, 2016 8:04 AM
    Anthroyd
    Hi there,

    I've implemented the "Prevent Loss" ASM routine, but I've run into an issue.
    When a battle commences, the game freezes at the point I've screenshoted in the spoiler guards below:
    Spoiler:

    I'm not sure why this is happening. I'll give you as much information as possible about how I inserted each routine and their pointers.

    The main Battle Routine By Move ASM was compiled and inserted at: 0xFFFF80.
    The ".word 0x[pointer to routine table]" was replaced with: 0xFFFA00.
    The bytes at offset 0xE2E0 were changed to: 00 4D 28 47 81 FF FF 08.
    The "Prevent Loss" ASM was compiled and inserted at: 0xFFF900.

    At offset 0xFFFA00 (the routine table mentioned earlier) exists the bytes: 01 F9 FF 08.
    This reverse hex is the pointer 0xFFF901, which is supposed to correspond with 0xFFF900 which is where I inserted the "Prevent Loss" ASM.

    Clearing flag 0x2FC nullifies the ASM as expected, and setting it causes the game to freeze (with the music still playing).

All times are GMT -8. The time now is 4:13 PM.