The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Script help, please

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 March 19th, 2017 (5:04 AM). Edited March 19th, 2017 by GingerGuy173.
GingerGuy173's Avatar
GingerGuy173 GingerGuy173 is offline
カミナ
 
Join Date: Mar 2017
Location: SC, United States
Age: 21
Gender: Male
Nature: Lax
Posts: 17
So... I'm hacking FireRed. I want to make an NPC that gives the player a Mystic Ticket (The item that lets you go to Navel Rock) if they have the National Pokedex. I did some research and found out that the flag for a National Pokedex is 16F. But for some reason, the NPC does not give the Ticket. Here's what I've written:

Spoiler:
'---------------
#org 0x166C17
faceplayer
lock
checkitem 0x172 0x1
compare LASTRESULT 0x1
if 0x1 goto @alreadyhas
checkflag 0x16F <===== This is where the problem seems to be.
compare LASTRESULT 0x1
if 0x1 goto 0x871E652
msgbox @MSGnotready MSG_FACE '"Gimme a sec... I saw something\nre..."
release
end

'---------
' Gotos
'---------
#org notready
msgbox @MSGnotready MSG_FACE '"Tell me what you find with\nthat t..."

#org @intro
msgbox @MSGintro MSG_YESNO '"Ah, there it is!......\nHuh? What ..."
compare LASTRESULT 0x0
if 0x1 goto @no
goto @yes

#org @no
msgbox 0x871E811 MSG_FACE '"Sigh... My hand is already getting..."

#org @yes
msgbox 0x871E7DA MSG_FACE '"Here you go! Tell me what\nyou fin..."
giveitem 0x172 0x1 MSG_OBTAIN
closeonkeypress

'---------
' Messages
'---------
#org @MSGnotready
= Gimme a sec... I saw something\nreally sparkly around here\psomewhere...

#org @MSGalreadyhas
= Tell me what you find with\nthat thing, alright?

#org @MSGintro
= Ah, there it is!......\nHuh? What was I looking for?\pWell, I found this really\nshiny ticket. I pressume\pit's for the VERMILION HARBOR\njust ahead. I'd use it, but you\psee, I'm kinda prone to sea-\nsickness.\pSo would you like\nto have it instead?

#org @MSGno
= Sigh... My hand is already getting\nsweaty holding this thing...

#org @MSGyes
= Here you go! Tell me what\nyou find with it, alright?


I see no reason why this shouldn't work. And the funny thing is, that when I delete the
"checkflag 0x16F
compare LASTRESULT 0x1
if 0x1 goto @intro"

part (the part that checks for the NatDex, the NPC gives you the Mystic Ticket just fine!

Any help would be greatly appreciated. I've been working quite literally all day to try to fix this, but to no avail.?
__________________

Keeping this crappy ol' profile picture and working around it because it's nostalgic.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old March 19th, 2017 (5:58 AM).
GreatFlameFTW's Avatar
GreatFlameFTW GreatFlameFTW is offline
Kamehameha!
 
Join Date: Feb 2017
Location: India
Age: 22
Gender: Male
Nature: Lonely
Posts: 30
Can you give me non complied version?

According to my knowledge I don't think after checkflag compare command is required.

The pointer of if 0x1 seems to be missing.
__________________
Hacks I am waiting for :

Gaia, Fat Kid, Discovery,

My hack : Pokemon Fantasy
Progress to Alpha-1 : 50%
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old March 19th, 2017 (12:53 PM).
GingerGuy173's Avatar
GingerGuy173 GingerGuy173 is offline
カミナ
 
Join Date: Mar 2017
Location: SC, United States
Age: 21
Gender: Male
Nature: Lax
Posts: 17
Quote:
Originally Posted by Charlie-X View Post
Can you give me non complied version?

According to my knowledge I don't think after checkflag compare command is required.

The pointer of if 0x1 seems to be missing.
This is the non-compiled version. It looks that way because I got used to writing them that way. :P
And thank you, I will try taking the compare command out, and let you know if it works.
__________________

Keeping this crappy ol' profile picture and working around it because it's nostalgic.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old March 19th, 2017 (1:13 PM).
PurpleOrange's Avatar
PurpleOrange PurpleOrange is offline
still don't know what I'm doing
 
Join Date: Sep 2013
Location: Littleroot Town (UK)
Age: 25
Gender: Male
Posts: 367
Quote:
Originally Posted by GingerGuy173 View Post
So... I'm hacking FireRed. I want to make an NPC that gives the player a Mystic Ticket (The item that lets you go to Navel Rock) if they have the National Pokedex. I did some research and found out that the flag for a National Pokedex is 16F. But for some reason, the NPC does not give the Ticket. Here's what I've written:

Spoiler:
'---------------
#org 0x166C17
faceplayer
lock
checkitem 0x172 0x1
compare LASTRESULT 0x1
if 0x1 goto @alreadyhas
checkflag 0x16F <===== This is where the problem seems to be.
compare LASTRESULT 0x1
if 0x1 goto 0x871E652
msgbox @MSGnotready MSG_FACE '"Gimme a sec... I saw something\nre..."
release
end

'---------
' Gotos
'---------
#org notready
msgbox @MSGnotready MSG_FACE '"Tell me what you find with\nthat t..."

#org @intro
msgbox @MSGintro MSG_YESNO '"Ah, there it is!......\nHuh? What ..."
compare LASTRESULT 0x0
if 0x1 goto @no
goto @yes

#org @no
msgbox 0x871E811 MSG_FACE '"Sigh... My hand is already getting..."

#org @yes
msgbox 0x871E7DA MSG_FACE '"Here you go! Tell me what\nyou fin..."
giveitem 0x172 0x1 MSG_OBTAIN
closeonkeypress

'---------
' Messages
'---------
#org @MSGnotready
= Gimme a sec... I saw something\nreally sparkly around here\psomewhere...

#org @MSGalreadyhas
= Tell me what you find with\nthat thing, alright?

#org @MSGintro
= Ah, there it is!......\nHuh? What was I looking for?\pWell, I found this really\nshiny ticket. I pressume\pit's for the VERMILION HARBOR\njust ahead. I'd use it, but you\psee, I'm kinda prone to sea-\nsickness.\pSo would you like\nto have it instead?

#org @MSGno
= Sigh... My hand is already getting\nsweaty holding this thing...

#org @MSGyes
= Here you go! Tell me what\nyou find with it, alright?


I see no reason why this shouldn't work. And the funny thing is, that when I delete the
"checkflag 0x16F
compare LASTRESULT 0x1
if 0x1 goto @intro"

part (the part that checks for the NatDex, the NPC gives you the Mystic Ticket just fine!

Any help would be greatly appreciated. I've been working quite literally all day to try to fix this, but to no avail.?
the compare is necessary, don't remove that at all.
the problem is, it isn't a flag that sets the national dex, it's a special command (0x16F) so you can't check if national dex is on using a checkflag (incidentally, flag 0x16F is used for an item in rocket hideout) you should replace the checkflag 0x16F etc. with this
Code:
special2 LASTRESULT 0x193
compare LASTRESULT 0x1
if 0x1 goto @intro
(on a side note if you want the mystic ticket to work at the ferry ports, make sure to setflag 0x84A :))
__________________

Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old March 19th, 2017 (5:50 PM).
GingerGuy173's Avatar
GingerGuy173 GingerGuy173 is offline
カミナ
 
Join Date: Mar 2017
Location: SC, United States
Age: 21
Gender: Male
Nature: Lax
Posts: 17
Quote:
Originally Posted by PurpleOrange View Post
the compare is necessary, don't remove that at all.
the problem is, it isn't a flag that sets the national dex, it's a special command (0x16F) so you can't check if national dex is on using a checkflag (incidentally, flag 0x16F is used for an item in rocket hideout) you should replace the checkflag 0x16F etc. with this
Code:
special2 LASTRESULT 0x193
compare LASTRESULT 0x1
if 0x1 goto @intro
(on a side note if you want the mystic ticket to work at the ferry ports, make sure to setflag 0x84A :))
Oh, finally... it worked. Thank you a ton! I spent like 7 hours the other day trying to figure this out, lol, so you're a life-saver.
__________________

Keeping this crappy ol' profile picture and working around it because it's nostalgic.
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old March 22nd, 2017 (12:29 PM).
Pinta87's Avatar
Pinta87 Pinta87 is offline
 
Join Date: Mar 2017
Posts: 56
Couldn't you also just set an additional "regular" flag in the script that gives you the national dex and have it check for that?
__________________
..
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:17 AM.