The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Other Script/routine to check maptype

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 January 16th, 2016 (1:02 PM). Edited January 26th, 2016 by C me.
C me's Avatar
C me C me is offline
Creator of Pokemon League Of Legends
 
Join Date: Jan 2014
Age: 26
Gender: Male
Posts: 681
My main problem with my teleport item script is that it doesn't check if you are in a route/city/inside/etc so it can be used anywhere. I want to know if there is any script/asm routine that checks that map's type so it won't allow you to use it indoors/underground.

I don't really care if the player wants to use it in a house but if you use it mid event you could prevent yourself from being able to complete the game which is a huge problem. The event maps are labelled as indoors so having this check would solve the problem.

I've tried looking for the TELEPORT routine via the 'return to last healing spot' text but I couldn't find anything around the text pointer I could understand. The check it does I think is the same as the one in Fly which is good because I don't want the player to be able to use the item in places you can't normally fly.

Thank You


The solution is here.
__________________
Check out my hack: Pokemon League of Legends.
Join the subreddit: https://www.reddit.com/r/PokemonLoL/
If you would like to give me money for no reason you can do so here
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old January 16th, 2016 (11:13 PM).
Le pug's Avatar
Le pug Le pug is offline
Creator of Pokémon: Discovery / Fat Kid
 
Join Date: Aug 2013
Location: Le bed
Age: 30
Gender: Male
Nature: Bold
Posts: 870
Not good at ASM so I can't really help ya but I do know where you can check out the data for what byte the type of map is under ... maybe it'll help on your journey?
Spoiler:
__________________
Retired. Thank you guys for a wonderful five years.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old January 17th, 2016 (2:41 AM).
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
You can load and compare the byte at 0x2036E13. That's the same byte which is checked by HM Fly and such in FR.
__________________
...
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old January 17th, 2016 (2:49 AM). Edited January 17th, 2016 by C me.
C me's Avatar
C me C me is offline
Creator of Pokemon League Of Legends
 
Join Date: Jan 2014
Age: 26
Gender: Male
Posts: 681
I don't know ASM either...I can't do anything with that byte since its a different offset for each map so I can't use a check for a specific byte at an offset.

I'll look into the TELEPORT text string pointer again because there must be something there. If you're inside or something it won't display that text but will jump to 'Can't use that here'.

|Thanks for the help.

Edit: Didn't see FBI's post, we must have been typing at the same time.
Quote:
Originally Posted by FBI View Post
You can load and compare the byte at 0x2036E13. That's the same byte which is checked by HM Fly and such in FR.
Why would it be in RAM? I thought the byte was set in ROM with the map header data.

I'll look into the byte to see if it works, but first I need breakfast xD
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old January 17th, 2016 (3:04 AM).
Blah's Avatar
Blah Blah is offline
Free supporter
 
Join Date: Jan 2013
Location: Unknown Island
Gender: Male
Posts: 1,924
Quote:
Originally Posted by C me View Post
I don't know ASM either...I can't do anything with that byte since its a different offset for each map so I can't use a check for a specific byte at an offset.

I'll look into the TELEPORT text string pointer again because there must be something there. If you're inside or something it won't display that text but will jump to 'Can't use that here'.

|Thanks for the help.

Edit: Didn't see FBI's post, we must have been typing at the same time.


Why would it be in RAM? I thought the byte was set in ROM with the map header data.

I'll look into the byte to see if it works, but first I need breakfast xD
That's the current map header. So there's a data structure in RAM for the map header for the map you're currently in. When the player attempts to use an HM like Fly or something like dig, this data structure is referenced. It's got other useful things too, but anyways, that's one of the reasons why it's in RAM. Alternatively, you could use a ROM offset, but it'd be more work and you would probably need to check the current map anyways (i.e reference this RAM structure anyways).
__________________
...
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old January 17th, 2016 (5:10 AM). Edited January 17th, 2016 by C me.
C me's Avatar
C me C me is offline
Creator of Pokemon League Of Legends
 
Join Date: Jan 2014
Age: 26
Gender: Male
Posts: 681
Oh wait, was that RAM location for FireRed? Forgot to say it's for Emerad.

So looking at breakpoints for the teleport routine and I keep getting 0x1B55ED which is close to where the 'healing spot' text pointer is at 0x1b55b4.
__________________
Check out my hack: Pokemon League of Legends.
Join the subreddit: https://www.reddit.com/r/PokemonLoL/
If you would like to give me money for no reason you can do so here
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:10 AM.