Jump to content
aircompressor

Permanently Remove Input Up

Recommended Posts

I would like to permanently remove the option for the player to move up for the whole game (for everything/always: Menus, gameplay, etc.)  Is this possible? Thanks

Share this post


Link to post
Share on other sites

Nooo! Not the up key! My down key is already broken, now you are going to take my up key as well?! You monster!

 

...Okay that joke didn't really make sense because you can remap keys to different inputs or use a gamepad anyway, buuut, yes. Yes it is possible. With scripting! The question is, can you be trusted with that power?

Share this post


Link to post
Share on other sites

That's not really what I was asking. I mean the only real reason to remove up as an input even in menus is to screw with the player right? Will you abuse your power? Punish the player unfairly? I don't know know if I can trust you not to inflict your sadistic whims on the player! ...That's my job! The player is my plaything! I called dibs!

 

Hmmm... Though it might be amusing to watch what you come up with... Okay fine, I guess I could try and make a little something for you... Though do you really want to just completely remove the up input? Were you thinking of being able to toggle it on and off? What's your plan here?

Share this post


Link to post
Share on other sites

I will not abuse the player. As a matter of fact, this will help the player (IMO). It's for my game on Kickstarter, A Dark Ice Saga: The Rescue. I am using the KHAS script for a platformer, and I noticed if you hold the up button with either the left or right button, (diagonal position on a game-pad) it forces the player to jump up only. During play testing, i noticed I hold both buttons as I would with other platformers or certain jumps ,like Mario,etc. Up button during game-play is not needed (only in the menus, but the down button works too.)

 

In a perfect world, I need the up button off for game-play but not for menus. Thanks for looking.

Share this post


Link to post
Share on other sites

There is not a diagonal script that I am aware of in the Khas Arc Engine. I didn't even notice this until very recent play testing on a gamepad, as I game test most of the time with the keyboard where I never use up when jumping, since the game player with this script only moves left or right, jumps, and uses a wall jump mechanic.

Share this post


Link to post
Share on other sites
Posted (edited)

A diagonal script wouldn't work since the whole movement system is being replaced anyway. It seems to me like the Khas Arc Engine thing probobly uses Input.dir4 instead of checking each button individually. Honestly, RPG Maker really isn't the best for platformers.  Or action RPGs. Yes people have made scripts to make RPG Maker do that. Problem is... all of the ones I have seen are awful buggy messes that just don't work right half the time, especially when you start adding new scripts.

 

Anyway let me take a look at this Arc Engine...

 

AH HA! I was right!

 

Look at the Arc Engine script starting at line 2769 (or so, might be off if it's not the same version I had, but you can find the line by searching for Input.dir4):

 

      case Input.dir4
      when 4
        @vx -= @key_acc
        set_direction(4)
        @deny_resistance = false
        r = (Input.press?(:SHIFT) ? Running_Resistance : Body_Resistance)
      when 6
        @vx += @key_acc
        set_direction(6)
        @deny_resistance = false
        r = (Input.press?(:SHIFT) ? Running_Resistance : Body_Resistance)
      else
        r = (@wallkick ? Body_Resistance : Stop_Resistance)
      end

Silly Khas... Try replacing that with:

      case
      when Input.press?(:LEFT)
        @vx -= @key_acc
        set_direction(4)
        @deny_resistance = false
        r = (Input.press?(:SHIFT) ? Running_Resistance : Body_Resistance)
      when Input.press?(:RIGHT)
        @vx += @key_acc
        set_direction(6)
        @deny_resistance = false
        r = (Input.press?(:SHIFT) ? Running_Resistance : Body_Resistance)
      else
        r = (@wallkick ? Body_Resistance : Stop_Resistance)
      end

Now doesn't that make so much more sense?


 

Edited by Kayzee

Share this post


Link to post
Share on other sites
Posted (edited)

Oh...there's a script out there that will disable directional movement...I know I've seen it, but I cannot recall the exact name, only who wrote it. TsukiHime.

@aircompressor This be it right here, not hosted on WP anymore.

Spoiler

=begin
#===============================================================================
 Title: Restricted Move Input
 Author: Tsukihime
 Date: Aug 31, 2013
--------------------------------------------------------------------------------
 ** Change log
 Aug 31, 2013
   - Initial release
--------------------------------------------------------------------------------   
 ** Terms of Use
 * Free to use in commercial/non-commercial projects
 * No real support. The script is provided as-is
 * Will do bug fixes, but no compatibility patches
 * Features may be requested but no guarantees, especially if it is non-trivial
 * Credits to Tsukihime in your project
 * Preserve this header
--------------------------------------------------------------------------------
 ** Description
 
 This script allows you to enable or disable movement for specific
 directions using script calls. When a direction is disabled, the player
 is unable to move in that direction on the map using the direction input keys.
 
--------------------------------------------------------------------------------
 ** Installation
 
 Place this script below Materials and above Main

--------------------------------------------------------------------------------
 ** Usage 

 The following script calls will enable or disable specific directions:
 
   disable_move_direction(dir_symbol)
   enable_move_direction(dir_symbol)
   
 Where the `dir_symbol`is one of the following
 
   :UP
   :LEFT
   :RIGHT
   :DOWN
   
--------------------------------------------------------------------------------
 ** Example
 
 To prevent players from moving up or down, use the script calls
 
   disable_move_direction(:UP)
   disable_move_direction(:DOWN)
   
 To enable them again, use the script calls
 
   enable_move_direction(:UP)
   enable_move_direction(:DOWN)
  
#===============================================================================
=end
$imported = {} if $imported.nil?
$imported["TH_RestrictedMoveInput"] = true
#===============================================================================
# ** Configuration
#===============================================================================
module TH
  module Restricted_Move_Input
    
    Input_Map = {
      :DOWN => 2,
      :LEFT => 4,
      :RIGHT => 6,
      :UP => 8
    }
  end
end
#===============================================================================
# ** Rest of Script
#===============================================================================
class Game_System
  
  def disabled_move_inputs
    @move_input_disabled ||= {}
  end
end

class Game_Interpreter
  
  def disable_move_direction(dir_symbol)
    dir = TH::Restricted_Move_Input::Input_Map[dir_symbol]
    $game_system.disabled_move_inputs[dir] = true
  end
  
  def enable_move_direction(dir_symbol)
    dir = TH::Restricted_Move_Input::Input_Map[dir_symbol]
    $game_system.disabled_move_inputs[dir] = false
  end
end

class Game_Player < Game_Character
  
  alias :th_linear_movement_move_by_input :move_by_input
  def move_by_input
    return if $game_system.disabled_move_inputs[Input.dir4]
    th_linear_movement_move_by_input
  end
end

 


Maybe this will work, I dunno. It will not as far as I can tell, disable menu stuffs.

Edited by PhoenixSoul
FOUND THE SCRIPT-I KNEW I HAD SEEN IT SOMEWHERE LMAO

Share this post


Link to post
Share on other sites

Yeah, looking at the code now that you found it, pretty sure that won't work right. Because 1. As I said, the movement code is totally rewritten, and 2. The problem wouldn't go away anyway, because Input.dir4 would still prioritize up over left and right, which is why the problem exists in the first place.

Share this post


Link to post
Share on other sites
21 hours ago, Kayzee said:

A diagonal script wouldn't work since the whole movement system is being replaced anyway. It seems to me like the Khas Arc Engine thing probobly uses Input.dir4 instead of checking each button individually. Honestly, RPG Maker really isn't the best for platformers.  Or action RPGs. Yes people have made scripts to make RPG Maker do that. Problem is... all of the ones I have seen are awful buggy messes that just don't work right half the time, especially when you start adding new scripts.

 

Anyway let me take a look at this Arc Engine...

 

AH HA! I was right!

 

Look at the Arc Engine script starting at line 2769 (or so, might be off if it's not the same version I had, but you can find the line by searching for Input.dir4):

 


      case Input.dir4
      when 4
        @vx -= @key_acc
        set_direction(4)
        @deny_resistance = false
        r = (Input.press?(:SHIFT) ? Running_Resistance : Body_Resistance)
      when 6
        @vx += @key_acc
        set_direction(6)
        @deny_resistance = false
        r = (Input.press?(:SHIFT) ? Running_Resistance : Body_Resistance)
      else
        r = (@wallkick ? Body_Resistance : Stop_Resistance)
      end

Silly Khas... Try replacing that with:


      case
      when Input.press?(:LEFT)
        @vx -= @key_acc
        set_direction(4)
        @deny_resistance = false
        r = (Input.press?(:SHIFT) ? Running_Resistance : Body_Resistance)
      when Input.press?(:RIGHT)
        @vx += @key_acc
        set_direction(6)
        @deny_resistance = false
        r = (Input.press?(:SHIFT) ? Running_Resistance : Body_Resistance)
      else
        r = (@wallkick ? Body_Resistance : Stop_Resistance)
      end

Now doesn't that make so much more sense?


 

!!!! THANKS !!! I adjusted the script as you suggested and after play testing it appears to be perfect! Thanks to everyone who took the time to help out!

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.

×