The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Other (Red) Pushing the player downwards while surfing

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 February 9th, 2016 (7:31 PM). Edited February 10th, 2016 by epseta.
epseta's Avatar
epseta epseta is offline
Don't let your memes be dreams.
 
Join Date: Apr 2015
Location: Realm 6.2
Gender: Male
Posts: 8
Hello.

I've set up a room so that when the player is surfing, he automatically goes downwards. Here's a crude diagram of what I'm trying to convey:

PW
WW
WW
XX


where P is the player facing right, W is water, and X is dry land. When the player gets on his pokemon and surfs, he'll initially go right as normally, but then he'll be forced downward on the blue path until he reaches the red X, as if by a current. I've gotten that part down, but I have two problems that I cannot solve:

1. Here's an excerpt of the script that forces the player downward when sloping:

LD A, ($C45C) ; check tile under player
CP $14 ; is it water?
JP NZ, $3219 ; if not, then jump away to address irrelevant for this question
LD A, $80 ; down
LD ($CCD3), A ; simulated joypad states end
LD A, $01 ; one simulated button press
LD ($CD38), A ; simulated joypad states index
CALL $3486 ; start simulating joypad states

He'll go down automatically, but if I hold any other button, he'll go in that direction as well. This is a similar effect to what happens in the Cycling Road. How do I make sure that he'll always go down and only down when he's surfing, no matter what buttons are pressed?

EDIT (2/10/16, 2:38 PM): RESOLVED.

2. The player will eventually reach land and will stop, but the game still thinks he's surfing, i.e. 0xD700 is set to $02. If the player goes further inland, the game then realizes he's walking and goes back to normal. I want the player to stop surfing and begin walking as soon as he reaches land, without having a button being pressed. How do I do that?
EDIT (2/10/16, 6:23 PM): RESOLVED.

Thanks in advance for any help you give.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old February 10th, 2016 (9:48 AM).
INDIAN MEW(ARAZI)'s Avatar
INDIAN MEW(ARAZI) INDIAN MEW(ARAZI) is offline
THE WORLDS MOST DUMB MAN
 
Join Date: Mar 2015
Location: Sleeping in clouds.
Gender: Male
Nature: Relaxed
Posts: 399
did you just cheked the behavior byte on advance map.
__________________
MY DEVIANT ART
http://arazitheman.deviantart.com
RUMOUR RED(FIRE RED BASE)
https://www.pokecommunity.com/showthread.php?t=396639
A2z GUIDE
http://www.pokemonhackersonline.com/showthread.php?t=15772-A2z-PokeRED-a-guide-for-fire-red
START LEARNING C,C++ OR PYTHON FOR FREE
https://www.sololearn.com

Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old February 10th, 2016 (11:25 AM).
epseta's Avatar
epseta epseta is offline
Don't let your memes be dreams.
 
Join Date: Apr 2015
Location: Realm 6.2
Gender: Male
Posts: 8
I don't know what you are talking about.
Is Advance Map a Gen 3 tool? Because my problem is for Gen 1 Red.

I've seen something on pokered about $CD6B being the address that controls what buttons are ignored, and the Viridian Gym arrows set this byte to $FF (all buttons) when you step on them. Maybe this has something to do with it? I'll try it out.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old February 10th, 2016 (3:42 PM).
Crystal_ Crystal_ is offline
 
Join Date: Feb 2013
Location: Spain
Gender: Male
Posts: 170
Button presses can be ignored by writing to the wJoyIgnore register which is indeed at address $cd6b, so from what I'm seeing I looks like you have already sorted this out.

Quote:
2. The player will eventually reach land and will stop, but the game still thinks he's surfing, i.e. 0xD700 is set to $02. If the player goes further inland, the game then realizes he's walking and goes back to normal. I want the player to stop surfing and begin walking as soon as he reaches land, without having a button being pressed. How do I do that?
If button presses are being simulated while surfing the collision checks are skipped. So while they're being simulated (bit 7 of wd730 is set), it will never be detected that the character has collided with land and should stop surfing. If I'm understanding you correctly, the step you take after reaching land is the first non-simulated button press so it gets caught here, clearing bit 7 of wd730 allowing the game to notice the collision.

I'm not absolutely sure, but I don't think there's anywhere in the game where button presses are simulated while surfing, so unless I'm missing something it's probably safe to remove that check from CollisionCheckOnWater (plus that's probably just a fail safe to prevent scripted movements from freezing if a collision occurs). If you're not confident with this solution you could use some flag so that the check is skipped in the circumstances that you want (you could set the flag when your custom simulated movements starts for example, then reset it when you step on land).
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:08 AM.