=begin #=============================================================================== Title: More Input Digits Author: Hime Date: Jan 29, 2015 URL: http://himeworks.com/2015/01/more-input-digits/ -------------------------------------------------------------------------------- ** Change log Jan 29, 2015 - Initial release -------------------------------------------------------------------------------- ** Terms of Use * Free to use in non-commercial projects * Contact me for commercial use * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Credits to Hime Works in your project * Preserve this header -------------------------------------------------------------------------------- ** Description This script allows you to set more digits for your number input event command. By default, the event editor only supports up to 8 digits. -------------------------------------------------------------------------------- ** Installation In the script editor, place this script below Materials and above Main -------------------------------------------------------------------------------- ** Usage Right after an input number event command, create a comment and write Where `x` is the number of digits you would like #=============================================================================== =end $imported = {} if $imported.nil? $imported[:TH_MoreInputDigits] = true #=============================================================================== # ** Configuration #=============================================================================== module TH module More_Input_Digits Regex = //i end end #=============================================================================== # ** Rest of script #=============================================================================== module RPG class Event::Page alias :th_more_input_digits_list :list def list parse_more_input_digits unless @more_input_digits_parsed th_more_input_digits_list end def parse_more_input_digits @more_input_digits_parsed = true i = 0 while i < @list.size cmd = @list[i] # Number Input command if cmd.code == 103 # Collect all comments under it next_cmd = @list[i+1] comment = "" while next_cmd.code == 108 || next_cmd.code == 408 i += 1 comment << "\n" << next_cmd.parameters[0] next_cmd = @list[i+1] end # Check if there's something special if comment =~ TH::More_Input_Digits::Regex num = $1.to_i cmd.parameters[1] = num end end i += 1 end end end end