Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tapping the movement keys does not allow movement #218

Open
Karth-Xyver opened this issue Jan 31, 2024 · 2 comments
Open

Tapping the movement keys does not allow movement #218

Karth-Xyver opened this issue Jan 31, 2024 · 2 comments

Comments

@Karth-Xyver
Copy link

When you try to move in the direction you're facing by tapping the corresponding movement key, the movement is not registered.

nomove.webm

You have to hold the movement key for the movement input to be recognized.

Due to update_command_new running even when standing still, @lastdir = dir is always set to 0 so the logic does not work properly.

I naively fixed it like this. I think it makes sense to run this part of the code only when there is movement to process, but I'm not confident enough in it to make it a PR.

diff --git a/Data/Scripts/004_Game classes/008_Game_Player.rb b/Data/Scripts/004_Game classes/008_Game_Player.rb
index 8f49870b..e9746a8c 100644
--- a/Data/Scripts/004_Game classes/008_Game_Player.rb	
+++ b/Data/Scripts/004_Game classes/008_Game_Player.rb	
@@ -432,11 +432,11 @@ class Game_Player < Game_Character
     dir = Input.dir4
     if $PokemonGlobal.forced_movement?
       move_forward
-    elsif !pbMapInterpreterRunning? && !$game_temp.message_window_showing &&
+    elsif dir > 0 && !pbMapInterpreterRunning? && !$game_temp.message_window_showing &&
           !$game_temp.in_mini_update && !$game_temp.in_menu
       # Move player in the direction the directional button is being pressed
       if @moved_last_frame ||
-         (dir > 0 && dir == @lastdir && System.uptime - @lastdirframe >= 0.075)
+         (dir == @lastdir && System.uptime - @lastdirframe >= 0.075)
         case dir
         when 2 then move_down
         when 4 then move_left
yesmove.webm
@Conmh
Copy link
Contributor

Conmh commented Jan 31, 2024

It does seem like you fixed something minor, but can you still turn on the spot with this modification?

@Karth-Xyver
Copy link
Author

Yes, turning on the spot is not affected:

canturn.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants