Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials

Notices
For all updates, view the main page.

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.



Reply
 
Thread Tools
  #1    
Old October 3rd, 2013 (03:06 AM). Edited October 9th, 2013 by FL.
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Code:
#===============================================================================
# * 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
Attached Thumbnails
setcontrolssscreen.png‎  
__________________
Reply With Quote
  #2    
Old October 3rd, 2013 (04:30 AM).
venom12's Avatar
venom12
Pokemon Crystal Rain Relased
 
Join Date: Sep 2006
Age: 23
Gender: Male
Nature: Adamant
Send a message via Windows Live Messenger to venom12
Nice script man :D I will check it right now :D
__________________
This signature has been disabled.
Exceeds signature height limit because of broken images.
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #3    
Old October 3rd, 2013 (08:45 AM).
zingzags's Avatar
zingzags
Creator or Pokemon Serenity
 
Join Date: Jan 2009
Location: Boston
Age: 20
Nature: Adamant
Now this is actually useful. This is something I have never thought about, yet I see it all the time when I play games.
__________________
Pokemon Serenity is my fangame name.
name decided 12/15/09
Currently helping:
Pokemon ebony
and
Xenotime:
Reply With Quote
  #4    
Old October 7th, 2013 (02:59 PM).
Tayuya of the Sound Four's Avatar
Tayuya of the Sound Four
 
Join Date: Jan 2013
Gender: Female
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
Reply With Quote
  #5    
Old October 9th, 2013 (03:00 PM).
Derxwna Kapsyla's Avatar
Derxwna Kapsyla
X-Class Project, Derxwna, #003
 
Join Date: Jun 2011
Location: Margate, FL
Age: 21
Gender: Male
Nature: Lax
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?
__________________
Development Blog:
For more information future news and updates to any projects, the following blogs are where I post information. You can usually hit me with a message there when it comes to bug reports or feedback, or general conversation about something.
Game Projects:
In Progress:
Reply With Quote
  #6    
Old October 9th, 2013 (05:10 PM).
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote originally posted by Derxwna Kapsyla:
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.
__________________
Reply With Quote
  #7    
Old October 12th, 2013 (03:36 PM).
krakacen's Avatar
krakacen
 
Join Date: Jan 2012
Location: Cancun, Mexico
Gender: Male
Nature: Relaxed
I followed the steps but when I close it opens the options menu
Reply With Quote
  #8    
Old October 13th, 2013 (06:57 AM).
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
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
      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
__________________
Reply With Quote
  #9    
Old October 13th, 2013 (07:04 AM).
the__end's Avatar
the__end
Pixel Artist
 
Join Date: Apr 2010
Gender: Male
This should be added to the next release of essentials! I mean this is awesome and you are awesome FL. for making this! :D
__________________
Reply With Quote
  #10    
Old November 2nd, 2013 (07:41 AM).
KingMB
 
Join Date: Oct 2013
Gender: Male
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:
Quote:
[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
Reply With Quote
  #11    
Old November 6th, 2013 (04:01 PM).
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote originally posted by KingMB:
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
Quote originally posted by FL .:
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.
----------------------------------
__________________
Reply With Quote
  #12    
Old November 7th, 2013 (01:09 PM).
KingMB
 
Join Date: Oct 2013
Gender: Male
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?
Attached Thumbnails
Screenshot.png‎  
Reply With Quote
  #13    
Old November 14th, 2013 (02:09 PM).
FL's Avatar
FL
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Quote originally posted by KingMB:
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:

Code:
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:

Code:
 scene=PokemonControlsScene.new
  screen=PokemonControls.new(scene)
  pbFadeOutIn(99999) {
    screen.pbStartScreen
  }
end
if Input.trigger?(Input::C) && @sprites["option"].index==@PokemonOptions.length+1
__________________
Reply With Quote
  #14    
Old January 14th, 2014 (10:32 AM).
MarvinLock's Avatar
MarvinLock
Starting with Pkmn Essentials!
 
Join Date: Jan 2014
Location: Greece
Gender: Male
Quote originally posted by FL:
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:

Code:
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:

Code:
 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.
Reply With Quote
  #15    
Old January 14th, 2014 (11:55 AM).
desbrina's Avatar
desbrina
Lightning Yellow Creator
 
Join Date: Feb 2011
Location: UK
Age: 26
Gender: Female
Nature: Quiet
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
__________________
Creator of


A Pokemon Yellow remake, using HGSS Tiles, and the ability to obtain all Kanto Pokemon as well as their previous/later evolutions.

Reply With Quote
  #16    
Old January 15th, 2014 (04:54 AM).
MarvinLock's Avatar
MarvinLock
Starting with Pkmn Essentials!
 
Join Date: Jan 2014
Location: Greece
Gender: Male
Quote originally posted by desbrina:
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.
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 02:00 PM.