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

[Other] Scripting Problem - Type mismatch

  • 25
    Posts
    9
    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
     

    iv0

  • 145
    Posts
    10
    Years
    • Seen Sep 1, 2023
    #org @give
    giveitem 0x0 0x1 MSG_OBTAIN
    msgbox @talk1 0x6
    setflag 0x201
    release
    end
     

    iv0

  • 145
    Posts
    10
    Years
    • Seen Sep 1, 2023
    compare 0x800D 0x01
    if 0x01 goto @give

    check if have blank lines within the line breaks, there are no more error.
     
  • 287
    Posts
    11
    Years
    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:

    Danny0317

    Fluorite's back, brah
  • 1,067
    Posts
    10
    Years
    • Age 24
    • Seen Nov 19, 2023
    Oh that happened to my friend as well. It might be your XSE, his didn't take LASTRESULT, it took 0x800D.
     

    iv0

  • 145
    Posts
    10
    Years
    • Seen Sep 1, 2023
    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.
     
  • 25
    Posts
    9
    Years
    • Seen Aug 6, 2014
    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.
     

    iv0

  • 145
    Posts
    10
    Years
    • Seen Sep 1, 2023
    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
     
  • 25
    Posts
    9
    Years
    • Seen Aug 6, 2014
    Warp1
    Spoiler:


    Warp2


    Walking into 1 results into a fading screen until its black. and it stays black. -_-
     
    Back
    Top