Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Reconfiguring the controls ?

Jason

Awesome Bro

Hi,

So I'm just wondering, is there any way that we could possibly reconfigure the controls, and I don't mean by pressing F1 (or F2, forgot lol), but by completely recoding which each button does, so for example, pressing ESC would bring you to the shutdown screen, pressing I will open your inventory, and so forth in that manner.

Is it possible, or just some crazy idea that doesn't work ?
 
I am sure you can, I will look into it to find out if you can...but I am pretty sure that you need a script for that. You could probably ask one of the scripters around here to make it, but I don't think that it is in the default scripts.
 

Jason

Awesome Bro

Yeah, I know it isn't in the default scripts, since I'll be needing an input module, but then I'll need a seperate script that can make calls to open specific scenes, I'm just not sure how I'd go about it. Hopefully someone can help me out though
 
First, I recomend you my Input module http://www.arpgmaker.com/viewtopic.php?f=11&t=59160.

And, for making the calls it depends from where(The scene you are) and when.

For example, opening the Inventory with I from the map:
Code:
class Scene_Map

  alias_method(:old_update, :update)

  def update

    old_update

    if Input.trigger?(Keys::I)

      $game_player.straighten

      $scene = Scene_Item.new

    end

  end

end

Or better this script, which will make you return to the map instand of the menu when you exit the inventory:
Code:
class Scene_Map

  alias_method(:old_update, :update)

  def update

    old_update

    if Input.trigger?(Keys::I)

      $game_player.straighten

      $scene = Scene_Item.new("Scene_Map.new")

    end

  end

end

 

class Scene_Item

  def initialize(return_scene = "Scene_Menu.new(0)")

    @return_scene = return_scene

  end

  def update_item

    if Input.trigger?(Input::B)

      $game_system.se_play($data_system.cancel_se)

      $scene = eval(@return_scene)

      return

    end

    if Input.trigger?(Input::C)

      @item = @item_window.item

      unless @item.is_a?(RPG::Item)

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      unless $game_party.item_can_use?(@item.id)

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      $game_system.se_play($data_system.decision_se)

      if @item.scope >= 3

        @item_window.active = false

        @target_window.x = (@item_window.index + 1) % 2 * 304

        @target_window.visible = true

        @target_window.active = true

        if @item.scope == 4 || @item.scope == 6

          @target_window.index = -1

        else

          @target_window.index = 0

        end

      else

        if @item.common_event_id > 0

          $game_temp.common_event_id = @item.common_event_id

          $game_system.se_play(@item.menu_se)

          if @item.consumable

            $game_party.lose_item(@item.id, 1)

            @item_window.draw_item(@item_window.index)

          end

          $scene = Scene_Map.new

          return

        end

      end

      return

    end

  end

end

If you want, tell me details and I will make it for you. Or if you want to do it yourself, I recomend you to search in the scene where the Input is called and add there modify the key you want to use, or add a method for a new call.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top