• 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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] Stop NPC from Disappearing after getting an ITEM from it

  • 15
    Posts
    4
    Years
    • Seen Aug 3, 2024
    Hello everybody,
    i have a minor Problem with NPCs who give ITEMs.
    I want the NPCs to still be there after I got the ITEM from them and left the map and returned there.
    I think the Problem lies with setflag , but I don't know what I should change.


    SCRIPT:

    #dynamic 0x800000

    #org @start
    lock
    faceplayer

    checkflag 0x299
    if 0x1 goto @alreadyReceived
    msgbox @t1 0x6
    giveitem 0xB5 0x2 MSG_OBTAIN
    giveitem 0xC4 0x1 MSG_OBTAIN
    setflag 0x299
    release
    end


    #org @alreadyReceived
    msgbox @t2 0x6
    release
    end


    #org @t2
    = text after receiving items

    #org @t1
    = start text
     
    Hello everybody,
    i have a minor Problem with NPCs who give ITEMs.
    I want the NPCs to still be there after I got the ITEM from them and left the map and returned there.
    I think the Problem lies with setflag , but I don't know what I should change.


    SCRIPT:

    #dynamic 0x800000

    #org @start
    lock
    faceplayer

    checkflag 0x299
    if 0x1 goto @alreadyReceived
    msgbox @t1 0x6
    giveitem 0xB5 0x2 MSG_OBTAIN
    giveitem 0xC4 0x1 MSG_OBTAIN
    setflag 0x299
    release
    end


    #org @alreadyReceived
    msgbox @t2 0x6
    release
    end


    #org @t2
    = text after receiving items

    #org @t1
    = start text

    The only way (that I know of) why your NPC would disappear is if it has the flag 299 in its person ID box in Advance Map. If it does have it, just remove the flag from the box.
     
    Back
    Top