• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Make NPC appear only after some conditions

chentm

Stylish Improv
  • 5
    Posts
    15
    Years
    I would like to create a script that causes an NPC to appear only after some conditions have been met. However my approach seems to not work. For example, I want Bob's cat to appear only after Bob has been seen. My approach:

    - Script Start -

    #freespace 0xFF
    #dynamic 0x9C0B20

    #org @start
    checkflag [seen bob flag]
    if 0x0 call @hidecat
    end

    #org @hidecat
    hidesprite [cat person id]

    - Script End-

    However when I tested this, Bob's cat is there despite the player not having seen Bob. How can I fix this?
     
    Hidesprite only hides the sprite until the map is reloaded,

    use setflag 0x(person id of the cat OW)

    Setting a flag with the same flag number as the person ID of an overworld sets it not to show up.

    So at some earlier point set the flag then use clearflag to clear it when you want the sprite to sow up.
     
    Hidesprite only hides the sprite until the map is reloaded,

    use setflag 0x(person id of the cat OW)

    Setting a flag with the same flag number as the person ID of an overworld sets it not to show up.

    So at some earlier point set the flag then use clearflag to clear it when you want the sprite to sow up.

    Appreciate the help man, thanks!
     
    Back
    Top