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

Partner Trainer/Opponent control

119
Posts
10
Years
    • Seen Sep 1, 2023
    I was wondering where in the battle script the system determines that the AI gets to control the Pokémon (which is the case for the partner trainer's and the opponent's Pokémon). I'd like to be able to show the command menu for those as well in certain situations.

    I'm working on a co-op system, wherein player 2 can control the partner trainer and where it's possible for the 2 players to fight against each other. I've already set up controls, parties, bags, etc. for both players. However, thus far, I haven't had much luck in allowing player 2 to control the partner trainer (due to not having found where to add the proper code).

    If anyone can tell me where the battle system determines whether the player or AI gets to choose the actions, I should be able to finish the rest myself.


    Note: I am currently still working in essentials v12.2, yet plan to update everything to v14 in the near future. I don't know if there are any differences between the two versions with regards to this topic. If there are, I'd prefer to know the solution for essentials v14.
     
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    Uhm, this is embarrassing. I actually just found the location myself by searching for something else XD.

    For anyone interested, search for the following line in PokeBattle_Battle;

    Code:
    if !pbOwnedByPlayer?(i) || @controlPlayer

    Something I did notice, while it works perfectly fine for the player to "control" the AI, the game crashes when the AI is asked to control the player. It gives an error stating "undefined method `pbEnemyShouldWithdrawOld?' " for the player's Pokémon.


    Note: This thread can be closed/removed, sorry for the inconvenience. (Or this thread can be left as is if other people are interested in this.)
     
    Back
    Top