• 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] Scripting error 13 Type mismatch.

  • 4
    Posts
    7
    Years
    • Seen Dec 12, 2021
    Hello, thank you for taking the time to read this.
    I am currently learning how to write scripts and trying to get a script to work.
    Its supposed to enter a [yes] [no] message box, yes results in a battle, no results in the end of a script without a battle occuring..
    And at the end of the battle the NPC is supposed to give the player a pokémon.

    i can't seem to get the script to work and keep getting error 13 Type mismatch.
    Anyone who can help me out please?

    Script
    ------------------------
    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    msgbox @t1 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @yes
    msgbox @t2 0x6
    release
    end

    #org @yes
    trainerbattle 0x1 0x001 0x0 @introText @winText @continue
    msgbox @alreadydefeated 0x6

    #org @continue
    msgbox @aftertext 0x6
    checkflag 0x200
    givepokemon 0x252 0x10 0x0 0x0 0x0 0x0
    setflag 0x200
    release
    end

    #org @aftertext
    = [black_fr]As promised, here is your reward.

    #org @alreadyDefeated
    = [black_fr]Is Treecko doing fine?.

    #org @t2
    = [black_fr]Awww, if you change your\nmind then let me know!

    #org @winTex
    = Wow! That was fun!

    #org @introText
    = [black_fr]
    #org @t1
    = Hey, why that smirk on your face?\nWow you have beaten Roxanne!.\pThat makes two of us.\nWanna battle to see who is stronger?\pI must warn you\n I am very strong!\pBut if you defeat me i will...\nGive you an awesome reward!\pDeal?
    -----------------
     
    Hello, thank you for taking the time to read this.
    I am currently learning how to write scripts and trying to get a script to work.
    Its supposed to enter a [yes] [no] message box, yes results in a battle, no results in the end of a script without a battle occuring..
    And at the end of the battle the NPC is supposed to give the player a pokémon.

    i can't seem to get the script to work and keep getting error 13 Type mismatch.
    Anyone who can help me out please?

    Script
    ------------------------
    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    msgbox @t1 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @yes
    msgbox @t2 0x6
    release
    end

    #org @yes
    trainerbattle 0x1 0x001 0x0 @introText @winText @continue
    msgbox @alreadydefeated 0x6

    #org @continue
    msgbox @aftertext 0x6
    checkflag 0x200
    givepokemon 0x252 0x10 0x0 0x0 0x0 0x0
    setflag 0x200
    release
    end

    #org @aftertext
    = [black_fr]As promised, here is your reward.

    #org @alreadyDefeated
    = [black_fr]Is Treecko doing fine?.

    #org @t2
    = [black_fr]Awww, if you change your\nmind then let me know!

    #org @winTex
    = Wow! That was fun!

    #org @introText
    = [black_fr]
    #org @t1
    = Hey, why that smirk on your face?\nWow you have beaten Roxanne!.\pThat makes two of us.\nWanna battle to see who is stronger?\pI must warn you\n I am very strong!\pBut if you defeat me i will...\nGive you an awesome reward!\pDeal?
    -----------------

    At the trainerbattle command, you can clearly see that it's "winText" and at the end it's "winTex". Just change the "winTex" to "winText" And same is the case in "alreadyDefeated" and "alreadydefeated".
    And this script looks a little messy. You'd do better by revising and rewriting it.
     
    Oh thank you so much! its hard to notice grammatical errors like that for me.
    I am just starting out with writing scripts so i hope to get better with writing better and organized scripts :)
     
    Back
    Top