• 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] Make NPC Check if player has a pokemon on him

2
Posts
6
Years
    • Seen Sep 29, 2017
    Hello !

    So I am making a new pokemon game with a group of friends, we are doing very well but,
    we would like a guy between our Route 1 and our first Town to check if the player has a Pokemon on him, and if not, make the player turn back into the town and let the player go into the lab to get his pokemon..

    I tried to copy the Guard from the Cycling Road Gate, and try to modify so he doesn't check if the player has a bicycle but a pokemon.. But i didn't find how..

    Thank you very much,

    Chronoxx98
     
    Last edited:
    226
    Posts
    8
    Years
    • Seen Jul 19, 2023
    I believe the wiki (this page) might help you:

    pbCheckAble(0)
    Ignoring the Pok?mon with the party index given, returns TRUE if the player has any able Pok?mon, and FALSE if they don't.

    $Trainer.pokemonCount
    Returns the number of Pok?mon in the player's party (unfainted and fainted).

    Based on those scripts, use a Conditional Branch to check the player's party.
     
    2
    Posts
    6
    Years
    • Seen Sep 29, 2017
    Hello, I tried but actually it is not working :/

    Could you help me with more info ? :(
     
    226
    Posts
    8
    Years
    • Seen Jul 19, 2023
    This way is working fine for me:

    Make NPC Check if player has a pokemon on him


    You can also use pbAllFainted instead of $Trainer.pokemonCount==0
     
    Last edited:

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Wouldn't it be easier to use the variable for the starters? Like making a conditional branch with the argument "if game_variable [X]==0"
     
    Back
    Top