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

[Script] Make NPC appear only after some conditions

chentm

Stylish Improv
5
Posts
14
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?
     
    64
    Posts
    8
    Years
  • 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.
     

    chentm

    Stylish Improv
    5
    Posts
    14
    Years
  • 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