Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - WSAD Movement
- # -- Author : Dekita
- # -- Version : 1.1
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:WSAD_Move]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # o4/o4/2o13 - Added Basic Directional Movement,
- # 27/o3/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # A simple script to allow for WSAD movement rather than the VX Ace default.
- #
- # If Paired with my $D13x Core Script, then it also allows most keyboard
- # keys to control the movement(rather then WSAD).
- #
- # Also allows for a very simple directional movement.
- #
- # NOTE : In Order for the customization options to work, you MUST
- # have the $D13x Core script.
- # The script will function fine without the core but it will be limited to
- # WSAD Controls.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # For a list of possible key symbols check the help section of the
- # $D13x core script.
- #
- #===============================================================================
- module WSAD_Move
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # ☆ Basic Settings
- #--------------------------------------------------------------------------
- # Make false to disable diagonal movement
- Allow_Diagonal_Move = true
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # ☆ Advanced Settings
- #--------------------------------------------------------------------------
- # ALL settings below Require my $D13x - Core to take effect !!
- Up = :W
- Down = :S
- Left = :A
- Right = :D
- # Make false to disable new sprint key overwrite
- OverWrite_Sprint_Key = true
- Sprint = :RSHIFT
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- module Input
- #===============================================================================
- #---------------------------------------------------------------------------
- # Dir4 Using $D13x Key Input
- #---------------------------------------------------------------------------
- def self.dir4
- return old_key_WSAD_dir4 unless $D13x[:CORE]
- return 2 if Keys.press?(Keys::Key[WSAD_Move::Down])
- return 4 if Keys.press?(Keys::Key[WSAD_Move::Left])
- return 6 if Keys.press?(Keys::Key[WSAD_Move::Right])
- return 8 if Keys.press?(Keys::Key[WSAD_Move::Up])
- return 0
- end
- #---------------------------------------------------------------------------
- # Dir4 using default Vx Ace Key Input
- #---------------------------------------------------------------------------
- def self.old_key_WSAD_dir4
- return 2 if Input.press?(:Y)
- return 4 if Input.press?(:X)
- return 6 if Input.press?(:Z)
- return 8 if Input.press?(:R)
- return 0
- end
- #---------------------------------------------------------------------------
- # Dir8 using $D13x Key Input
- #---------------------------------------------------------------------------
- def self.dir8
- return old_key_WSAD_dir8 unless $D13x[:CORE]
- d = Keys.press?(Keys::Key[WSAD_Move::Down])
- l = Keys.press?(Keys::Key[WSAD_Move::Left])
- r = Keys.press?(Keys::Key[WSAD_Move::Right])
- u = Keys.press?(Keys::Key[WSAD_Move::Up])
- return 1 if d && l
- return 3 if d && r
- return 7 if u && l
- return 9 if u && r
- return 2 if d
- return 4 if l
- return 6 if r
- return 8 if u
- return 0
- end
- #---------------------------------------------------------------------------
- # Dir8 using default Vx Ace Key Input
- #---------------------------------------------------------------------------
- def self.old_key_WSAD_dir8
- d = Input.press?(:Y)
- l = Input.press?(:X)
- r = Input.press?(:Z)
- u = Input.press?(:R)
- return 1 if d && l
- return 3 if d && r
- return 7 if u && l
- return 9 if u && r
- return 2 if d
- return 4 if l
- return 6 if r
- return 8 if u
- return 0
- end
- end
- #===============================================================================
- class Game_Player < Game_Character
- #===============================================================================
- if WSAD_Move::OverWrite_Sprint_Key
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- alias :new_dash? :dash?
- #--------------------------------------------------------------------------
- # Determine if Dashing (overwrite)
- #--------------------------------------------------------------------------
- def dash?
- return new_dash? unless $D13x[:CORE]
- return false if @move_route_forcing
- return false if $game_map.disable_dash?
- return false if vehicle
- return Keys.press?(Keys::Key[WSAD_Move::Sprint])
- end
- end # << WSAD_Move::OverWrite_Sprint_Key
- #--------------------------------------------------------------------------
- # Processing of Movement via Input from Directional Buttons
- #--------------------------------------------------------------------------
- if WSAD_Move::Allow_Diagonal_Move
- def move_by_input
- return if !movable? || $game_map.interpreter.running?
- case Input.dir8
- when 2, 4, 6, 8 then move_straight(Input.dir4)
- when 1 then move_diagonal(4, 2)
- when 3 then move_diagonal(6, 2)
- when 7 then move_diagonal(4, 8)
- when 9 then move_diagonal(6, 8)
- end
- end
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if false // true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement