• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script: [v12+] Set the Controls Screen

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
gif.gif
screen.png

Creates a "Set the controls" screen on pause menu, allowing the player to map the actions to the keys in keyboard, ignoring the values defined on F1. You can also define the default controls.

Link

Tested on Essentials v20.1 and v21.1. More versions on link. If this script isn't working on latest Essentials version, please inform on this thread.
 
Last edited:

venom12

Pokemon Crystal Rain Relased
476
Posts
17
Years
  • Age 33
  • Seen Dec 28, 2023
Nice script man :D I will check it right now :D
 

zingzags

PokemonGDX creator
536
Posts
15
Years
Now this is actually useful. This is something I have never thought about, yet I see it all the time when I play games.
 
31
Posts
11
Years
  • Seen Nov 9, 2013
Oh my god thank you...My laptop's right arrow key doesn't work so you can imagine aside from adding an entirely new control scheme to the controls script I wasn't having a very fun time... ~<3
 

Derxwna Kapsyla

Derxwna "The Badman" Kapsyla
437
Posts
12
Years
So I added in the controls script, and last night it seemed to be working. It's still working now, but whenever I boot the game which has it added in, this happens
Code:
---------------------------
Touhoumon Faith & Prayer Version 1.8
---------------------------
[ArgumentError, "undefined class/module ControlConfig", ["Section058:2098:in `oldload'", 

"Section058:2098:in `load'", "Section134:58:in `pbSetUpSystem'", "Section134:54:in `open'", 

"Section134:54:in `pbSetUpSystem'", "Section134:150"]]
---------------------------
OK   
---------------------------
Any clue what this means?
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
So I added in the controls script, and last night it seemed to be working. It's still working now, but whenever I boot the game which has it added in, this happens
Code:
---------------------------
Touhoumon Faith & Prayer Version 1.8
---------------------------
[ArgumentError, "undefined class/module ControlConfig", ["Section058:2098:in `oldload'", 

"Section058:2098:in `load'", "Section134:58:in `pbSetUpSystem'", "Section134:54:in `open'", 

"Section134:54:in `pbSetUpSystem'", "Section134:150"]]
---------------------------
OK   
---------------------------
Any clue what this means?
Problem at module Input redefinition order. The redefinition at PokemonSystem should be after class ControlConfig definition.

To solve this, just put it between PokemonControls and PokemonSystem.
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
You probably done something wrong. Check if your def pbStartPokemonMenu at PokemonPauseMenu script section looks like this:

Code:
  def pbStartPokemonMenu
    @scene.pbStartScene
    endscene=true
    pbSetViableDexes
    commands=[]
    cmdPokedex=-1
    cmdPokemon=-1
    cmdBag=-1
    cmdTrainer=-1
    cmdSave=-1
    cmdOption=-1
    cmdPokegear=-1
    cmdDebug=-1
    cmdQuit=-1
    if !$Trainer
      if $DEBUG
        Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
        Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
      end
      return
    end
    commands[cmdPokedex=commands.length]=_INTL("Pokédex") if $Trainer.pokedex && $PokemonGlobal.pokedexViable.length>0
    commands[cmdPokemon=commands.length]=_INTL("Pokémon") if $Trainer.party.length>0
    commands[cmdBag=commands.length]=_INTL("Bag") if !pbInBugContest?
    commands[cmdPokegear=commands.length]=_INTL("Pokégear") if $Trainer.pokegear
    commands[cmdTrainer=commands.length]=$Trainer.name
    if pbInSafari?
      if SAFARISTEPS<=0
        @scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount))
      else
        @scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}",pbSafariState.steps,SAFARISTEPS,pbSafariState.ballcount))
      end
      commands[cmdQuit=commands.length]=_INTL("Quit")
    elsif pbInBugContest?
      if pbBugContestState.lastPokemon
        @scene.pbShowInfo(_INTL("Caught: {1}\nLevel: {2}\nBalls: {3}",
           PBSpecies.getName(pbBugContestState.lastPokemon.species),
           pbBugContestState.lastPokemon.level,
           pbBugContestState.ballcount))
      else
        @scene.pbShowInfo(_INTL("Caught: None\nBalls: {1}",pbBugContestState.ballcount))
      end
      commands[cmdQuit=commands.length]=_INTL("Quit")
    else
      commands[cmdSave=commands.length]=_INTL("Save") if !$game_system || !$game_system.save_disabled
    end
    commands[cmdOption=commands.length]=_INTL("Options")
    cmdControls=-1
    commands[cmdControls=commands.length]=_INTL("Controls")
    commands[cmdDebug=commands.length]=_INTL("Debug") if $DEBUG
    commands[commands.length]=_INTL("Exit")
    loop do
      [email protected](commands)
      if cmdPokedex>=0 && command==cmdPokedex
        if DEXDEPENDSONLOCATION
          pbFadeOutIn(99999) {
             scene=PokemonPokedexScene.new
             screen=PokemonPokedex.new(scene)
             screen.pbStartScreen
             @scene.pbRefresh
          }
        else
          if $PokemonGlobal.pokedexViable.length==1
            $PokemonGlobal.pokedexDex=$PokemonGlobal.pokedexViable[0]
            $PokemonGlobal.pokedexDex=-1 if $PokemonGlobal.pokedexDex==$PokemonGlobal.pokedexUnlocked.length-1
            pbFadeOutIn(99999) {
               scene=PokemonPokedexScene.new
               screen=PokemonPokedex.new(scene)
               screen.pbStartScreen
               @scene.pbRefresh
            }
          else
            pbLoadRpgxpScene(Scene_PokedexMenu.new)
          end
        end
      elsif cmdPokegear>=0 && command==cmdPokegear
        pbLoadRpgxpScene(Scene_Pokegear.new)
      elsif cmdPokemon>=0 && command==cmdPokemon
        sscene=PokemonScreen_Scene.new
        sscreen=PokemonScreen.new(sscene,$Trainer.party)
        hiddenmove=nil
        pbFadeOutIn(99999) { 
           hiddenmove=sscreen.pbPokemonScreen
           if hiddenmove
             @scene.pbEndScene
           else
             @scene.pbRefresh
           end
        }
        if hiddenmove
          Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
          return
        end
      elsif cmdBag>=0 && command==cmdBag
        item=0
        scene=PokemonBag_Scene.new
        screen=PokemonBagScreen.new(scene,$PokemonBag)
        pbFadeOutIn(99999) { 
           item=screen.pbStartScreen 
           if item>0
             @scene.pbEndScene
           else
             @scene.pbRefresh
           end
        }
        if item>0
          Kernel.pbUseKeyItemInField(item)
          return
        end
      elsif cmdTrainer>=0 && command==cmdTrainer
        PBDebug.logonerr {
           scene=PokemonTrainerCardScene.new
           screen=PokemonTrainerCard.new(scene)
           pbFadeOutIn(99999) { 
              screen.pbStartScreen
              @scene.pbRefresh
           }
        }
      elsif cmdQuit>=0 && command==cmdQuit
        @scene.pbHideMenu
        if pbInSafari?
          if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
            @scene.pbEndScene
            pbSafariState.decision=1
            pbSafariState.pbGoToStart
            return
          else
            pbShowMenu
          end
        else
          if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
            @scene.pbEndScene
            pbBugContestState.pbStartJudging
            return
          else
            pbShowMenu
          end
        end
      elsif cmdSave>=0 && command==cmdSave
        @scene.pbHideMenu
        scene=PokemonSaveScene.new
        screen=PokemonSave.new(scene)
        if screen.pbSaveScreen
          @scene.pbEndScene
          endscene=false
          break
        else
          pbShowMenu
        end
      elsif cmdDebug>=0 && command==cmdDebug
        pbFadeOutIn(99999) { 
           pbDebugMenu
           @scene.pbRefresh
        }
      elsif cmdControls>=0 && command==cmdControls
        scene=PokemonControlsScene.new       
        screen=PokemonControls.new(scene)
        pbFadeOutIn(99999) {
           screen.pbStartScreen
        }
      elsif cmdOption>=0 && command==cmdOption
        scene=PokemonOptionScene.new
        screen=PokemonOption.new(scene)
        pbFadeOutIn(99999) {
           screen.pbStartScreen
           pbUpdateSceneMap
           @scene.pbRefresh
        }
      else
        break
      end
    end
    @scene.pbEndScene if endscene
  end
 

the__end

Pixel Artist
141
Posts
13
Years
  • Seen Jun 9, 2016
This should be added to the next release of essentials! I mean this is awesome and you are awesome FL. for making this! :D
 
5
Posts
10
Years
  • Age 46
  • Seen Apr 11, 2022
Hello, I'm using this nice script, and so far it's function without Problem, but...
when I start the Editor, i get the following message:
[Argument Error, "undefined class/module ControlConfig", [Section015:2098:in 'oldload'", [Section015:2098:in 'load'", "Section029:58:in 'pbSetUpSystem'", "Section029:54:in 'open'", "Section029:54:in 'pbSetUpSystem'", "Section029:150"]]
When I click ok, I can use the Editor, but sometimes I can get the message in between the Editor. Hope somebody can help
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
Hello, I'm using this nice script, and so far it's function without Problem, but...
when I start the Editor, i get the following message:

When I click ok, I can use the Editor, but sometimes I can get the message in between the Editor. Hope somebody can help

Problem at module Input redefinition order. The redefinition at PokemonSystem should be after class ControlConfig definition.

To solve this, just put it between PokemonControls and PokemonSystem.
----------------------------------
 
5
Posts
10
Years
  • Age 46
  • Seen Apr 11, 2022
And thats exact the Position where I have put it, so it can't be the Problem... I've put a Screenshot as attachment, so you can see it is where it has to be.

Edit: is it possible, to this in Options the Option Menu?
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
And thats exact the Position where I have put it, so it can't be the Problem... I've put a Screenshot as attachment, so you can see it is where it has to be.

Edit: is it possible, to this in Options the Option Menu?
I didn't read the "Editor" in your post, my fault. To fix this, just open the editor scripts (rename "EditorScripts" to "Scripts" at data folder and open the RPG Maker) and put this script between the two other scripts.

To put this script at option menu: At PokemonOptions script section, change line 'return @options.length+1' to 'return @options.length+2'. Change line 'optionname=([email protected]) ? _INTL("Cancel") : @options[index].name' to:

Code:
optionname=nil
    if [email protected]+1
      optionname=_INTL("Cancel")
    elsif [email protected]
      optionname=_INTL("Controls")
    else
      optionname=@options[index].name
    end


Change line 'return if [email protected]' to 'return if index>[email protected]'. After line 'if Input.trigger?(Input::C) && @sprites["option"][email protected]' add:

Code:
 scene=PokemonControlsScene.new
  screen=PokemonControls.new(scene)
  pbFadeOutIn(99999) {
    screen.pbStartScreen
  }
end
if Input.trigger?(Input::C) && @sprites["option"][email protected]+1
 

MarvinLock

Starting with Pkmn Essentials!
50
Posts
10
Years
I didn't read the "Editor" in your post, my fault. To fix this, just open the editor scripts (rename "EditorScripts" to "Scripts" at data folder and open the RPG Maker) and put this script between the two other scripts.

To put this script at option menu: At PokemonOptions script section, change line 'return @options.length+1' to 'return @options.length+2'. Change line 'optionname=([email protected]) ? _INTL("Cancel") : @options[index].name' to:

Code:
optionname=nil
    if [email protected]+1
      optionname=_INTL("Cancel")
    elsif [email protected]
      optionname=_INTL("Controls")
    else
      optionname=@options[index].name
    end


Change line 'return if [email protected]' to 'return if index>[email protected]'. After line 'if Input.trigger?(Input::C) && @sprites["option"][email protected]' add:

Code:
 scene=PokemonControlsScene.new
  screen=PokemonControls.new(scene)
  pbFadeOutIn(99999) {
    screen.pbStartScreen
  }
end
if Input.trigger?(Input::C) && @sprites["option"][email protected]+1


I had the same problem with the Editor and tried doing what you said (except for renaming "EditorScripts" to "Scripts" as there was already a file called "Scripts") but it didn't work. I still get the same error.
 
772
Posts
13
Years
  • Age 35
  • UK
  • Seen Apr 19, 2024
You need to move or rename scripts, then rename editor scripts to scripts. Make the changed then rename the scripts back to editor scripts then move or rename the original scripts.

The scripts file is used by the game, editor scripts is used by the editor. Rmxp reads the file called scripts so to edit the editors scripts it must be named scripts
 

MarvinLock

Starting with Pkmn Essentials!
50
Posts
10
Years
You need to move or rename scripts, then rename editor scripts to scripts. Make the changed then rename the scripts back to editor scripts then move or rename the original scripts.

The scripts file is used by the game, editor scripts is used by the editor. Rmxp reads the file called scripts so to edit the editors scripts it must be named scripts

Thanks for your help. I did what you said but the problem remains the for some reason.
 
11
Posts
8
Years
  • Age 24
  • Seen Jul 29, 2016
Could add an option to the use Walk Run Button 'S' and the use of the optional Pokemon Following the 'CTRL' and 'A' and 'D'?
Thank you, sorry work ...
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
Could add an option to the use Walk Run Button 'S' and the use of the optional Pokemon Following the 'CTRL' and 'A' and 'D'?
Thank you, sorry work ...
Add as new buttons on module Input (as constant and at buttonToKey method) and at defaultControls method.
 
5
Posts
8
Years
  • Age 21
  • Seen Jan 29, 2016
Hello, FL, I do not know if this well written and I speak Spanish and I am translating this with google translator.

As I was leaving, I insert this script between PSystem_Controls and PSystem_System and when testing the game this message to me error Set_Controls script on line 170 of SyntaxError type and do not know how to fix it, because if I'm not wrong SyntaxError is While not copy the script and copy it well

The script is Set_controls as I put the script to know it was that
 

FL

Pokémon Island Creator
2,444
Posts
13
Years
  • Seen Apr 22, 2024
Hello, FL, I do not know if this well written and I speak Spanish and I am translating this with google translator.

As I was leaving, I insert this script between PSystem_Controls and PSystem_System and when testing the game this message to me error Set_Controls script on line 170 of SyntaxError type and do not know how to fix it, because if I'm not wrong SyntaxError is While not copy the script and copy it well

The script is Set_controls as I put the script to know it was that
PokéCommunity is breaking codes. For copying scripts at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
 
Back
Top