The PokéCommunity Forums  

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

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 September 30th, 2019 (4:46 PM). Edited September 30th, 2019 by Aelthir.
Aelthir Aelthir is offline
 
Join Date: Sep 2019
Posts: 7
I am trying to make a script to turn the player around if they try to enter a door I placed in Oak's lab (Fire Red). The script seems to work in the beginning, before trying to leave Pallet Town, but after Oak brings you to his lab it no longer works. Here is my code so far.
Spoiler:
Code:
#dynamic 0x800000

#org @start
lock
checkflag 0x2B
if 0x1 goto @gone
applymovement 0x4 @excl
waitmovement 0x0
msgbox @1 0x6
applymovement 0x4 @down
waitmovement 0x0
applymovement 0xFF @step
waitmovement 0x0
release
end

#org @gone
msgbox @2 0x6
applymovement 0xFF @step
waitmovement 0x0
release
end

#org @excl
#raw 0x3
#raw 0x62
#raw 0xFE

#org @1
= [blue_fr]OAK: I have important research\nback there!\pPlease keep out!

#org @2
= You don't know what's back there!\pBest not to snoop around!

#org @down
#raw 0x0
#raw 0xFE

#org @step
#raw 0x0
#raw 0x10
#raw 0xFE

I am attempting to use flag 0x2B to check if Oak is there or not, as that is his ID in that map. To summarize, the issue I'm having SEEMS to be that after this line
Code:
if 0x1 goto @gone
if the flag is set (Oak is hidden), it operates as intended. If the flag is not set (Oak is visible in the lab), the script appears to do nothing which I take to mean that it terminates after reading the if statement.
Any help or suggestions are appreciated!
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old October 2nd, 2019 (10:54 PM).
Aelthir Aelthir is offline
 
Join Date: Sep 2019
Posts: 7
After a bit more research while developing other parts of my hack, I realized the problem. This tile script I placed was using var 0x4050, which the value is changed to 0x1 after the first time you meet Prof Oak. (found that tidbit here

Since the tile script stops working when the value is changed, it gave me the impression that the problem was with the flag or the code logic. In any case, I switched to a different var and the problem was resolved. (at least for now)
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.