Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: cyclope on June 16, 2010, 04:18:51 pm

Title: [RESOLVED] Character Name Changing with Keyboard
Post by: cyclope on June 16, 2010, 04:18:51 pm
Is there a way to modify scene_name or a script to use the keyboard to when changing a characters name :???:
Title: Re: Character Name Changing with Keyboard
Post by: nathmatt on June 16, 2010, 04:58:24 pm
place this below Tons of addons make sure custom controls is on

class Scene_Name
 
  alias name_input_update update
  def update
    (65...91).each{|i|
    if Input.trigger?(i)
      let = Input::Key.index(i)
      let = let.downcase unless Input.press?(Input::Key['Shift'])
      @edit_window.add(let)
    end}
    if Input.trigger?(Input::Key['Backspace'])
      @edit_window.back
    end
    name_input_update
  end
 
end


edit fixed z didn't work
Title: Re: (resolved) Character Name Changing with Keyboard
Post by: cyclope on June 16, 2010, 06:15:13 pm
Thanks! it works
Title: Re: Character Name Changing with Keyboard
Post by: cyclope on June 16, 2010, 06:21:15 pm
Is there a way in wich i press enter instead of using the arrowkeys to select OK?
Title: Re: Character Name Changing with Keyboard
Post by: nathmatt on June 16, 2010, 07:42:03 pm
class Scene_Name
 
  alias name_input_update update
  def update
    (65...91).each{|i|
    if Input.trigger?(i)
      $game_system.se_play($data_system.decision_se)
      let = Input::Key.index(i)
      let = let.downcase unless Input.press?(Input::Key['Shift'])
      @edit_window.add(let)
    end}
    if Input.trigger?(Input::Key['Backspace'])
      @edit_window.back
    end
    if Input.trigger?(Input::Key['Enter'])
      @actor.name = @edit_window.name
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Switch to map screen
      $scene = Scene_Map.new
    end
    name_input_update
  end
 
end


there you go
Title: Re: [RESOLVED] Character Name Changing with Keyboard
Post by: cyclope on June 16, 2010, 10:29:06 pm
It works perfectly :haha: Thanks!