The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script hide sprite without flag?

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 26th, 2018 (6:52 AM).
Dinisk's Avatar
Dinisk Dinisk is offline
DinisK
 
Join Date: Jan 2017
Gender: Male
Posts: 89
I want to create a script. The guard who won't let you in until you talk to Oak. After talking with the professor, the guard disappears. If there is no way, to use the clear flag(with its subsequent use), and this will result in a failed guard. if you can write a script?don't want to use flags for such little things.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old October 27th, 2018 (4:28 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
There are really only two ways to easily remove NPCs from their original positions: flags and variables. Flags are simple to use and make them disappear while variables can be checked in a level script that moves the NPC's position. For example, if you set variable 0x4011 to 0x1 while speaking to Professor Oak, you could put a type 03 or 05 level script in the map with the guard that looks like this:

Code:
#dynamic 0x800000

#org @start
checkvar 0x4011 0x1 // Checks the value of variable 0x4011
if 0x4 goto @Guard // If the value is greater than or equal to 0x1, go to @Guard
end

#org @Guard
movesprite2 0x1 0xFF 0xFF // Moves the OW to map coordinates 0xFF, 0xFF
end
The beautiful part of this script is that since you're checking if the variable is greater than or equal to 0x1, you can reuse the variable so long as it is never set back to 0x0. For example, there may be another guard that only disappears when 0x4011 is equal to 0x2. When you set the variable to 0x2 to get past the second guard, this first guard will still remain invisible.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old October 27th, 2018 (5:52 AM).
Dinisk's Avatar
Dinisk Dinisk is offline
DinisK
 
Join Date: Jan 2017
Gender: Male
Posts: 89
Quote:
Originally Posted by DrFuji View Post
There are really only two ways to easily remove NPCs from their original positions: flags and variables. Flags are simple to use and make them disappear while variables can be checked in a level script that moves the NPC's position. For example, if you set variable 0x4011 to 0x1 while speaking to Professor Oak, you could put a type 03 or 05 level script in the map with the guard that looks like this:

Code:
#dynamic 0x800000

#org @start
checkvar 0x4011 0x1 // Checks the value of variable 0x4011
if 0x4 goto @Guard // If the value is greater than or equal to 0x1, go to @Guard
end

#org @Guard
movesprite2 0x1 0xFF 0xFF // Moves the OW to map coordinates 0xFF, 0xFF
end
The beautiful part of this script is that since you're checking if the variable is greater than or equal to 0x1, you can reuse the variable so long as it is never set back to 0x0. For example, there may be another guard that only disappears when 0x4011 is equal to 0x2. When you set the variable to 0x2 to get past the second guard, this first guard will still remain invisible.
Thanks for the information. I will use a safe var.
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:18 AM.