• 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!
  • Dawn, Gloria, Juliana, or Summer - 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] Problems with giveitem? Missing #define.

  • 5
    Posts
    5
    Years
    • Seen Jan 26, 2021
    I'm having problems using the giveitem command in XSE. Whenever I use this command and try to compile the script XSE gives this error message:

    Error 13 "Type mismatch" on line 6
    Missing #define.

    The rest of the script compiles fine without the giveitem line. The line I'm using is:

    giveitem 0x169 0x1 MSG_OBTAIN

    Any help would be appreciated!
     
    More detail please, is it pick item script, or someone give you item script?
    Here are example script from my memory so it might be wrong.

    If it is just pick item then :
    #dynamic 0x800000
    #org @item
    giveitem 0x169 0x1 MSG_FIND
    end

    If it is someone give you item then it will be more complex
    #dynamic 0x800000
    #org @item
    lock
    msgbox @Intro MSG_keepopen
    closeonkeypress
    additem 0x169 0x1
    loadpointer 0x0 @obtainmessage
    giveitem2 0x169 0x1 0x???
    end

    #org @Intro
    = Oi, here item!

    #org @obtainmessage
    = [Player] obtained item.

    Note : ??? is jinglesound, like obtain item sound or receiving gym badge sound. I don't remember the byte.
     
    found the problem. contrary to the tutorials I watched, the third parameter for giveitem appears to take a hex number with 0x0 being the obtained message and 0x1 being the found message. thanks for the help though!
     
    Back
    Top