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

[Other] Scripting Problem - Type mismatch

  • 25
    Posts
    10
    Years
    • Seen Aug 6, 2014
    So I have written this little Script,
    Spoiler:


    Which asks you if you want to have this specific item when you try to get it.
    However when i want to compile this i get this error :

    type mistmatch in line 5
    #define missing
     
    #org @give
    giveitem 0x0 0x1 MSG_OBTAIN
    msgbox @talk1 0x6
    setflag 0x201
    release
    end
     
    compare 0x800D 0x01
    if 0x01 goto @give

    check if have blank lines within the line breaks, there are no more error.

    That's unecessary, since 0x800D = LASTRESULT

    It should work as it is, but try this instead:
    Code:
    #dynamic 0x800000
    
    #org @start
    lock
    msgbox @talk1 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @give
    [U]if 0x0 goto @release[/U]
    release
    end
    
    #org @give
    giveitem 0x0 0x1 MSG_OBTAIN
    msgbox @talk1 0x6
    setflag 0x201
    release
    end
    
    [U]#org @release
    release
    end[/U]
    
    #org @talk1
    = Willst du den Wasserstein?
     
    Last edited:
    That's unecessary, since 0x800D = LASTRESULT

    It should work as it is, but try this instead:
    Code:
    #dynamic 0x800000
    
    #org @start
    lock
    msgbox @talk1 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @give
    [U]if 0x0 goto @release[/U]
    release
    end
    
    #org @give
    giveitem 0x0 0x1 MSG_OBTAIN
    msgbox @talk1 0x6
    setflag 0x201
    release
    end
    
    [U]#org @release
    release
    end[/U]
    
    #org @talk1
    = Willst du den Wasserstein?
    I believe it is an error in strings and the if 0x0 is only a complement, but not required... If this script aren't, it just going to follow up the release and end.
     
    So i did send the code to a friend who tested it out and for him it was being compiled without any errors. He did send me his XSE then and although we both use the latest version 1.1.1 that did it for me and it's working fine now.

    Now I got another problem with advance map this time :p

    I wanted to make a warp from route 2 to a cave and from the cave to the other side of route 2. fairly simple i thought. however if i step on the warp in route 2, which is connected to another warp in the cave, i just get a dark screen and nothing happens. For some reason so it seems i can warp with the exact same warp to any other bank/map, just not the one the cave is on.
     
    So i did send the code to a friend who tested it out and for him it was being compiled without any errors. He did send me his XSE then and although we both use the latest version 1.1.1 that did it for me and it's working fine now.

    Now I got another problem with advance map this time :p

    I wanted to make a warp from route 2 to a cave and from the cave to the other side of route 2. fairly simple i thought. however if i step on the warp in route 2, which is connected to another warp in the cave, i just get a dark screen and nothing happens. For some reason so it seems i can warp with the exact same warp to any other bank/map, just not the one the cave is on.
    Send your code
     
    Back
    Top