The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script JPAN's Special 0x7/0x8

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old October 28th, 2017 (4:56 AM). Edited October 28th, 2017 by Lunos.
Lunos's Avatar
Lunos Lunos is offline
Random Uruguayan User
 
Join Date: Oct 2008
Location: Montevideo (Uruguay)
Gender: Male
Nature: Lonely
Posts: 3,000
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.


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.
__________________
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old October 30th, 2017 (4:04 AM).
TheHunterManX's Avatar
TheHunterManX TheHunterManX is offline
 
Join Date: Jul 2015
Gender: Male
Posts: 92
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:
#erase 0x71BBA0 0x169
#dynamic 0x71BBA0
#org @start
lock
faceplayer
countpokemon
compare LASTRESULT 0x0
if 0x1 goto @snippet1
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
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.
#org @nothing

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.
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:15 AM.