Xzeph 2 Posted February 6, 2013 So I was having this little problem, I have to go the opposite direction and back just to face a certain direction. It's kinda okay for me at first but then.... So I think it's time for a change, can someone kindly make a script that mimics the movement of Pokemon series? Like you don't need to move from one tile to another just to face a certain direction. I would be eternally grateful if someone could solve this "little problem" of mine. --- Sorry for my bad English. (n_n") Share this post Link to post Share on other sites
regendo 204 Posted February 6, 2013 class Game_Player < Game_Character def move_by_input return if !movable? || $game_map.interpreter.running? return unless Input.dir4 > 0 if Input.dir4 == direction move_straight(Input.dir4) else set_direction(Input.dir4) end end end Just like in the Pokémon series, it will be common that you still move instead of turning. This was unintended, but I don't know what to do about it. Share this post Link to post Share on other sites
marillmau5 20 Posted February 7, 2013 yeah i was going to say, only worked sometimes Share this post Link to post Share on other sites
Xzeph 2 Posted February 8, 2013 (edited) I've made a little script based from what you've given me, it's not much but it's more accurate. Oh, this is my first time to post one of my script in the forums. Yay! Okay, here it is: Pokemon Movement * Gave you both my special thanks... (n_n) Edited February 8, 2013 by Xzeph Share this post Link to post Share on other sites
marillmau5 20 Posted February 8, 2013 (edited) interesting ill see if i can event something to make it work. edit: halfway there got the turning working buy using set move route wait 10 frames. Demo: Its not perfect, if you are facing right and you turn left there's a 10 frame pause. whats happening is i dont know how to make the game check if left is being pressed (turn) or held down (moving). but technically its closer than nothing for now. Player Turn Movement (Eventing Test) I've made a little script based from what you've given me, it's not much but it's more accurate. Oh, this is my first time to post one of my script in the forums. Yay! Okay, here it is: Pokemon Movement * Gave you both my special thanks... (n_n) nice yours def works how i imagined it should! btw is there a way i can do a script call to force input delay like in your script for events, i want to check it out for other uses. Edited February 8, 2013 by marillmau5 Share this post Link to post Share on other sites
Xzeph 2 Posted February 10, 2013 Let me see what I can do. But I don't think there is an input delay on event movements with my script. But if you mean to set the input delay to zero, I can do that, pretty simple. I could do a switch to disable/enable the script instead. Share this post Link to post Share on other sites
marillmau5 20 Posted February 10, 2013 (edited) Hey! I hope they add your script to the master list. Maybe delay was the wrong wording I used. i was trying to see if I can use a "delay" script call or what you used to check if a player is pressing a button vs. if a player is holding a button. Its what made your script movement so fluent and not have awkward pausing between turns. on my eventing i had conditional branch if player is facing right conditional branch if player presses left set move route - player - turn left - wait 10 seconds This would make it so no matter where i turn theres always a 10 second pause If I removed that 10 seconds you'd have to tap the button so slightly just for it to work which is barely. Edited February 10, 2013 by marillmau5 Share this post Link to post Share on other sites
regendo 204 Posted February 10, 2013 I think Input.repeat?(sym) is used for this. From the help file: Input.repeat?(sym) (RGSS3) Determines whether the button corresponding to the symbol sym is currently being pressed again. Unlike trigger?, takes into account the repeated input of a button being held down continuously. If the button is being pressed, returns TRUE. If not, returns FALSE. 1 Share this post Link to post Share on other sites
Xzeph 2 Posted February 11, 2013 (edited) Does regendo's answer solved your problem, yet? I'm kinda bad in english so I was having a hard time understanding what you really need. You see, English is like my 3rd or 4th language, so I'm kinda weak at it. Wow, aren't I the one who was having the problem here? Now, I was like one of the "solvers". LoL Edited February 11, 2013 by Xzeph Share this post Link to post Share on other sites
marillmau5 20 Posted February 11, 2013 yeah your script works \o/ was just trying to figure something else out at the end, but all is solved Share this post Link to post Share on other sites
regendo 204 Posted February 11, 2013 Good to hear that it is what you wanted. Topic closed. Share this post Link to post Share on other sites