Jump to content
sirbilly

Player Turn & Move

Recommended Posts

Player Turn & Move
Version: 1.0
Author: SirBilly (silentkingdom.com)
Date: 9 June 2013
 
Introduction
This Script makes your character turn and face the direction to move before moving in the chosen direction just like in the pokemon games.
 
 
Features

Ability to change delay time.

 
Screenshot
none
 

How to Use
Copy into materials, but above main
Plug'N'Play, with optional customization
 
 
Script
Get it here

 

Script to use with Khas Pixel Movement  - Get it here
Script to use with Sapphire Action System IV  - Get it here
 
Terms of Use
*  Free to use for both commercial and non-commercial projects.
 * Do not claim this as your own.
 * Crediting me in the game's credits would be appreciated.

 

  • Like 4

Share this post


Link to post
Share on other sites

Hey this is a really fantastic script, I think it adds a lot to the immersion in a game. I always hate when I coast around if I just want to turn and look in a certain direction at a certain location.

 

I have one question, maybe even a suggestion if it's not already a part of the script :P

 

Can I have it so that if I'm already turned in a certain direction, hitting the key won't delay? It will only delay if I'm turning in a direction I'm not facing? So I can quickly turn and then take a single step foreword just by tapping?

Share this post


Link to post
Share on other sites

Is there a way to change the delay value through a script call?

Share this post


Link to post
Share on other sites

Hey SirBilly. I really like this script! I think it adds a lot to my game. Thank you! Do you know if there is any way to make this compatible with a wsad direction input script (i'm using Falcao's Mouse System Buttons 2.5 at the moment). Thanks again!

Share this post


Link to post
Share on other sites
On 4/30/2022 at 7:19 AM, TheRamenGirl said:

Sadly this is not compatible

What part does not work? Sir billy script needs to be above galv jump.

The only issue I found was that while walking, if you turned it would not stop to turn before continuing.

I made some changes that should work. It did in my testing.

=begin
#=============================================================================== 
  Player Turn & Move (VXA)
  Author : SirBilly (silentkingdom.com)
  Version : 1.0
  Date : 9 June 2013
--------------------------------------------------------------------------------
  This Script makes your character turn and face the direction to move before 
  moving in the chosen direction just like in the pokemon games. 
  
  *Overwrites move_by_input method in Game_Player class.
#===============================================================================
 Instructions
--------------------------------------------------------------------------------
  To install this script, open up your script editor and copy/paste this script
  to an open slot below Materials but above Main.
#===============================================================================
 Terms of Use
--------------------------------------------------------------------------------
 * Free to use for both commercial and non-commercial projects.
 * Do not claim this as your own.
 * Crediting me in the game's credits would be appreciated.
#===============================================================================
=end
#===============================================================================
# * Script Configuration *
#===============================================================================
module SK
  module TURNANDMOVE
 #------------------------------------------------------------------------------
 # This is the delay time between the directional keys imput default is 7. 
 #------------------------------------------------------------------------------
  Delay_Time = 10
 #------------------------------------------------------------------------------
 # Note: works best when kept over 5 and under 10.
 #------------------------------------------------------------------------------
  end
 end
#===============================================================================
# * End of Configuration *
#===============================================================================
class Game_Player < Game_Character
#-------------------------------------------------------------------------------
# Frame Update For Wait Time
#-------------------------------------------------------------------------------
 alias sirbilly_turn_and_move_update update
  def update
    @wait_time = SK::TURNANDMOVE::Delay_Time if @wait_time == nil
    @wait_time -= 1 if @wait_time > 0
    @sbdir = 0 if @sbdir == nil
    sirbilly_turn_and_move_update
  end
#-------------------------------------------------------------------------------
# Movement via Input from Directional Buttons
#-------------------------------------------------------------------------------
  def move_by_input
    return if !movable? || $game_map.interpreter.running?
    case Input.dir4
    when 2 
      if Input.trigger?(:DOWN) && @sbdir != 2 && @wait_time == 0
        @wait_time = SK::TURNANDMOVE::Delay_Time 
        set_direction(2)
        @sbdir = 2
      elsif @sbdir != 2 && @wait_time == 0
        @wait_time = SK::TURNANDMOVE::Delay_Time 
        set_direction(2)
        @sbdir = 2
      elsif @wait_time == 0
        move_straight(2,true)
      end
    when 4
      if Input.trigger?(:LEFT) && @sbdir != 4 && @wait_time == 0
        @wait_time = SK::TURNANDMOVE::Delay_Time 
        set_direction(4)
        @sbdir = 4
      elsif @sbdir != 4 && @wait_time == 0
        @wait_time = SK::TURNANDMOVE::Delay_Time 
        set_direction(4)
        @sbdir = 4
      elsif @wait_time == 0
        move_straight(4,true)
      end
    when 6
      if Input.trigger?(:RIGHT) && @sbdir != 6 && @wait_time == 0
        @wait_time = SK::TURNANDMOVE::Delay_Time 
        set_direction(6)
        @sbdir = 6
      elsif @sbdir != 6 && @wait_time == 0
        @wait_time = SK::TURNANDMOVE::Delay_Time 
        set_direction(6)
        @sbdir = 6
      elsif @wait_time == 0
        move_straight(6,true)
      end
    when 8
      if Input.trigger?(:UP) && @sbdir != 8 && @wait_time == 0
        @wait_time = SK::TURNANDMOVE::Delay_Time 
        set_direction(8)
        @sbdir = 8
      elsif @sbdir != 8 && @wait_time == 0
        @wait_time = SK::TURNANDMOVE::Delay_Time 
        set_direction(8)
        @sbdir = 8
      elsif @wait_time == 0
        move_straight(8,true)
      end
    end
  end
end
#==============================================================================#
#                      http://silentkingdom.com/                               #
#==============================================================================#

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted