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

Help please. Oak's battle tutorial.

33
Posts
6
Years
    • Seen Jun 23, 2022
    Hi. I'm trying to make a pokemon hack. My problem is that after the rival battle in oaks lab in my game, i want to still stay in oaks lab even if i lose and not go back to your in-game mom or to any pokecentre. i know about special 0x0 and trainerbattle 0x9 but for some reason it only works if i win the battle.
    Basically, i want it to be like our first rival match in oaks lab, in pokemon firered. if you lose or win , you dont go to any pokecentre and just stay in the lab and allowing the story continue. Please help me ...
     
    Last edited:

    Qmer Kaça

    ¯\_(ツ)_/¯
    23
    Posts
    6
    Years
  • I found 2 options for you:
    1. If you know asm, you can search the difference between normal and the first rival battle and figure it out.
    2. Use sethealingplace in level scripts. Make a script that uses special 0x0 and use
    ...
    setflag 0xX
    trainerbattle @after
    ...

    #org @after
    setflag 0xY
    ...



    For level script :
    checkflag 0xX
    İf 0x1 goto @youbattled
    end

    #org @youbattled
    checkflag 0xY
    if 0x1 goto @youwon
    (You lose)
    ...




    I wrote just the main part and I hope it will help :)
     
    148
    Posts
    17
    Years
    • Age 29
    • Seen May 5, 2024
    So you say that 0x9 only works if you win? That shouldn't be. I'll write out an example for you, maybe you're doing something wrong with it?

    #org @start
    msgbox @1 0x6
    trainerbattle 0x9 0x148 0x3 @defeat @win
    msgbox @2 0x6
    special 0x0
    release
    end

    #org @1
    = Battle me!

    #org @2
    = This dialogue plays after you\nwin or lose.

    #org @defeat
    = I lost!

    #org @win
    = I win!
     
    33
    Posts
    6
    Years
    • Seen Jun 23, 2022
    I found 2 options for you:
    1. If you know asm, you can search the difference between normal and the first rival battle and figure it out.
    2. Use sethealingplace in level scripts. Make a script that uses special 0x0 and use
    ...
    setflag 0xX
    trainerbattle @after
    ...

    #org @after
    setflag 0xY
    ...



    For level script :
    checkflag 0xX
    İf 0x1 goto @youbattled
    end

    #org @youbattled
    checkflag 0xY
    if 0x1 goto @youwon
    (You lose)
    ...




    I wrote just the main part and I hope it will help :)

    Unfortunately, I don't know asm. Though about the sethealingplace I thought you could only use that for pokecentres. I also don't know much about level scripts. Are you saying that i should create a new healingplace? Can you please explain some more about that? ( I've just started hacking so sorry if i'm asking silly questions)
    I thought it would be useful if you see my script so here's the main part:

    #org @charm
    lockall
    applymovement 8 @challenge
    waitmovement 8
    applymovement 11 @look
    applymovement 12 @look
    waitmovement 11
    waitmovement 12
    msgbox @rivalwait 0x6
    applymovement 0xFF @accepted
    waitmovement 0xFF
    msgbox @waitoak 0x6
    applymovement 8 @syncrival
    applymovement 0xFF @synchero
    waitmovement 8
    waitmovement 0xFF
    trainerbattle 0x9 0x001 0x0 @win @lose
    goto @nextonechar
    setvar 0x4012 0x1
    releaseall
    end

    #org @nextonechar
    msgbox @bye 0x6
    applymovement 8 @going
    waitmovement 8
    msgbox @bluewait 0x6
    applymovement 0xFF @surprised
    applymovement 8 @surprisedgreen
    applymovement 13 @surprised
    waitmovement 0xFF
    waitmovement 8
    waitmovement 13
    msgbox @heartattack 0x6
    applymovement 11 @challengebluesync
    applymovement 12 @challengebluesync
    applymovement 0xFF @challengeblueherosync
    waitmovement 11
    waitmovement 12
    waitmovement 0xFF
    special 0x0
    checkgender
    compare 0x800D 0x0
    if 0x1 goto @boybluechar
    trainerbattle 0x9 0x00D 0x0 @winb @loseb
    setvar 0x4012 0x1
    release
    end


    #org @boybluechar
    trainerbattle 0x9 0x006 0x0 @winb @loseb
    setvar 0x4012 0x1
    release
    end

    the main problem is that it does not continue to @nextonechar, it only gives the @lose message and then you go to your in-game mom
     
    33
    Posts
    6
    Years
    • Seen Jun 23, 2022
    So you say that 0x9 only works if you win? That shouldn't be. I'll write out an example for you, maybe you're doing something wrong with it?

    #org @start
    msgbox @1 0x6
    trainerbattle 0x9 0x148 0x3 @defeat @win
    msgbox @2 0x6
    special 0x0
    release
    end

    #org @1
    = Battle me!

    #org @2
    = This dialogue plays after you\nwin or lose.

    #org @defeat
    = I lost!

    #org @win
    = I win!

    I don't think there's any difference... The only thing I noticed is that
    trainerbattle 0x9 0x148 0x3
    ive put 0x0 instead of 0x3. What does 0x3 do ?
    Here's the main part of my script. Please help
    #org @charm
    lockall
    applymovement 8 @challenge
    waitmovement 8
    applymovement 11 @look
    applymovement 12 @look
    waitmovement 11
    waitmovement 12
    msgbox @rivalwait 0x6
    applymovement 0xFF @accepted
    waitmovement 0xFF
    msgbox @waitoak 0x6
    applymovement 8 @syncrival
    applymovement 0xFF @synchero
    waitmovement 8
    waitmovement 0xFF
    trainerbattle 0x9 0x001 0x0 @win @lose
    goto @nextonechar

    setvar 0x4012 0x1
    releaseall
    end

    #org @nextonechar
    msgbox @bye 0x6
    applymovement 8 @going
    waitmovement 8
    msgbox @bluewait 0x6
    applymovement 0xFF @surprised
    applymovement 8 @surprisedgreen
    applymovement 13 @surprised
    waitmovement 0xFF
    waitmovement 8
    waitmovement 13
    msgbox @heartattack 0x6
    applymovement 11 @challengebluesync
    applymovement 12 @challengebluesync
    applymovement 0xFF @challengeblueherosync
    waitmovement 11
    waitmovement 12
    waitmovement 0xFF
    special 0x0
    checkgender
    compare 0x800D 0x0
    if 0x1 goto @boybluechar
    trainerbattle 0x9 0x00D 0x0 @winb @loseb
    setvar 0x4012 0x1
    release
    end


    #org @boybluechar
    trainerbattle 0x9 0x006 0x0 @winb @loseb
    setvar 0x4012 0x1
    release
    end

    the problem is that it does not continue to @nextonechar if you lose, it only gives the @lose message and then you go to your in-game mom for whiting out.
     
    51
    Posts
    9
    Years
    • Seen Nov 18, 2023
    Trainerbattle 0x9 writes 0x0 or 0x1 to variable 0x800D (LASTRESULT) depending on if you won or lost the battle, respectively.
    If you use in a script:

    trainerbattle 0x9 0xXXX 0x0 @messagewin @messagedefeat
    compare LASTRESULT 0x0
    if 0x1 goto @YouWin
    compare LASTRESULT 0x1
    if 0x1 goto @YouAreALooser

    etc...

    trainerbattle 0x9 0x(rivaltrainerID) 0x(3 with oak tutorial, 0 without oak tutorial) @(message in-battle if you win) @(message in-battle if you are a looser)
     
    33
    Posts
    6
    Years
    • Seen Jun 23, 2022
    Trainerbattle 0x9 writes 0x0 or 0x1 to variable 0x800D (LASTRESULT) depending on if you won or lost the battle, respectively.
    If you use in a script:



    trainerbattle 0x9 0x(rivaltrainerID) 0x(3 with oak tutorial, 0 without oak tutorial) @(message in-battle if you win) @(message in-battle if you are a looser)

    Oh okay, Thank you. I've done the lastresult thing just like you did. But it still doesn't work although when i put 0x3(Oak's tutorial battle) It works properly and i'm able to continue on with the story. Thank you so much. You have really helped me a lot. Now I can finally continue with my rom hack!
     
    51
    Posts
    9
    Years
    • Seen Nov 18, 2023
    Oh okay, Thank you. I've done the lastresult thing just like you did. But it still doesn't work although when i put 0x3(Oak's tutorial battle) It works properly and i'm able to continue on with the story. Thank you so much. You have really helped me a lot. Now I can finally continue with my rom hack!

    It works in both cases...

    1) Without tutorial

    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    trainerbattle 0x9 0xA 0x0 @vinto @perso
    compare LASTRESULT 0x0
    if 0x1 goto @YouWin
    compare LASTRESULT 0x1
    if 0x1 goto @YouAreALooser
    release
    end

    '---------------
    #org @YouWin
    msgbox @messW 0x6
    release
    end

    '---------------
    #org @YouAreALooser
    msgbox @messL 0x6
    release
    end


    '---------
    ' Strings
    '---------
    #org @vinto
    = Ho perso...

    #org @perso
    = Ho vinto!

    #org @messW
    = Hai vinto, sei forte!

    #org @messL
    = Perdente!!!

    2) With tutorial

    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    trainerbattle 0x9 0xA 0x3 @vinto @perso
    compare LASTRESULT 0x0
    if 0x1 goto @YouWin
    compare LASTRESULT 0x1
    if 0x1 goto @YouAreALooser
    release
    end

    '---------------
    #org @YouWin
    msgbox @messW 0x6
    release
    end

    '---------------
    #org @YouAreALooser
    msgbox @messL 0x6
    release
    end


    '---------
    ' Strings
    '---------
    #org @vinto
    = Ho perso...

    #org @perso
    = Ho vinto!

    #org @messW
    = Hai vinto, sei forte!

    #org @messL
    = Perdente!!!
     
    33
    Posts
    6
    Years
    • Seen Jun 23, 2022
    It works in both cases...

    1) Without tutorial

    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    trainerbattle 0x9 0xA 0x0 @vinto @perso
    compare LASTRESULT 0x0
    if 0x1 goto @YouWin
    compare LASTRESULT 0x1
    if 0x1 goto @YouAreALooser
    release
    end

    '---------------
    #org @YouWin
    msgbox @messW 0x6
    release
    end

    '---------------
    #org @YouAreALooser
    msgbox @messL 0x6
    release
    end


    '---------
    ' Strings
    '---------
    #org @vinto
    = Ho perso...

    #org @perso
    = Ho vinto!

    #org @messW
    = Hai vinto, sei forte!

    #org @messL
    = Perdente!!!

    2) With tutorial

    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    trainerbattle 0x9 0xA 0x3 @vinto @perso
    compare LASTRESULT 0x0
    if 0x1 goto @YouWin
    compare LASTRESULT 0x1
    if 0x1 goto @YouAreALooser
    release
    end

    '---------------
    #org @YouWin
    msgbox @messW 0x6
    release
    end

    '---------------
    #org @YouAreALooser
    msgbox @messL 0x6
    release
    end


    '---------
    ' Strings
    '---------
    #org @vinto
    = Ho perso...

    #org @perso
    = Ho vinto!

    #org @messW
    = Hai vinto, sei forte!

    #org @messL
    = Perdente!!!

    Then i dont know why it isn't working... Can you please check my script and tell me what's wrong? The bold underlined script is the important part.

    #org @charm
    lockall
    applymovement 8 @challenge
    waitmovement 8
    applymovement 11 @look
    applymovement 12 @look
    waitmovement 11
    waitmovement 12
    msgbox @rivalwait 0x6
    applymovement 0xFF @accepted
    waitmovement 0xFF
    msgbox @waitoak 0x6
    applymovement 8 @syncrival
    applymovement 0xFF @synchero
    waitmovement 8
    waitmovement 0xFF
    trainerbattle 0x9 0x001 0x0 @win @lose
    compare LASTRESULT 0x0
    if 0x1 goto @nextonechar
    compare LASTRESULT 0x1
    if 0x1 goto @nextonechar

    releaseall
    end

    #org @nextonechar
    special 0x0
    msgbox @bye 0x6
    applymovement 8 @going
    waitmovement 8
    msgbox @bluewait 0x6
    applymovement 0xFF @surprised
    applymovement 8 @surprisedgreen
    applymovement 13 @surprised
    waitmovement 0xFF
    waitmovement 8
    waitmovement 13
    msgbox @heartattack 0x6
    applymovement 11 @challengebluesync
    applymovement 12 @challengebluesync
    applymovement 0xFF @challengeblueherosync
    waitmovement 11
    waitmovement 12
    waitmovement 0xFF
    special 0x0
    checkgender
    compare 0x800D 0x0
    if 0x1 goto @boybluechar
    trainerbattle 0x9 0x00D 0x0 @winb @loseb
    setvar 0x4012 0x1
    release
    end
     
    51
    Posts
    9
    Years
    • Seen Nov 18, 2023
    #dynamic 0x800000
    #org @charm
    lockall
    applymovement 0x8 @challenge
    waitmovement 0x0
    applymovement 0x11 @look---->are you shure that is correct? If aMap ID is 11 in hex is 0xB
    applymovement 0x12 @look--->idem
    waitmovement 0x0
    msgbox @rivalwait 0x6
    applymovement 0xFF @accepted
    waitmovement 0x0
    msgbox @waitoak 0x6
    applymovement 0x8 @syncrival
    applymovement 0xFF @synchero
    waitmovement 0x0
    trainerbattle 0x9 0x1 0x0 @win @lose
    compare LASTRESULT 0x0
    if 0x1 goto @nextonechar
    compare LASTRESULT 0x1
    if 0x1 goto @nextonechar---->same pointer of win???
    end

    #org @nextonechar
    special 0x0
    msgbox @bye 0x6
    applymovement 0x8 @going
    waitmovement 0x0
    msgbox @bluewait 0x6
    applymovement 0xFF @surprised
    applymovement 0x8 @surprisedgreen
    applymovement 0x13 @surprised--->idem
    waitmovement 0x0
    msgbox @heartattack 0x6
    applymovement 0x11 @challengebluesync--->idem
    applymovement 0x12 @challengebluesync--->idem
    applymovement 0xFF @challengeblueherosync
    waitmovement 0x0
    special 0x0
    checkgender
    compare LASTRESULT 0x0
    if 0x1 goto @boybluechar
    trainerbattle 0x9 0xD 0x0 @winb @loseb
    setvar 0x4012 0x1
    releaseall
    end
     
    Last edited:
    33
    Posts
    6
    Years
    • Seen Jun 23, 2022
    applymovement 0x11 @look---->are you shure that is correct? If aMap ID is 11 in hex is 0xB
    I think it's correct as this part works properly.
    if 0x1 goto @nextonechar---->same pointer of win???
    Yeah, I want the story to continue it doesn't matter whether the player wins or lose.
    Also, can you please tell me what idem means?
     
    Last edited:
    Back
    Top