• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Script] How to hide NPC's until they are needed

  • 3
    Posts
    2
    Years
    • Seen Jan 10, 2025
    In FireRed, when you walk out of your house, you pass by a hidden Prof. Oak sprite on your way out of Pallet Town. Stepping on the script block to leave Pallet Town triggers the script that calls the showsprite command, and Prof. Oak walks up to you and takes you to his Lab.

    How is Prof. Oak hidden by default? There's no flags set to him in AMap, the player does not pass any script blocks in the house to set any flags with a script, he doesn't have a script associated with his sprite, and even if he did, you'd have to talk to him to trigger it.

    I want to create an NPC similar to how Oak acts, he is hidden until someone steps on his script block, and then he comes running into the screen. However, my sprite, is just standing in the map when I walk out of the house, and if someone talks to him, it crashes the game.

    Any help would be greatly appreciated!
     
    In FireRed, when you walk out of your house, you pass by a hidden Prof. Oak sprite on your way out of Pallet Town. Stepping on the script block to leave Pallet Town triggers the script that calls the showsprite command, and Prof. Oak walks up to you and takes you to his Lab.

    How is Prof. Oak hidden by default? There's no flags set to him in AMap, the player does not pass any script blocks in the house to set any flags with a script, he doesn't have a script associated with his sprite, and even if he did, you'd have to talk to him to trigger it.

    I want to create an NPC similar to how Oak acts, he is hidden until someone steps on his script block, and then he comes running into the screen. However, my sprite, is just standing in the map when I walk out of the house, and if someone talks to him, it crashes the game.

    Any help would be greatly appreciated!

    Set a flag corresponding to the person event in A-Map in a previous script (preferably a level script). Or just use Oak's flag (0x2C). Here's is a detailed list of [FR] flags: https://github.com/pret/pokefirered/blob/master/include/constants/flags.h
     
    Back
    Top