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

[Script] JPAN's Special 0x7/0x8

Lunos

Random Uruguayan User
3,114
Posts
15
Years
  • Hi. Straight to the point, I want to make a NPC that reads the EVs and/or IVs of one of my Pok?mon, but I think that I'm not understanding how JPAN's special 0x7 (which works in the same way as the special 0x8) works.

    What I basically came up with, was this:
    Code:
    #dynamic 0x71BBA0
    
    #org @start
    lock
    faceplayer
    msgbox @string1 0x5
    compare 0x800D 0x0
    if 0x1 goto @snippet1
    special 0x9F
    waitstate
    compare 0x8004 0x6
    if 0x4 goto @snippet1
    goto @snippet2
    
    #org @snippet1
    release
    end
    
    #org @snippet2
    faceplayer
    special 0x6
    setvar 0x8005 0x0
    special2 0x8006 0x7
    buffernumber 0x0 0x8006
    setvar 0x8005 0x1
    special2 0x800D 0x7
    buffernumber 0x1 0x800D
    setvar 0x8005 0x2
    special2 0x800D 0x7
    buffernumber 0x2 0x800D
    msgbox @string2 0x4
    closeonkeypress
    setvar 0x8005 0x3
    special2 0x800D 0x7
    buffernumber 0x0 0x800D
    setvar 0x8005 0x4
    special2 0x800D 0x7
    buffernumber 0x1 0x800D
    setvar 0x8005 0x5
    special2 0x800D 0x7
    buffernumber 0x2 0x800D
    special 0x6
    msgbox @string3 0x4
    closeonkeypress
    release
    end
    
    #org @string1
    = Wanna check a POK?MON's EVs?
    
    #org @string2
    = Hmm[.] I see, I see.\nYour POK?MON's EVs are:\l[buffer1] EVs in HP, [buffer2] EVs in Atk.\land [buffer3] EVs in Def.
    
    #org @string3
    = Followed by [buffer1] EVs in Spd\n[buffer2] EVs in Sp. Atk\land [buffer3] EVs in Sp. Def.

    The only difference that I'm seeing with the script that JPAN wrote as an example is that he used a setvar 0x8004 0x0, but that would mean that my NPC would always check the EVs/IVs of the first Pok?mon in my party, that's why I decided to use the special 0x9F instead.

    Observations:
    -If I understood it correctly, both the special 0x6 and the special2 are working as if they were 1 command with multiple parameters. I think it basically executes the special 0x7 (JPAN's) which checks the EVs that a Pok?mon has on whatever stat you specify at the var 0x8005 (0x0 is HP, 0x1 Attack and so on) and then it pastes that amount of EVs in the var 0x8006.

    -Buffers 1 to 3 are giving me as result the number 44481, but that's naturally impossible. So something's wrong.
    6AbAH2w.gif


    Help please? Even a small hint would be wonderful because I really tried to think in a way to make this work, but I just can't.
     
    Last edited:
    92
    Posts
    8
    Years
    • Seen Dec 8, 2022
    Well, from what I tested, the script works. Either the problem is:
    Most likely:
    a)
    Problem: You are finding space with @dynamic without erasing the space beforehand, so the script keeps going in free space, wasting the space of the rom and not running the finished code.
    Solution: add #org @nothing at the bottem of the script, debug it, copy the offset and subtract the offset with the @start offset. Afterwords, add #erase at the top and put the dynamic offset and the result of the subtraction.
    ex. erase 0x71BBA0 0x169
    Maybe:
    b)
    Problem: JPAN's hacked engine is screwed up
    Solution: Use JPAN's hacked tool applier on the rom again. Add special 0x6 and special 0x7 to the rom. Doing this wastes rom space, so only use it if the specials arn't working
    Unlikely
    c)
    Problem: Scripts somehow screwed
    Solution: Try a different offset, or see if inserting this one would work (worked for me):
    Spoiler:

    Extremly unlikely
    d)
    Problem: XSE has problems compiling the script correctly
    Solution: Try a different XSE. I use 1.1
    Extension of a) and c)
    e)
    Problem: Player event not having correct offset
    Solution: Assign player event with new offset.

    Try those. If they don't fix it, then you are probably using the wrong rom (using snapshots are a problem sometimes). Hope this helps.
     
    Back
    Top