• 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] Trainers send out Pokemon in order, v18

  • 19
    Posts
    6
    Years
    • Seen Aug 14, 2021
    Hello!

    So, Pokemon Essentials has a feature where trainers will send out a Pokemon that's strong against what the trainer is using, instead of just sending them out in the order defined in the PBS file. This is great, but sometimes you want a trainer that always sends out their strongest Pokemon last, or a similar effect. What I'm looking for is a way to bypass this decision and have trainers just send out their Pokemon in a set order.

    I'm aware that this issue has been solved for previous versions of Essentials, but the relevant code was rewritten in v18 and the old fix no longer works. I've narrowed it down to this section here:

    Spoiler:


    By adding a $game_switches number to turn the effect on and off and messing with the code I was able to generate some comical results, but not the result I'm looking for. What do?

    EDIT:

    For those in the future who stumble across this, with some help from a friend I figured it out. It was simply a matter of changing the following (changes in red):

    Spoiler:


    With the switch "75" being whatever switch you use in your game, of course.
     
    Last edited:
  • 10
    Posts
    3
    Years
    • Seen Jan 3, 2021
    Hi there Nonagon, I tried out your script but and what it did to me is that after the second pokemon of the oppent fainted, it keeps sending out the fainted pokemon but it is not crashing or anything, just asking if I should switch my pokemon... What I did was copy the second spoiler with the red highlight and pasted it in the same code below. Do I have to replace the def code with the first spoiler then paste the highlight code? For now it is commented out and the battle is working fine again.
     
  • 19
    Posts
    6
    Years
    • Seen Aug 14, 2021
    Hi there Nonagon, I tried out your script but and what it did to me is that after the second pokemon of the oppent fainted, it keeps sending out the fainted pokemon but it is not crashing or anything, just asking if I should switch my pokemon... What I did was copy the second spoiler with the red highlight and pasted it in the same code below. Do I have to replace the def code with the first spoiler then paste the highlight code? For now it is commented out and the battle is working fine again.

    Without seeing your code, I'm not sure exactly what's going wrong. To be sure that you've got everything in the right place, it might be best to replace the entirety of the pbDefaultChooseNewEnemy section with all of the code in the second spoiler. (Also, I'm not much of a coder, so depending on what other changes you've made to your battle system, it's possible that my code is just jank.)
     
  • 10
    Posts
    3
    Years
    • Seen Jan 3, 2021
    Without seeing your code, I'm not sure exactly what's going wrong. To be sure that you've got everything in the right place, it might be best to replace the entirety of the pbDefaultChooseNewEnemy section with all of the code in the second spoiler. (Also, I'm not much of a coder, so depending on what other changes you've made to your battle system, it's possible that my code is just jank.)
    Err, nevermind sorry I guess I put it in the wrong place. It works fine now! Thank you!
     
    Last edited:
    Back
    Top