PDA

View Full Version : [Essentials script] Set the Controls Screen


FL
October 3rd, 2013, 03:06 AM
#===============================================================================
# * Set the Controls Screen - by FL (Credits will be apreciated)
#===============================================================================
#
# This script is for Pokémon Essentials. It's make a "Set the controls"
# option screen allowing the player to map the actions to the keys in keyboard,
# customizing the controls.
#
#===============================================================================
#
# To this script works, put it between PokemonControls and PokemonSystem.
#
# To this screen be displayed in the pause menu, in PokemonPauseMenu script,
# before line 'commands[cmdDebug=commands.length]=_INTL("Debug") if $DEBUG' add:
#
# cmdControls=-1
# commands[cmdControls=commands.length]=_INTL("Controls")
#
# Before line 'elsif cmdOption>=0 && command==cmdOption' add:
#
# elsif cmdControls>=0 && command==cmdControls
# scene=PokemonControlsScene.new
# screen=PokemonControls.new(scene)
# pbFadeOutIn(99999) {
# screen.pbStartScreen
# }
#
# Using the last five lines you can start this scene in other places like at
# an event.
#
# Note that this script, by default, doesn't allows the player to redefine some
# commands like F8 (screenshot key), but if the player assign an action to
# this key, like the "Run" action, this key will do this action AND take
# screenshots when pressed. Remember that F12 will reset the game.
#
#===============================================================================

module Keys
# Available keys
CONTROLSLIST = {
# Mouse buttons
_INTL("Backspace") => 0x08,
_INTL("Tab") => 0x09,
_INTL("Clear") => 0x0C,
_INTL("Enter") => 0x0D,
_INTL("Shift") => 0x10,
_INTL("Ctrl") => 0x11,
_INTL("Alt") => 0x12,
_INTL("Pause") => 0x13,
_INTL("Caps Lock") => 0x14,
# IME keys
_INTL("Esc") => 0x1B,
# More IME keys
_INTL("Space") => 0x20,
_INTL("Page Up") => 0x21,
_INTL("Page Down") => 0x22,
_INTL("End") => 0x23,
_INTL("Home") => 0x24,
_INTL("Left") => 0x25,
_INTL("Up") => 0x26,
_INTL("Right") => 0x27,
_INTL("Down") => 0x28,
_INTL("Select") => 0x29,
_INTL("Print") => 0x2A,
_INTL("Execute") => 0x2B,
_INTL("Print Screen") => 0x2C,
_INTL("Insert") => 0x2D,
_INTL("Delete") => 0x2E,
_INTL("Help") => 0x2F,
_INTL("0") => 0x30,
_INTL("1") => 0x31,
_INTL("2") => 0x32,
_INTL("3") => 0x33,
_INTL("4") => 0x34,
_INTL("5") => 0x35,
_INTL("6") => 0x36,
_INTL("7") => 0x37,
_INTL("8") => 0x38,
_INTL("9") => 0x39,
_INTL("A") => 0x41,
_INTL("B") => 0x42,
_INTL("C") => 0x43,
_INTL("D") => 0x44,
_INTL("E") => 0x45,
_INTL("F") => 0x46,
_INTL("G") => 0x47,
_INTL("H") => 0x48,
_INTL("I") => 0x49,
_INTL("J") => 0x4A,
_INTL("K") => 0x4B,
_INTL("L") => 0x4C,
_INTL("M") => 0x4D,
_INTL("N") => 0x4E,
_INTL("O") => 0x4F,
_INTL("P") => 0x50,
_INTL("Q") => 0x51,
_INTL("R") => 0x52,
_INTL("S") => 0x53,
_INTL("T") => 0x54,
_INTL("U") => 0x55,
_INTL("V") => 0x56,
_INTL("W") => 0x57,
_INTL("X") => 0x58,
_INTL("Y") => 0x59,
_INTL("Z") => 0x5A,
# Windows keys
_INTL("Numpad 0") => 0x60,
_INTL("Numpad 1") => 0x61,
_INTL("Numpad 2") => 0x62,
_INTL("Numpad 3") => 0x63,
_INTL("Numpad 4") => 0x64,
_INTL("Numpad 5") => 0x65,
_INTL("Numpad 6") => 0x66,
_INTL("Numpad 7") => 0x67,
_INTL("Numpad 8") => 0x68,
_INTL("Numpad 9") => 0x69,
_INTL("Multiply") => 0x6A,
_INTL("Add") => 0x6B,
_INTL("Separator") => 0x6C,
_INTL("Subtract") => 0x6D,
_INTL("Decimal") => 0x6E,
_INTL("Divide") => 0x6F,
_INTL("F1") => 0x70,
_INTL("F2") => 0x71,
_INTL("F3") => 0x72,
_INTL("F4") => 0x73,
_INTL("F5") => 0x74,
_INTL("F6") => 0x75,
_INTL("F7") => 0x76,
_INTL("F8") => 0x77,
_INTL("F9") => 0x78,
_INTL("F10") => 0x79,
_INTL("F11") => 0x7A,
_INTL("F12") => 0x7B,
_INTL("F13") => 0x7C,
_INTL("F14") => 0x7D,
_INTL("F15") => 0x7E,
_INTL("F16") => 0x7F,
_INTL("F17") => 0x80,
_INTL("F18") => 0x81,
_INTL("F19") => 0x82,
_INTL("F20") => 0x83,
_INTL("F21") => 0x84,
_INTL("F22") => 0x85,
_INTL("F23") => 0x86,
_INTL("F24") => 0x87,
_INTL("Num Lock") => 0x90,
_INTL("Scroll Lock") => 0x91,
# Multiple position Shift, Ctrl and Menu keys
_INTL(";:") => 0xBA,
_INTL("+") => 0xBB,
_INTL(",") => 0xBC,
_INTL("-") => 0xBD,
_INTL(".") => 0xBE,
_INTL("/?") => 0xBF,
_INTL("`~") => 0xC0,
_INTL("{") => 0xDB,
_INTL("\|") => 0xDC,
_INTL("}") => 0xDD,
_INTL("'\"") => 0xDE,
_INTL("AX") => 0xE1, # Japan only
_INTL("\|") => 0xE2
# Disc keys
}

# Here you can change the number of keys for each action and the
# default values
def self.defaultControls
return [
ControlConfig.new(_INTL("Down"),_INTL("Down")),
ControlConfig.new(_INTL("Left"),_INTL("Left")),
ControlConfig.new(_INTL("Right"),_INTL("Right")),
ControlConfig.new(_INTL("Up"),_INTL("Up")),
ControlConfig.new(_INTL("Action"),_INTL("C")),
ControlConfig.new(_INTL("Action"),_INTL("Enter")),
ControlConfig.new(_INTL("Action"),_INTL("Space")),
ControlConfig.new(_INTL("Cancel"),_INTL("X")),
ControlConfig.new(_INTL("Cancel"),_INTL("Esc")),
ControlConfig.new(_INTL("Run"),_INTL("Z")),
ControlConfig.new(_INTL("Scroll down"),_INTL("Page Down")),
ControlConfig.new(_INTL("Scroll up"),_INTL("Page Up")),
ControlConfig.new(_INTL("Registered/Sort"),_INTL("F5"))
]
end

def self.getKeyName(keyCode)
ret = CONTROLSLIST.index(keyCode)
return ret ? ret : (keyCode==0 ? _INTL("None") : "?")
end

def self.getKeyCode(keyName)
ret = CONTROLSLIST[keyName]
raise "The button #{keyName} no longer exists! " if !ret
return ret
end

def self.detectKey
loop do
Graphics.update
Input.update
for keyCode in CONTROLSLIST.values
return keyCode if Input.triggerex?(keyCode)
end
end
end
end

class ControlConfig
attr_reader :controlAction
attr_accessor :keyCode

def initialize(controlAction,defaultKey)
@controlAction = controlAction
@keyCode = Keys.getKeyCode(defaultKey)
end

def keyName
return Keys.getKeyName(@keyCode)
end
end

module Input
class << self
alias :buttonToKeyOldFL :buttonToKey
# Here I redefine this method with my controlAction.
# Note that I don't declare action for all commands.
def buttonToKey(button)
$PokemonSystem = PokemonSystem.new if !$PokemonSystem
case button
when Input::DOWN
return $PokemonSystem.getGameControlCodes(_INTL("Down"))
when Input::LEFT
return $PokemonSystem.getGameControlCodes(_INTL("Left"))
when Input::RIGHT
return $PokemonSystem.getGameControlCodes(_INTL("Right"))
when Input::UP
return $PokemonSystem.getGameControlCodes(_INTL("Up"))
when Input::A # Z, Shift
return $PokemonSystem.getGameControlCodes(_INTL("Run"))
when Input::B # X, ESC
return $PokemonSystem.getGameControlCodes(_INTL("Cancel"))
when Input::C # C, ENTER, Space
return $PokemonSystem.getGameControlCodes(_INTL("Action"))
when Input::L # Page Up
return $PokemonSystem.getGameControlCodes(_INTL("Scroll up"))
when Input::R # Page Down
return $PokemonSystem.getGameControlCodes(_INTL("Scroll down"))
# when Input::SHIFT
# return [0x10] # Shift
# when Input::CTRL
# return [0x11] # Ctrl
# when Input::ALT
# return [0x12] # Alt
when Input::F5 # F5
return $PokemonSystem.getGameControlCodes(_INTL("Registered/Sort"))
# when Input::F6
# return [0x75] # F6
# when Input::F7
# return [0x76] # F7
# when Input::F8
# return [0x77] # F8
# when Input::F9
# return [0x78] # F9
else
return buttonToKeyOldFL(button)
end
end
end
end

class Window_PokemonControls < Window_DrawableCommand
attr_reader :readingInput
attr_reader :controls
attr_reader :changed

def initialize(controls,x,y,width,height)
@controls=controls
@nameBaseColor=Color.new(88,88,80)
@nameShadowColor=Color.new(168,184,184)
@selBaseColor=Color.new(24,112,216)
@selShadowColor=Color.new(136,168,208)
@readingInput=false
@changed=false
super(x,y,width,height)
end

def setNewInput(newInput)
@readingInput = false
return if @controls[@index].keyCode==newInput
for control in @controls # Remove the same input for the same array
control.keyCode = 0 if control.keyCode==newInput
end
@controls[@index].keyCode=newInput
@changed = true
refresh
end

def itemCount
return @controls.length+2
end

def drawItem(index,count,rect)
rect=drawCursor(index,rect)
optionname = ""
if index==(@controls.length+1)
optionname = _INTL("Exit")
elsif index==(@controls.length)
optionname = _INTL("Default")
else
optionname = @controls[index].controlAction
end
optionwidth=(rect.width*9/20)
pbDrawShadowText(self.contents,rect.x,rect.y,optionwidth,rect.height,
optionname,@nameBaseColor,@nameShadowColor)
self.contents.draw_text(rect.x,rect.y,optionwidth,rect.height,optionname)
return if index>=@controls.length
value=@controls[index].keyName
xpos=optionwidth+rect.x
pbDrawShadowText(self.contents,xpos,rect.y,optionwidth,rect.height,value,
@selBaseColor,@selShadowColor)
self.contents.draw_text(xpos,rect.y,optionwidth,rect.height,value)
end

def update
dorefresh=false
oldindex=self.index
super
dorefresh=self.index!=oldindex
if self.active && self.index<=@controls.length
if Input.trigger?(Input::C)
if self.index == @controls.length # Default
@controls = Keys.defaultControls
@changed = true
dorefresh = true
else
@readingInput = true
end
end
end
refresh if dorefresh
end
end

class PokemonControlsScene
def pbUpdate
pbUpdateSpriteHash(@sprites)
end

def pbStartScene
@sprites={}
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@sprites["title"]=Window_UnformattedTextPokemon.newWithSize(
_INTL("Controls"),0,0,Graphics.width,64,@viewport)
@sprites["textbox"]=Kernel.pbCreateMessageWindow
@sprites["textbox"].letterbyletter=false
gameControls = []
for control in $PokemonSystem.gameControls
gameControls.push(control.clone)
end
@sprites["controlwindow"]=Window_PokemonControls.new(gameControls,0,
@sprites["title"].height,Graphics.width,
Graphics.height-@sprites["title"].height-@sprites["textbox"].height)
@sprites["controlwindow"].viewport=@viewport
@sprites["controlwindow"].visible=true
@changed = false
pbDeactivateWindows(@sprites)
pbFadeInAndShow(@sprites) { pbUpdate }
end

def pbMain
pbActivateWindow(@sprites,"controlwindow"){
loop do
Graphics.update
Input.update
pbUpdate
exit = false
if @sprites["controlwindow"].readingInput
@sprites["textbox"].text=_INTL("Press a new key.")
@sprites["controlwindow"].setNewInput(Keys.detectKey)
@sprites["textbox"].text=""
@changed = true
else
if Input.trigger?(Input::B) || (Input.trigger?(Input::C) &&
@sprites["controlwindow"].index==(
@sprites["controlwindow"].itemCount-1))
exit = true
if(@sprites["controlwindow"].changed &&
Kernel.pbConfirmMessage(_INTL("Save changes?")))
@sprites["textbox"].text = "" # Visual effect
newControls = @sprites["controlwindow"].controls
emptyCommand = false
for control in newControls
emptyCommand = true if control.keyCode == 0
end
if emptyCommand
@sprites["textbox"].text=_INTL("Fill all fields!")
exit = false
else
$PokemonSystem.gameControls = newControls
end
end
end
end
break if exit
end
}
end

def pbEndScene
pbFadeOutAndHide(@sprites) { pbUpdate }
Kernel.pbDisposeMessageWindow(@sprites["textbox"])
pbDisposeSpriteHash(@sprites)
@viewport.dispose
end
end

class PokemonControls
def initialize(scene)
@scene=scene
end

def pbStartScreen
@scene.pbStartScene
@scene.pbMain
@scene.pbEndScene
end
end

class PokemonSystem
attr_accessor :gameControls
def gameControls
@gameControls = Keys.defaultControls if !@gameControls
return @gameControls
end

def getGameControlCodes(controlAction)
ret = []
for control in gameControls
ret.push(control.keyCode) if control.controlAction == controlAction
end
return ret
end
end

venom12
October 3rd, 2013, 04:30 AM
Nice script man :D I will check it right now :D

zingzags
October 3rd, 2013, 08:45 AM
Now this is actually useful. This is something I have never thought about, yet I see it all the time when I play games.

Tayuya of the Sound Four
October 7th, 2013, 02:59 PM
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
October 9th, 2013, 03:00 PM
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
---------------------------
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
October 9th, 2013, 05:10 PM
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
---------------------------
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.

krakacen
October 12th, 2013, 03:36 PM
I followed the steps but when I close it opens the options menu

FL
October 13th, 2013, 06:57 AM
You probably done something wrong. Check if your def pbStartPokemonMenu at PokemonPauseMenu script section looks like this:

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
command=@scene.pbShowCommands(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
October 13th, 2013, 07:04 AM
This should be added to the next release of essentials! I mean this is awesome and you are awesome FL. for making this! :D

KingMB
November 2nd, 2013, 07:41 AM
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
November 6th, 2013, 04:01 PM
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.
----------------------------------

KingMB
November 7th, 2013, 01:09 PM
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
November 14th, 2013, 02:09 PM
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=(index==@options.length) ? _INTL("Cancel") : @options[index].name' to:

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


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

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

MarvinLock
January 14th, 2014, 10:32 AM
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=(index==@options.length) ? _INTL("Cancel") : @options[index].name' to:

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


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

scene=PokemonControlsScene.new
screen=PokemonControls.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
}
end
if Input.trigger?(Input::C) && @sprites["option"].index==@PokemonOptions.length+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.

desbrina
January 14th, 2014, 11:55 AM
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
January 15th, 2014, 04:54 AM
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.