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

[Scripting Question] Last Pokemon dialogue and music change

20
Posts
4
Years
    • Seen Jul 24, 2023
    Hey,

    looking to implement dialogue and a music change on the last Pokemon in my game.

    I've been searching around and there doesn't seem to be a post available with the code for this or instructions on how to implement it. (i'm not using EBS)

    was wondering if anyone could help by linking or maybe posting it in the comments?

    It would be greatly appreciated

    Thanks

    LordBN0
     
    43
    Posts
    4
    Years
    • He/Him
    • Seen Nov 11, 2023
    Hi! I successfully added this feature using a script by Venom12 and HelioAU (I can't link due to not having enough posts here)

    First, go to PokeBattle_Battle (note: PokeBattle_Battle is separate from PokeBattle_Battler, easy to confuse the two).

    Find def pbSendOut(index,pokemon).

    Within this, look for @scene.pbTrainerSendOut(index,pokemon). Underneath this, add the following code:

    Spoiler:


    If you need any help, feel free to ask :)

    Credits: venom12, HelioAU
     
    20
    Posts
    4
    Years
    • Seen Jul 24, 2023
    Hey,

    thanks for the code, just want to specify 2 things (silly questions but they're still questions)
    when you mean underneath do you mean something like this?

    @scene.pbTrainerSendOut(index,pokemon)

    *code you linked pasted here*
    end
    end

    or something like this?

    @scene.pbTrainerSendOut(index,pokemon)
    end
    *code you posted here*
    end
    end

    and also the code has two sample ones right? (as shown by trainer 1 and 2?)

    sorry if this seems silly i just want to make sure i don't f it up

    thanks

    LordBN0
     
    20
    Posts
    4
    Years
    • Seen Jul 24, 2023
    Hi! I successfully added this feature using a script by Venom12 and HelioAU (I can't link due to not having enough posts here)

    First, go to PokeBattle_Battle (note: PokeBattle_Battle is separate from PokeBattle_Battler, easy to confuse the two).

    Find def pbSendOut(index,pokemon).

    Within this, look for @scene.pbTrainerSendOut(index,pokemon). Underneath this, add the following code:

    Spoiler:


    If you need any help, feel free to ask :)

    Credits: venom12, HelioAU

    Hey,

    thanks for the code, just want to specify 2 things (silly questions but they're still questions)
    when you mean underneath do you mean something like this?

    @scene.pbTrainerSendOut(index,pokemon)

    *code you linked pasted here*
    end
    end

    or something like this?

    @scene.pbTrainerSendOut(index,pokemon)
    end
    *code you posted here*
    end
    end

    and also the code has two sample ones right? (as shown by trainer 1 and 2?)

    sorry if this seems silly i just want to make sure i don't f it up

    thanks

    LordBN0
     
    43
    Posts
    4
    Years
    • He/Him
    • Seen Nov 11, 2023
    I'm happy to help, those questions are not silly at all :)

    1. Immediately after @scene.pbTrainerSendOut(index,pokemon), so the first one

    2. Yup! If you want to add even more, just add another elseif after @scene.pbHideOpponent

    Good luck! I'll be here if you have any trouble.
     
    20
    Posts
    4
    Years
    • Seen Jul 24, 2023
    I'm happy to help, those questions are not silly at all :)

    1. Immediately after @scene.pbTrainerSendOut(index,pokemon), so the first one

    2. Yup! If you want to add even more, just add another elseif after @scene.pbHideOpponent

    Good luck! I'll be here if you have any trouble.

    https://imgur.com/a/U5Gkfk7

    hey heres a visual reference my code

    it doesn't seem to be working and an error message pops up as i try and load the game
    is there anything evidently wrong?
     
    43
    Posts
    4
    Years
    • He/Him
    • Seen Nov 11, 2023
    The only mistake you made was that you put your code under pbSendOut(index,pokemon) instead of pbTrainerSendOut(index,pokemon).

    Below is what my entire def pbSendOut(index,pokemon) function looks like:

    Last Pokemon dialogue and music change
     
    Last edited:
    3
    Posts
    9
    Years
    • Seen Jun 21, 2020
    The only mistake you made was that you put your code under pbSendOut(index,pokemon) instead of pbTrainerSendOut(index,pokemon).

    Below is what my entire def pbSendOut(index,pokemon) function looks like:

    View attachment 91631

    Hey there! I used this exact code for the game I am making, and once the trainer left the screen after saying their line, the opponent's Pokemon's status bar could no longer be seen. I imagine this has something to do with "pbDisplayPause()", but I'm unsure how to fix it? Every other bit of the menu worked fine, it was just the opponent's Pokemon's status bar.
     
    43
    Posts
    4
    Years
    • He/Him
    • Seen Nov 11, 2023
    I don't seeany issues, idk why that's happening for you. That attachment looks exactly like mine.

    1) Are you using Elite Battle System? This code doesn't work with EBS

    2) Which version of Essentials are you using? I'm using 17.2
     
    3
    Posts
    9
    Years
    • Seen Jun 21, 2020
    Okay! So I found that this script does work with EBS if you change one small thing. My issue was the fact that the opponent's health bar was not reappearing. This was due to the script @scene.pbHideOpponent. Simply changing that to @scene.pbHideOpponent(0) will only tell the game to hide the sprite of the trainer, and not the opponent's health. I am using EBS while doing this so it works fine. Hope this helps anyone with my problem!
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • Okay! So I found that this script does work with EBS if you change one small thing. My issue was the fact that the opponent's health bar was not reappearing. This was due to the script @scene.pbHideOpponent. Simply changing that to @scene.pbHideOpponent(0) will only tell the game to hide the sprite of the trainer, and not the opponent's health. I am using EBS while doing this so it works fine. Hope this helps anyone with my problem!

    Why would you be using this workaround in EBS anyway when EBS already comes with a feature like this baked-in by default?
     
    3
    Posts
    9
    Years
    • Seen Jun 21, 2020
    I didn't even know that it was included in it. I guess I should've searched harder ahaha. My bad, but thank you for letting me know it's in there!
     
    10
    Posts
    3
    Years
    • Seen Jan 3, 2021
    Spoiler:

    A question for v18...since scripts are changed in v18 I get this error. Does this need minimum edit or major ones? Sorry not good at scripting, and just curious. The battle will start but will crash when the player throws out their pokemon. I put it on Battle_Action_Switch. But I also had a hunch I should try putting it in Battle_StartAndEnd...
     
    Last edited:
    658
    Posts
    7
    Years
  • A question for v18...since scripts are changed in v18 I get this error. Does this need minimum edit or major ones? Sorry not good at scripting, and just curious. The battle will start but will crash when the player throws out their pokemon. I put it on Battle_Action_Switch. But I also had a hunch I should try putting it in Battle_StartAndEnd...

    I'm actually working on a Script that not only allows you to show Dialogue on sending the last Pokemon, it actually allows you to display Dialogue in various scenarios. It can even run chunks of code mid battle. I'd suggest you wait, I'll be releasing it soon.

    Here's an example I made using that script. It's a recreation of the last battle in the Indigo League Anime Episode "Showdown in Pewter City"

     
    10
    Posts
    3
    Years
    • Seen Jan 3, 2021
    I'm actually working on a Script that not only allows you to show Dialogue on sending the last Pokemon, it actually allows you to display Dialogue in various scenarios. It can even run chunks of code mid battle. I'd suggest you wait, I'll be releasing it soon.

    Here's an example I made using that script. It's a recreation of the last battle in the Indigo League Anime Episode "Showdown in Pewter City"


    COOOL! That is so cool! Okay okay i will wait. I was wondering the same thing as well! I'm loving the idea! Thank you so much for the information!
     
    Last edited:

    Vxpor

    Vxpor
    77
    Posts
    5
    Years
    • Seen May 10, 2024
    I'm actually working on a Script that not only allows you to show Dialogue on sending the last Pokemon, it actually allows you to display Dialogue in various scenarios. It can even run chunks of code mid battle. I'd suggest you wait, I'll be releasing it soon.

    Here's an example I made using that script. It's a recreation of the last battle in the Indigo League Anime Episode "Showdown in Pewter City"


    Looks awesome! Is this script planned for both v17 and v18, or just v18?
     
    49
    Posts
    5
    Years
    • Seen Aug 21, 2021
    I'm actually working on a Script that not only allows you to show Dialogue on sending the last Pokemon, it actually allows you to display Dialogue in various scenarios. It can even run chunks of code mid battle. I'd suggest you wait, I'll be releasing it soon.

    Here's an example I made using that script. It's a recreation of the last battle in the Indigo League Anime Episode "Showdown in Pewter City"


    This looks amazing! What's the name of it so I can be on the lookout for it
     
    Back
    Top