¡Bienvenid@ a Mundo Maker!

¿Quieres aprender todo sobre el RPG Maker?



Regístrate y forma parte de Mundo Maker.
Conectarse

Recuperar mi contraseña

Temas importantes
----------------------------------------
Páginas con recursos RPG Maker
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
----------------------------------------
Últimos temas
» Hola mucho gusto
por Hk Diamond Hoy a las 13:49

» [AYUDA]Hootshot de moghunter
por Rudy_kinneas Hoy a las 12:03

» Holaaa a tod@s!!!
por nacho Hoy a las 09:47

» SoraDeathss se presenta!
por chronoMxx Hoy a las 07:50

» {AYUDA}Blizz-ABS Script
por chronoMxx Hoy a las 06:45

» las cosas como son...
por Bleuw Hoy a las 04:18

» Busco artistas graficos para proyecto serio
por Rudy_kinneas Ayer a las 20:52

» Duda con música en RPG MV
por Fleabass Ayer a las 20:25

» Recopilación de páginas con recursos RPG Maker
por RiKennedy-Maker Ayer a las 20:00

» [DUDA] Titulo de RPGM XP con varias imagenes
por Wecoc Ayer a las 08:38

Afiliados
Estadísticas
Tenemos 3381 miembros registrados.
El último usuario registrado es Hk Diamond.

Nuestros miembros han publicado un total de 79749 mensajes en 11244 argumentos.
Navega con Google Chrome
[DESCARGA]

[XP] Notebook System

 :: RPG Maker :: Scripts

Ver el tema anterior Ver el tema siguiente Ir abajo

RPG Maker XP [XP] Notebook System

Mensaje por Wecoc el 2015-01-10, 13:30

Adapté un script de WecTex para hacer rápidamente ésta base. El problema es que no sé portarla a VX Ace que es lo que pedían en otro post, pero seguramente alguien podrá hacerlo.

Primero de todo, requiere el script Glitchfinder's Key Input Module, que es compatible con todos los RPG maker. Lo que hace éste script es permitir usar todas las teclas en el juego, no solo Z, X, C...

Código:
#------------------------------------------------------------------------------
# Glitchfinder's Key Input Module
#    Version 1.00
#------------------------------------------------------------------------------
#==============================================================================
# * Method List
#==============================================================================
#  Keys.update
#    Updates keyboard input. Calls to this method are not necessary unless the
#    default Input module is not being updated.
#
#  Keys.press?(key)
#    Determines whether the button determined by key is currently being
#    pressed. If the button is being pressed, returns true. If not, returns
#    false.
#
#  Keys.trigger?(key)
#    Determines whether the button determined by key is being pressed again.
#    "Pressed again" is seen as time having passed between the button being not
#    pressed and being pressed. If the button is being pressed, returns true.
#    If not, returns false.
#
#  Keys.repeat?(key)
#    Determines whether the button determined by key is being pressed again.
#    Unlike trigger?(), this takes into account the repeat input of a button
#    being held down continuously. If the button is being pressed, returns
#    true. If not, returns false.
#
#  Keys.release?(key)
#    Determines whether the button determined by key has just been released. If
#    the button has been released, returns true. If not, returns false.
#==============================================================================
# * Contact
#==============================================================================
#  Glitchfinder, the author of this script, may be contacted through his
#  website, found at http://www.glitchkey.com
#
#  You may also find Glitchfinder at http://www.hbgames.org
#==============================================================================
# * Usage
#==============================================================================
#  This script may be used with the following terms and conditions:
#
#    1. This script is free to use in any noncommercial project. If you wish to
#      use this script in a commercial (paid) project, please contact
#      Glitchfinder at his website.
#    2. This script may only be hosted at the following domains:
#        http://www.glitchkey.com
#        http://www.hbgames.org
#    3. If you wish to host this script elsewhere, please contact Glitchfinder.
#    4. If you wish to translate this script, please contact Glitchfinder. He
#      will need the web address that you plan to host the script at, as well
#      as the language this script is being translated to.
#    5. This header must remain intact at all times.
#    6. Glitchfinder remains the sole owner of this code. He may modify or
#      revoke this license at any time, for any reason.
#    7. Any code derived from code within this script is owned by Glitchfinder,
#      and you must have his permission to publish, host, or distribute his
#      code.
#    8. This license applies to all code derived from the code within this
#      script.
#    9. If you use this script within your project, you must include visible
#      credit to Glitchfinder, within reason.
#==============================================================================

#==============================================================================
# ** Keys
#------------------------------------------------------------------------------
#  This module performs key input processing
#==============================================================================

module Keys
  #--------------------------------------------------------------------------
  # * Miscellaneous Keys
  #--------------------------------------------------------------------------
  CANCEL              = 0x03 # Control-Break Processing
  BACKSPACE          = 0x08 # Backspace Key
  TAB                = 0x09 # Tab Key
  CLEAR              = 0x0C # Clear Key
  RETURN              = 0x0D # Enter Key
  SHIFT              = 0x10 # Shift Key
  CONTROL            = 0x11 # Ctrl Key
  MENU                = 0x12 # Alt Key
  PAUSE              = 0x13 # Pause Key
  ESCAPE              = 0x1B # Esc Key
  CONVERT            = 0x1C # IME Convert Key
  NONCONVERT          = 0x1D # IME Nonconvert Key
  ACCEPT              = 0x1E # IME Accept Key
  SPACE              = 0x20 # Space Bar Key (Space, usually blank)
  PRIOR              = 0x21 # Page Up Key
  NEXT                = 0x22 # Page Down Key
  ENDS                = 0x23 # End Key
  HOME                = 0x24 # Home Key
  LEFT                = 0x25 # Left Arrow Key
  UP                  = 0x26 # Up Arrow Key
  RIGHT              = 0x27 # Right Arrow Key
  DOWN                = 0x28 # Down Arrow Key
  SELECT              = 0x29 # Select Key
  PRINT              = 0x2A # Print Key
  EXECUTE            = 0x2B # Execute Key
  SNAPSHOT            = 0x2C # Print Screen Key
  DELETE              = 0x2E # Delete Key
  HELP                = 0x2F # Help Key
  LSHIFT              = 0xA0 # Left Shift Key
  RSHIFT              = 0xA1 # Right Shift Key
  LCONTROL            = 0xA2 # Left Control Key (Ctrl)
  RCONTROL            = 0xA3 # Right Control Key (Ctrl)
  LMENU              = 0xA4 # Left Menu Key (Alt)
  RMENU              = 0xA5 # Right Menu Key (Alt)
  PACKET              = 0xE7 # Used to Pass Unicode Characters as Keystrokes
  #--------------------------------------------------------------------------
  # * Number Keys
  #--------------------------------------------------------------------------
  N0                  = 0x30 # 0 Key
  N1                  = 0x31 # 1 Key
  N2                  = 0x32 # 2 Key
  N3                  = 0x33 # 3 Key
  N4                  = 0x34 # 4 Key
  N5                  = 0x35 # 5 Key
  N6                  = 0x36 # 6 Key
  N7                  = 0x37 # 7 Key
  N8                  = 0x38 # 8 Key
  N9                  = 0x39 # 9 Key
  #--------------------------------------------------------------------------
  # * Letter Keys
  #--------------------------------------------------------------------------
  A                  = 0x41 # A Key
  B                  = 0x42 # B Key
  C                  = 0x43 # C Key
  D                  = 0x44 # D Key
  E                  = 0x45 # E Key
  F                  = 0x46 # F Key
  G                  = 0x47 # G Key
  H                  = 0x48 # H Key
  I                  = 0x49 # I Key
  J                  = 0x4A # J Key
  K                  = 0x4B # K Key
  L                  = 0x4C # L Key
  M                  = 0x4D # M Key
  N                  = 0x4E # N Key
  O                  = 0x4F # O Key
  P                  = 0x50 # P Key
  Q                  = 0x51 # Q Key
  R                  = 0x52 # R Key
  S                  = 0x53 # S Key
  T                  = 0x54 # T Key
  U                  = 0x55 # U Key
  V                  = 0x56 # V Key
  W                  = 0x57 # W Key
  X                  = 0x58 # X Key
  Y                  = 0x59 # Y Key
  Z                  = 0x5A # Z Key
  #--------------------------------------------------------------------------
  # * Windows Keys
  #--------------------------------------------------------------------------
  LWIN                = 0x5B # Left Windows Key (Natural keyboard)
  RWIN                = 0x5C # Right Windows Key (Natural Keyboard)
  APPS                = 0x5D # Applications Key (Natural keyboard)
  SLEEP              = 0x5F # Computer Sleep Key
  BROWSER_BACK        = 0xA6 # Browser Back Key
  BROWSER_FORWARD    = 0xA7 # Browser Forward Key
  BROWSER_REFRESH    = 0xA8 # Browser Refresh Key
  BROWSER_STOP        = 0xA9 # Browser Stop Key
  BROWSER_SEARCH      = 0xAA # Browser Search Key
  BROWSER_FAVORITES  = 0xAB # Browser Favorites Key
  BROWSER_HOME        = 0xAC # Browser Start and Home Key
  VOLUME_MUTE        = 0xAD # Volume Mute Key
  VOLUME_DOWN        = 0xAE # Volume Down Key
  VOLUME_UP          = 0xAF # Volume Up Key
  MEDIA_NEXT_TRACK    = 0xB0 # Next Track Key
  MEDIA_PREV_TRACK    = 0xB1 # Previous Track Key
  MEDIA_STOP          = 0xB2 # Stop Media Key
  MEDIA_PLAY_PAUSE    = 0xB3 # Play/Pause Media Key
  LAUNCH_MAIL        = 0xB4 # Start Mail Key
  LAUNCH_MEDIA_SELECT = 0xB5 # Select Media Key
  LAUNCH_APP1        = 0xB6 # Start Application 1 Key
  LAUNCH_APP2        = 0xB7 # Start Application 2 Key
  PROCESSKEY          = 0xE5 # IME Process Key
  ATTN                = 0xF6 # Attn Key
  CRSEL              = 0xF7 # CrSel Key
  EXSEL              = 0xF8 # ExSel Key
  EREOF              = 0xF9 # Erase EOF Key
  PLAY                = 0xFA # Play Key
  ZOOM                = 0xFB # Zoom Key
  PA1                = 0xFD # PA1 Key
  #--------------------------------------------------------------------------
  # * Number Pad Keys
  #--------------------------------------------------------------------------
  NUMPAD0            = 0x60 # Numeric Keypad 0 Key
  NUMPAD1            = 0x61 # Numeric Keypad 1 Key
  NUMPAD2            = 0x62 # Numeric Keypad 2 Key
  NUMPAD3            = 0x63 # Numeric Keypad 3 Key
  NUMPAD4            = 0x64 # Numeric Keypad 4 Key
  NUMPAD5            = 0x65 # Numeric Keypad 5 Key
  NUMPAD6            = 0x66 # Numeric Keypad 6 Key
  NUMPAD7            = 0x67 # Numeric Keypad 7 Key
  NUMPAD8            = 0x68 # Numeric Keypad 8 Key
  NUMPAD9            = 0x69 # Numeric Keypad 9 Key
  MULTIPLY            = 0x6A # Multiply Key (*)
  ADD                = 0x6B # Add Key (+)
  SEPARATOR          = 0x6C # Separator Key
  SUBTRACT            = 0x6D # Subtract Key (-)
  DECIMAL            = 0x6E # Decimal Key (.)
  DIVIDE              = 0x6F # Divide Key (/)
  #--------------------------------------------------------------------------
  # * Function Keys
  #--------------------------------------------------------------------------
  F1                  = 0x70 # F1 Key
  F2                  = 0x71 # F2 Key
  F3                  = 0x72 # F3 Key
  F4                  = 0x73 # F4 Key
  F5                  = 0x74 # F5 Key
  F6                  = 0x75 # F6 Key
  F7                  = 0x76 # F7 Key
  F8                  = 0x77 # F8 Key
  F9                  = 0x78 # F9 Key
  F10                = 0x79 # F10 Key
  F11                = 0x7A # F11 Key
  F12                = 0x7B # F12 Key
  F13                = 0x7C # F13 Key
  F14                = 0x7D # F14 Key
  F15                = 0x7E # F15 Key
  F16                = 0x7F # F16 Key
  F17                = 0x80 # F17 Key
  F18                = 0x81 # F18 Key
  F19                = 0x82 # F19 Key
  F20                = 0x83 # F20 Key
  F21                = 0x84 # F21 Key
  F22                = 0x85 # F22 Key
  F23                = 0x86 # F23 Key
  F24                = 0x87 # F24 Key
  #--------------------------------------------------------------------------
  # * Toggle Keys
  #--------------------------------------------------------------------------
  CAPITAL            = 0x14 # Caps Lock Key
  KANA                = 0x15 # IME Kana Mode Key
  HANGUL              = 0x15 # IME Hangul Mode Key
  JUNJA              = 0x17 # IME Junja Mode Key
  FINAL              = 0x18 # IME Final Mode Key
  HANJA              = 0x19 # IME Hanja Mode Key
  KANJI              = 0x19 # IME Kanji Mode Key
  MODECHANGE          = 0x1F # IME Mode Change Request Key
  INSERT              = 0x2D # Insert Key
  NUMLOCK            = 0x90 # Num Lock Key
  SCROLL              = 0x91 # Scroll Lock Key
  #--------------------------------------------------------------------------
  # * OEM Keys (Vary by keyboard)
  #--------------------------------------------------------------------------
  OEM_1              = 0xBA # Misc Characters (; : in USA 101/102 Keyboards)
  OEM_PLUS            = 0xBB # + = Key
  OEM_COMMA          = 0xBC # , < Key
  OEM_MINUS          = 0xBD # - _ Key
  OEM_PERIOD          = 0xBE # . > Key
  OEM_2              = 0xBF # Misc Characters (/ ? in USA 101/102 Keyboards)
  OEM_3              = 0xC0 # Misc Characters (` ~ in USA 101/102 Keyboards)
  OEM_4              = 0xDB # Misc Characters ([ { in USA 101/102 Keyboards)
  OEM_5              = 0xDC # Misc Characters (\ | in USA 101/102 Keyboards)
  OEM_6              = 0xDD # Misc Characters (] } in USA 101/102 Keyboards)
  OEM_7              = 0xDE # Misc Characters (' " in USA 101/102 Keyboards)
  OEM_8              = 0xDF # Misc Characters (Varies by Keyboard)
  OEM_9              = 0xE1 # OEM Specific
  OEM_10              = 0x92 # OEM Specific
  OEM_11              = 0x93 # OEM Specific
  OEM_12              = 0x94 # OEM Specific
  OEM_13              = 0x95 # OEM Specific
  OEM_14              = 0x96 # OEM Specific
  OEM_15              = 0xE3 # OEM Specific
  OEM_16              = 0xE4 # OEM Specific
  OEM_17              = 0xE6 # OEM Specific
  OEM_18              = 0xE9 # OEM Specific
  OEM_19              = 0xEA # OEM Specific
  OEM_20              = 0xEB # OEM Specific
  OEM_21              = 0xEC # OEM Specific
  OEM_22              = 0xED # OEM Specific
  OEM_23              = 0xEE # OEM Specific
  OEM_24              = 0xEF # OEM Specific
  OEM_25              = 0xF1 # OEM Specific
  OEM_26              = 0xF2 # OEM Specific
  OEM_27              = 0xF3 # OEM Specific
  OEM_28              = 0xF4 # OEM Specific
  OEM_29              = 0xF5 # OEM Specific
  OEM_102            = 0xE2 # Angle Bracket or Backslash on RT-102 Keyboards
  OEM_CLEAR          = 0xFE # Clear Key
  #--------------------------------------------------------------------------
  # * Declare Module Variables
  #--------------------------------------------------------------------------
  # Create string for unpacking input
  @unpack_string = 'b'*256
  # Generate blank input arrays
  @last_array = '0'*256
  @press = Array.new(256, false)
  @trigger = Array.new(256, false)
  @repeat = Array.new(256, false)
  @release = Array.new(256, false)
  # Generate blank counter array
  @repeat_counter = Array.new(256, 0)
  # Declare keyboard API
  @getKeyboardState = Win32API.new('user32', 'GetKeyboardState', ['P'], 'V')
  @getAsyncKeyState = Win32API.new('user32', 'GetAsyncKeyState', 'i', 'i')
  # Call current keyboard state
  @getKeyboardState.call(@last_array)
  # Set previous keyboard state
  @last_array = @last_array.unpack(@unpack_string)
  # Cycle through keys
  for i in 0...@last_array.size
    # Set pressed key state
    @press[i] = @getAsyncKeyState.call(i) == 0 ? false : true
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def self.update
    # Clear input arrays
    @trigger = Array.new(256, false)
    @repeat = Array.new(256, false)
    @release = Array.new(256, false)
    # create blank input array
    array = '0'*256
    # Call current keyboard state
    @getKeyboardState.call(array)
    # Unpack key array
    array = array.unpack(@unpack_string)
    # Cycle through all keys
    for i in 0...array.size
      # If the current key state does not match the previous state
      if array[i] != @last_array[i]
        # Set current key state
        @press[i] = @getAsyncKeyState.call(i) == 0 ? false : true
        # If the repeat counter is at 0
        if @repeat_counter[i] <= 0 && @press[i]
          # Set the key to repeat
          @repeat[i] = true
          # Set the repeat counter to 15 frames
          @repeat_counter[i] = 15
        end
        # If the key is not being pressed
        if !@press[i]
          # Set the key to released
          @release[i] = true
        # If the key is being pressed
        else
          # Set the key to triggered
          @trigger[i] = true
        end
      # If the key state is the same
      else
        # If the key is set to pressed
        if @press[i] == true
          # Set the current key state
          @press[i] = @getAsyncKeyState.call(i) == 0 ? false : true
          # Set the key to released if it is no longer being pressed
          @release[i] = true if !@press[i]
        end
        # If the repeat counter is greater than 0 and the key is pressed
        if @repeat_counter[i] > 0 && @press[i] == true
          # Cycle the repeat counter down one frame
          @repeat_counter[i] -= 1
        # If the repeat counter is 0 or less and the key is pressed
        elsif @repeat_counter[i] <= 0 && @press[i] == true
          # Set the key to repeat
          @repeat[i] = true
          # Set the repeat counter to 15 frames
          @repeat_counter[i] = 3
        # If the repeat counter does not equal 0
        elsif @repeat_counter[i] != 0
          # Set the repeat counter to 0
          @repeat_counter[i] = 0
        end
      end
    end
    # Set the previous keyboard state
    @last_array = array
  end
  #--------------------------------------------------------------------------
  # * Get Key Pressed State
  #    key : key index
  #--------------------------------------------------------------------------
  def self.press?(key)
    # Return key pressed state
    return @press[key]
  end
  #--------------------------------------------------------------------------
  # * Get Key Triggered State
  #    key : key index
  #--------------------------------------------------------------------------
  def self.trigger?(key)
    # Return key triggered state
    return @trigger[key]
  end
  #--------------------------------------------------------------------------
  # * Get Key Repeated State
  #    key : key index
  #--------------------------------------------------------------------------
  def self.repeat?(key)
    # Return key repeated state
    return @repeat[key]
  end
  #--------------------------------------------------------------------------
  # * Get Key Released State
  #    key : key index
  #--------------------------------------------------------------------------
  def self.release?(key)
    # Return key released state
    return @release[key]
  end
end

#==============================================================================
# ** Input
#------------------------------------------------------------------------------
#  This module performs key input processing
#==============================================================================

module Input
  # Add class data
  class << self
    #------------------------------------------------------------------------
    # * Alias Methods
    #------------------------------------------------------------------------
    alias glitch_input_keys_update update
    #------------------------------------------------------------------------
    # * Frame Update
    #------------------------------------------------------------------------
    def update
      # Call original method
      glitch_input_keys_update
      # Update Keys module
      Keys.update
    end
  end
end



Y ahora mi script:

Código:
#==============================================================================
# [XP] Notebook System (Versión Original)
#------------------------------------------------------------------------------
# By: Wecoc
#------------------------------------------------------------------------------
# Notas:
# ! El script requiere Glitchfinder's Key Input Module para funcionar
# - Si usas otro script de Keyboard completo seguramente será incompatible
# - No funcionan ni la ñ ni la ç
# - Para llamar el script usa en un evento:
#    $scene = Scene_Notebook.new
# - Las notas se guardan al guardar el juego
#==============================================================================

#==============================================================================
# Notebook Module
#------------------------------------------------------------------------------
# Constantes para el funcionamiento del script
#==============================================================================

module Notebook
  # MULTI_LINE indica si se pueden escribir notas de más de una línea.
  # ATENCIÓN: Si pones true, para terminar una nota ya no sirve el Enter y se
  # tiene que usar la flecha de dirección <-, lo cual es mucho menos intuitivo.
  MULTI_LINE = true
end

#==============================================================================
# String
#------------------------------------------------------------------------------
# Si ya tienes definidos shift o pop mediante otro script puedes borrar ésta
# parte.
#==============================================================================

class String
  def strip
    return self.scan(/./)
  end
 
  def shift
    array = self.clone.strip
    array.shift
    self.replace(array.join)
  end
 
  def pop
    array = self.clone.strip
    array.pop
    self.replace(array.join)
  end
end

#==============================================================================
# Notebook_Entry
#------------------------------------------------------------------------------
# Aquí se definen los parámetros de las notas.
# Por defecto solo tienen un parámetro, el texto.
#==============================================================================

class Notebook_Entry
  attr_accessor :text
  def initialize(text="")
    @text = text
  end
end

#==============================================================================
# Game_System
#------------------------------------------------------------------------------
# Almacenamiento de las notas
#==============================================================================

class Game_System
  attr_accessor :notebook_entries
  alias notebook_ini initialize unless $@
  def initialize
    notebook_ini
    @notebook_entries = []
  end
end

#==============================================================================
# Window_NotebookCommand
#==============================================================================

class Window_NotebookCommand < Window_Command
  def initialize(width, height)
    notebook_entries = $game_system.notebook_entries
    commands = []
    for i in 0...notebook_entries.size
      commands.push("Note #{i+1}")
    end
    commands.push("New note")
    super(width, commands)
    self.height = height
  end
 
  def refresh
    self.contents.clear
    for i in 0...@item_max
      if @commands[i] == "New note"
        color = system_color
      else
        color = normal_color
      end
      draw_item(i, color)
    end
  end
end

#==============================================================================
# Window_Notebook
#==============================================================================

class Window_Notebook < Window_Base
  def initialize(x, y, width, height)
    super(x, y, width, height)
    self.contents = Bitmap.new(width - 32, height - 32)
    @index = 0
    refresh
  end
 
  def index=(value)
    if @index != value
      @index = value
      refresh
    end
  end
 
  def refresh
    self.contents.clear
    notebook = $game_system.notebook_entries[@index]
    return if notebook.nil?
    text = notebook.text.split("/n")
    for i in 0...text.size
      self.contents.draw_text(0, 32 * i, self.width - 32, 32, text[i])
    end
  end
end

#==============================================================================
# Window_Writable
#==============================================================================

class Window_Writable < Window_Base
 
  attr_accessor :index
  attr_accessor :text
 
  def initialize(x, y, width, height)
    super(x, y, width, height)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z = 1000
    @index = 0
    @text = ""
    @multi_line = true
    @l_accent = false
    @r_accent = false
    @capital = false
  end
 
  def refresh
    self.contents.clear
    text = @text.split("/n")
    for i in 0...text.size
      self.contents.draw_text(0, 32 * i, self.width - 32, 32, text[i])
    end
  end
 
  def update
    super
    return if self.active == false
    text = @text.clone
    if Keys.trigger?(Keys::RETURN)
      if @multi_line
        @text.concat("/n")
      end
    end
    if Keys.repeat?(Keys::BACKSPACE)
      if @multi_line and @text[-2..-1] == "/n"
        @text.pop
        @text.pop
      else
        @text.pop
      end
    end
    if Keys.trigger?(Keys::SPACE)
      @text.concat(" ")
    end
    if Keys.trigger?(Keys::CAPITAL)
      @capital = !@capital
    end
    if Keys.trigger?(Keys::OEM_1)
      @l_accent = true
      @r_accent = false
    end
    if Keys.trigger?(Keys::OEM_7)
      @l_accent = false
      @r_accent = true
    end
   
    @shift = (Keys.press?(Keys::LSHIFT) or Keys.press?(Keys::RSHIFT))
       
    @text.concat("0") if Keys.trigger?(Keys::NUMPAD0)
    @text.concat("1") if Keys.trigger?(Keys::NUMPAD1)
    @text.concat("2") if Keys.trigger?(Keys::NUMPAD2)
    @text.concat("3") if Keys.trigger?(Keys::NUMPAD3)
    @text.concat("4") if Keys.trigger?(Keys::NUMPAD4)
    @text.concat("5") if Keys.trigger?(Keys::NUMPAD5)
    @text.concat("6") if Keys.trigger?(Keys::NUMPAD6)
    @text.concat("7") if Keys.trigger?(Keys::NUMPAD7)
    @text.concat("8") if Keys.trigger?(Keys::NUMPAD8)
    @text.concat("9") if Keys.trigger?(Keys::NUMPAD9)
   
    if Keys.trigger?(Keys::N0)
      if not @shift
        @text.concat("0")
      end
    end
    if Keys.trigger?(Keys::N1)
      if not @shift
        @text.concat("1")
      else
        @text.concat("!")
      end
    end
    if Keys.trigger?(Keys::N2)
      if not @shift
        @text.concat("2")
      end
    end
    if Keys.trigger?(Keys::N3)
      if not @shift
        @text.concat("3")
      end
    end
    if Keys.trigger?(Keys::N4)
      if not @shift
        @text.concat("4")
      end
    end
    if Keys.trigger?(Keys::N5)
      if not @shift
        @text.concat("5")
      end
    end
    if Keys.trigger?(Keys::N6)
      if not @shift
        @text.concat("6")
      end
    end
    if Keys.trigger?(Keys::N7)
      if not @shift
        @text.concat("7")
      end
    end
    if Keys.trigger?(Keys::N8)
      if not @shift
        @text.concat("8")
      else
        @text.concat("(")
      end
    end
    if Keys.trigger?(Keys::N9)
      if not @shift
        @text.concat("9")
      else
        @text.concat(")")
      end
    end
   
    if Keys.trigger?(Keys::SUBTRACT)
      @text.concat("-")
    end
    if Keys.trigger?(Keys::DECIMAL) or Keys.trigger?(Keys::OEM_PERIOD)
      @text.concat(".")
    end
    if Keys.trigger?(Keys::OEM_COMMA)
      @text.concat(",")
    end
    if Keys.trigger?(Keys::OEM_MINUS)
      if not @shift
        @text.concat("-")
      else
        @text.concat("_")
      end
    end
    upcase = @capital
    upcase = !upcase if @shift == true
   
    if Keys.trigger?(Keys::A)
      if @l_accent == true
        @text.concat(upcase ? "À" : "à")
      elsif @r_accent == true
        @text.concat(upcase ? "Á" : "á")
      else
        @text.concat(upcase ? "A" : "a")
      end
    end
    if Keys.trigger?(Keys::E)
      if @l_accent == true
        @text.concat(upcase ? "È" : "è")
      elsif @r_accent == true
        @text.concat(upcase ? "É" : "é")
      else
        @text.concat(upcase ? "E" : "e")
      end
    end
    if Keys.trigger?(Keys::I)
      if @l_accent == true
        @text.concat(upcase ? "Ì" : "ì")
      elsif @r_accent == true
        @text.concat(upcase ? "Í" : "í")
      else
        @text.concat(upcase ? "I" : "i")
      end
    end
    if Keys.trigger?(Keys::O)
      if @l_accent == true
        @text.concat(upcase ? "Ò" : "ò")
      elsif @r_accent == true
        @text.concat(upcase ? "Ó" : "ó")
      else
        @text.concat(upcase ? "O" : "o")
      end
    end
    if Keys.trigger?(Keys::U)
      if @l_accent == true
        @text.concat(upcase ? "Ù" : "ù")
      elsif @r_accent == true
        @text.concat(upcase ? "Ú" : "ú")
      else
        @text.concat(upcase ? "U" : "u")
      end
    end

    @text.concat(upcase ? "B" : "b") if Keys.trigger?(Keys::B)
    @text.concat(upcase ? "C" : "c") if Keys.trigger?(Keys::C)
    @text.concat(upcase ? "D" : "d") if Keys.trigger?(Keys::D)
    @text.concat(upcase ? "F" : "f") if Keys.trigger?(Keys::F)
    @text.concat(upcase ? "G" : "g") if Keys.trigger?(Keys::G)
    @text.concat(upcase ? "H" : "h") if Keys.trigger?(Keys::H)
    @text.concat(upcase ? "J" : "j") if Keys.trigger?(Keys::J)
    @text.concat(upcase ? "K" : "k") if Keys.trigger?(Keys::K)
    @text.concat(upcase ? "L" : "l") if Keys.trigger?(Keys::L)
    @text.concat(upcase ? "M" : "m") if Keys.trigger?(Keys::M)
    @text.concat(upcase ? "N" : "n") if Keys.trigger?(Keys::N)
    @text.concat(upcase ? "P" : "p") if Keys.trigger?(Keys::P)
    @text.concat(upcase ? "Q" : "q") if Keys.trigger?(Keys::Q)
    @text.concat(upcase ? "R" : "r") if Keys.trigger?(Keys::R)
    @text.concat(upcase ? "S" : "s") if Keys.trigger?(Keys::S)
    @text.concat(upcase ? "T" : "t") if Keys.trigger?(Keys::T)
    @text.concat(upcase ? "V" : "v") if Keys.trigger?(Keys::V)
    @text.concat(upcase ? "W" : "w") if Keys.trigger?(Keys::W)
    @text.concat(upcase ? "X" : "x") if Keys.trigger?(Keys::X)
    @text.concat(upcase ? "Y" : "y") if Keys.trigger?(Keys::Y)
    @text.concat(upcase ? "Z" : "z") if Keys.trigger?(Keys::Z)
   
    if text != @text
      @r_accent = false
      @l_accent = false
      refresh
    end
  end
end

#==============================================================================
# Window_Writable_Note
#==============================================================================

class Window_Writable_Note < Window_Writable
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @multi_line = Notebook::MULTI_LINE
  end
end

#==============================================================================
# Scene_Notebook
#==============================================================================

class Scene_Notebook
  def main
    unless defined?(Keys)
      raise "This script requires Glitchfinder's Key Input Module"
    end
    @command_window = Window_NotebookCommand.new(160, 480)
    index = [$game_system.notebook_entries.size - 1, 0].max
   
    @command_window.index = index
   
    @notebook_window = Window_Notebook.new(160, 0, 640 - 160, 480)
    @notebook_window.index = @command_window.index
    @writable_window = Window_Writable_Note.new(160, 0, 640 - 160, 480)
    @writable_window.visible = false
    @writable_window.active = false
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @notebook_window.dispose
    @writable_window.dispose
  end

  def update
    @command_window.update
    @notebook_window.update
    @writable_window.update
    @notebook_window.index = @command_window.index
    if @writable_window.active == true
      update_writable
      return
    end
    update_command
  end
 
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      @writable_window.active = true
      @writable_window.visible = true
      @writable_window.index = @command_window.index
      note = $game_system.notebook_entries[@command_window.index]
      text = note.nil? ? "" : note.text
      @writable_window.text = text
      @writable_window.refresh
      @command_window.active = false
    end
  end
 
  def update_writable
    if Notebook::MULTI_LINE == true
      if Keys.trigger?(Keys::LEFT)
        apply_note
      end
    else
      if Keys.trigger?(Keys::RETURN)
        apply_note
      end
    end
  end
 
  def apply_note
    $game_system.se_play($data_system.decision_se)
    if $game_system.notebook_entries[@command_window.index].nil?
      note = Notebook_Entry.new(@writable_window.text)
      $game_system.notebook_entries.push(note)
      $scene = Scene_Notebook.new
      return
    end
    if @writable_window.text == ""
      $game_system.notebook_entries.delete_at(@command_window.index)
      $scene = Scene_Notebook.new
      return
    end
    @writable_window.active = false
    @writable_window.visible = false
    @command_window.active = true
    notebook = $game_system.notebook_entries[@command_window.index]
    notebook.text = @writable_window.text
    @notebook_window.refresh
  end
end


Leed las instrucciones del script para más detalles. Para llamarlo, tenéis que poner en un evento: $scene = Scene_Notebook.new
Si se quisiera integrar en el menú habría que modificarlo un poco pero es fácil.

Para que quede claro qué hace éste script, aquí tenéis una screen que habla por sí sola xDD

Spoiler:


Aceptaré hacer modificaciones sencillas si alguien lo requiere.
Saludos.

Edito: Solucionado un pequeño bug de interferencia entre la tecla numpad 4 y la flecha <-
Posiblemente más adelante amplíe los carácteres usables, porque algunos no están disponibles. De ese modo el mismo Window_Writable serviría de base definitiva para otras cosas como por ejemplo un sistema de nombrado de personajes por teclado.


Última edición por Wecoc el 2015-01-10, 18:18, editado 1 vez

Wecoc
Administrador
Administrador



Créditos 8263

Gracias : 372

Volver arriba Ir abajo

RPG Maker XP Re: [XP] Notebook System

Mensaje por Faye Valentine el 2015-01-10, 15:35

Uff, buenisimo script. Seguramente lo termine usando. Solamente he visto un sistema así en un juego llamado "Manifest" para el VX, y la verdad es que me gusta, demasiado útil. Por ejemplo, ahora mismo me estoy pasando el SoG, pero entre partida y partida pasa mucho tiempo (universidad, llego cansado, etc...) y cuando retomo el juego, estoy perdidisimo xD.

En fin, para los que queráis cambiar ese "New Note" os vais a la línea 93

commands.push("New note") y reemplazáis "New Note" por lo que sea. Por ejemplo "Anotar"

Pero ojo, que luego nos vamos a la línea 101 y cambiamos:

if @commands[i] == "New note" ese "New note" tiene que decir lo que pusimos en la línea 93, ¿vale?. Si pusimos "Anotar", en la línea 101 debería poner:

if @commands[i] == "Anotar" < porque tanto ese "if" y ese "==" están checando si la variable commands tiene el valor de la línea 93. (¿Ya puedo ser un scripter? :c) xDDD

En fin, lindo script.

Faye Valentine
Soñador
Soñador

0/3

Créditos 279

Gracias : 33

Volver arriba Ir abajo

RPG Maker XP Re: [XP] Notebook System

Mensaje por Ledai el 2015-01-10, 18:01

Muchas gracias por este aportazo, siempre me pregunté si se llegaría a hacer algo similar para el maker.
Por ahora no tengo planeado usarlo, pero me lo guardaré en mi biblioteca ya que lo considero muy útil.
Sin duda gracias!!!!

Ledai
Aventurero
Aventurero

0/3

Créditos 1360

Gracias : 124

http://ahurallg.blogspot.com.es/

Volver arriba Ir abajo

RPG Maker XP Re: [XP] Notebook System

Mensaje por Contenido patrocinado Hoy a las 15:35


Contenido patrocinado


Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


 :: RPG Maker :: Scripts

Permisos de este foro:
No puedes responder a temas en este foro.