• Having trouble receiving email verification when signing up? Contact a staff member via our Discord server!
  • Consider joining our Discord server if you haven't already! Discord is a free voice and text chat platform that's more or less a combination of Skype and Teamspeak. Using Discord, you can chat with other Relic Castle members in real-time! Wowza! Click here for the details!
Text input settings controlled by the player

Text input settings controlled by the player

Pokémon Essentials Version
v16.2 ➖
THIS FEATURE IS NOW NATIVE TO POKéMON ESSENTIALS AS OF VERSION 17.

What's this?
Pokémon Essentials allows you to choose whether the text input (naming the player, rival, nicknaming a Pokémon...) works like in the main games or it uses keyboard input. If you didn't know, this is the last setting in your Settings script section and is false by default. With this resource, you'll be able to add a new setting to the options screen, allowing the player to switch between the two at will. Personally, I prefer keyboard input as it's much more natural but I understand some people would like to keep the original text input, so why not let the player choose? Let's do that!

Show me the goods!
Not much to show here! First is without keyboard input, next is keyboard input and after that is our NEW setting in the options screen.




Installation

Do note this will override your setting in the Settings section. Not a big deal, but I'm letting you know.
Open your script editor and go to the "PScreen_Options" section. Find "class PokemonSystem".
Below "attr_accessor :sevolume" we'll be adding "attr_accessor :input". Now go down a bit until you see:
Code:
def sevolume
	return (!@sevolume) ? 100 : @sevolume
  end
We'll be adding a new method below it:
Code:
def input
	return (!@input) ? 0 : @input
  end
Now let's skip to "@sevolume = 100 # Volume of sound effects" and add this below:
Code:
	@input	   = 0   # Keyboard input ON by default, switch to 0 for classic by default
Halfway there! Now find this piece of code:
Code:
EnumOption.new(_INTL("Font Style"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")],
		  proc { $PokemonSystem.font },
		  proc {|value|
			 $PokemonSystem.font=value
			 MessageConfig.pbSetSystemFontName($VersionStyles[value])
		  }
	   ),
And let's add something below it:
Code:
	   EnumOption.new(_INTL("Input Style"),[_INTL("Keyboard"),_INTL("Classic")],
		  proc { $PokemonSystem.input },
		  proc {|value| $PokemonSystem.input=value }
	   ),
Almost done! We need to add one method, anywhere above main. I like to keep a section named "Misc. Scripts" and just throw it there.
Code:
def pbEnterText(helptext,minlength,maxlength,initialText="",mode=0,pokemon=nil,nofadeout=false)
  ret=""
  if $PokemonSystem.input==1 # Classic Input
	pbFadeOutIn(99999,nofadeout){
	   sscene=PokemonEntryScene2.new
	   sscreen=PokemonEntry.new(sscene)
	   ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon)
	}
  elsif $PokemonSystem.input==nil || $PokemonSystem.input==0 # Keyboard Input
	pbFadeOutIn(99999,nofadeout){
	   sscene=PokemonEntryScene.new
	   sscreen=PokemonEntry.new(sscene)
	   ret=sscreen.pbStartScreen(helptext,minlength,maxlength,initialText,mode,pokemon)
	}
  end
  return ret
end
That's it! By default, keyboard input is on, and the player can change this at any time through the Options screen. Hopefully you understood some of the changes we've made, which will help you add more settings in the future.
Credits

Please credit if used to:

Mr. Gela

Please do not redistribute this anywhere resource anywhere else. If you wish to share this, link to this site.


Por favor da créditos si lo utilizas a:
Mr. Gela

Por favor no redistribuyas este recurso en ningún otro lugar. Si quieres compartir esto, utiliza un enlace a este sitio.
Author
Mr. Gela
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from Mr. Gela

Latest reviews

This is something that Every Fan Game should have Available, Keyboard or Gamepad use would be a welcome option for anyone and everyone, i will definitely be using this.
Top