FANDOM



Abajo se muestra una lista de las secciones de scripts que contienen todo el código de Pokémon Essentials (Versión 16.1). Cada sección ofrece una descripción breve de su objetivo y lista sus métodos y clases principales. Se existe una página dedicada a alguno de los scripts, se dejará su enlace.

La lista de métodos y clases no es exhautiva (ya que éso podría tomar mucho espacio y tiempo de documentación), pero sí es representativa. Los programadores que busquen un método particular de una librería, por favor, utilicen la función Ctrl+Shift+F en el Editor de Scripts de RMXP para "Buscar en todos".

Settings Editar

Configuración. Esta sección consiste en una colección de características que el usuario puede modificar fácilmente. Las opciones disponibles son las que la mayoría de los usuarios podrían querer modificar. Se incluyen interruptores y constantes para:

  • Tamaño de la pantalla
  • Nivel máximo de un Pokémon, nivel de eclosión, probabilidades de shiny y pokérus
  • Overworld Mechanics: poison, fishing, diving, berries
  • Infinite TMs
  • Day/Night Shading
  • Signposts (the route name that appears on-screen)
  • Battle Mechanics: physical/special split, Gen 6 battle and EXP mechanics, scaled EXP, critical capture
  • Badge boosts, Badge requirements for HM use.
  • Bag pocket names, size limits, and sorting. (pbPocketNames)
  • Storage system size, and creator name (pbStorageCreator)
  • Pokedex mechanics (pbDexNames)
  • Money limits
  • Rival names in battle
  • Roaming pokemon settings
  • Poké Radar settings
  • Region map extras
  • Contest settings
  • Assigning global switches, common events, and animations to Essentials mechanics.
  • Idiomas para localización.
  • Whether to allow the user to use the keyboard instead of the on-screen keyboard to enter text.


RGSS2Compatibility Editar

These scripts support the use of RGSS2 players in Pokémon Essentials. Note that this is not the same as Essentials being compatible with RPG Maker VX - only the RGSS2 player is compatible.


RPG__Sprite Editar

Definiciones
SpriteAnimation

This section contains the basic definition of what a sprite is. Practically everything visual in the game depends on this.


Win32API Editar

This section connects the game with Window's API, which allows it to do things like reposition the main window and set the window title.


Sockets Editar

Definiciones
pbPostData
pbDownloadData
pbHttpRequest
pbDownloadToString
pbDownloadToFile
pbPostToString
pbPostToFile
Página principal: Internet

This section handles how the game can connect to the Internet and retrieve information. This is used by Essentials' Mystery Gift function.


DebugConsole Editar

Definiciones
Console::setup_console
Console::readInput
Console::readInput2
Console::get_input
Kernel.echo
Kernel.echoln

This section defines the debug console built into Essentials. To use the console, open up the debug menu in-game (F9) and select the "Open Debug Console" option at the bottom of the list. This console cannot be typed into (usually), but it will output logging information. To log to the console, use Kernel.echo(string) or Kernel.echoln(string).


Game_Temp Editar

This section defines Game_Temp, which handles all temporary data. This data is NOT saved in a save game. Use $game_temp to access the global instance of this class. Most all of the data kept in this class is used by Essentials internally; chances are slim that you'll need to touch this data.

Game_System Editar

Definiciones
$game_system.timer
$game_system.save_disabled
$game_system.menu_disabled
$game_system.encounter_disabled
$game_system.save_count
$game_system.bgm_play(bgm)
$game_system.bgm_memorize
$game_system.bgm_restore
$game_system.me_play(me)
$game_system.bgs_play(bgs)
$game_system.bgs_stop
$game_system.bgs_fade(time)
$game_system.se_play(se)

This section defines Game_System, which handles various system data which is saved in the save file. Use $game_system to access the global instance of this class. There are functions which play music and sound effects in this class.


Game_Switches Editar

Página principal: Events#Global_Switches

This section defines Game_Switches, which handles the game's Global Switches. Use $game_switches to access the global instance of this class. You cannot have more than 5000 switches.

Note: Script Switches do not have the results of their scripts stored in them. For example, $game_switches[15] (switch 15, defined as "s:PBDayNight.isNight?(pbGetTimeNow)") will always contain false regardless of the time of day.


Game_Variables Editar

Página principal: Events

This section defines Game_Variables, which handles the game's Global Variables. Use $game_variables to access the global instance of this class. You cannot have more than 5000 variables.


Game_SelfSwitches Editar

Página principal: Events

This section defines Game_SelfSwitches, which handles the game's event Self Switches. Use $game_self_switches to access the global instance of this class. Keys into this hashmap are an array, of the form [mapid, eventid, switchname].

You should use the function pbSetSelfSwitch(eventid,switch,value) to set self-switches of other events on the current map.


Game_Screen Editar

Definiciones
$game_screen.start_tone_change
$game_screen.start_flash
$game_screen.start_shake
$game_screen.weather

This section defines Game_Screen, which handles visual effects such as changing the colour tone of the screen or flashing. Use $game_screen to access the global instance of this class.


Game_Picture Editar

This section defines Game_Picture, which handles displaying pictures. Instances of this class are used in Game_Screen.


Game_Map Editar

Definiciones
$game_map.name
$game_map.map_id

This section defines Game_Map, which contains the basic definition of a game map. Use $game_map to access the current map's instance.


Game_Map_Resolution Editar

This section extends Game_Map to allow Essentials to scale up the game, and includes display corrections for when the map is set to snap to edges (i.e. the screen stops scrolling).


Game_Map_Autoscroll Editar

Definiciones
autoscroll(x,y,speed)
autoscroll_player(speed)

This section extends Game_Map to allow easier map scrolling for cutscenes. The functions listed to the right are defined in the Interpreter, and thus will work unadorned from event scripts.

This section handles additional map scrolling features. These additional features include:

  • Scrolling to a given map location or to the player.
  • Following a moving character.
  • Setting the speed at which the scrolling occurs.
  • Scrolling diagonally.

The supported commands are as follows:

autoscroll(x,y) Scrolls to the given coordinates (at a default speed of 4). Diagonal scrolling occurs automatically. The coordinates can be variables as well as numbers (e.g. setting the variables to equal the coordinates of an NPC means the screen will follow that NPC).
autoscroll(x,y,speed) As above, but you can also define the scroll speed (between 1 and 6).
autoscroll_player(speed) Scrolls to (and follows) the player at the given speed (between 1 and 6).

The above commands must be on a single line in an event's "Script" command, and must be the first line in that command.


Game_CommonEvent Editar

This section defines Game_CommonEvent, which handles common events. Common events are those listed in the Database.


Game_Character Editar

Definiciones
Game_Character
  .moving?
  .jumping?
  .moveto(x,y)
  .move_{direction}
  .turn_{direction}
  .move_towards_player
  .move_away_from_player
  .jump(x_plus,y_plus)

This section defines Game_Character, which handles various aspects of game events, including basic definition, forced move routes, centring the screen on the player, and bushes.


Game_Event Editar

Definiciones
Game_Event
  .map_id
  .name
  .id
  .tsOn?(c)
  .tsOff?(c)
  .setTempSwitch{On|Off}(c)
  .switchIsOn?(id)

This section defines Game_Event, a subclass of Game_Character, which handles the basic details of events.

This class defines a concept of "TempSwitches", which are switches which are kept in the instance of the Game_Event only, and not saved off even between map changes. Thus Temporary switches are reset when the player leaves the map and comes back. Doors in the Essentials example project use temporary switches to play the animation of the player leaving a house once and only once upon map load. (Hint: If you're having trouble making the exit animation on doors play when you're moving a player between rooms on the same map, set the temporary switches of the doors on the map back off as part of the transition.)

The .switchIsOn?(id) function defined in this class is responsible for executing Script Switches and returning the result to the event's condition evaluation process.


Game_Player Editar

Definiciones
$game_player.move_{direction}
$game_player.pbHasDependentEvents?
$game_player.pbTriggeredTrainerEvents
$game_player.pbTriggeredCounterEvents
$game_player.center(x,y)

This section defines Game_Player, a subclass of Game_Character, which handles the player character, including movement, checking whether a trainer can spot the player from a distance, tile passabilities, map scrolling and interacting with events. Use $game_player to access the global instance of this class.

The function pbTriggeredTrainerEvents checks all events named "Trainer(##)" on the current map to see if they can reach the player. The function pbTriggeredCounterEvents checks all events named "Counter(##)" on the current map to see if they are facing the player. Both methods return all events that pass their respective checks in an array.


Walk_Run Editar

Definiciones
$game_player.pbCanRun?
$game_player.pbIsRunning?
Página principal: Getting around

This section extends Game_Player to how the player runs and cycles, including defining where these can be done and how quickly the player moves when they do so. It also defines the player's walking speed.


Sprite_Character Editar

This section defines BushBitmap and Sprite_Character. They handle how bush tiles are displayed, and the display of an event's sprite.


Sprite_Picture Editar

This section defines Sprite_Picture, which handles the display of sprite pictures (stored in "Graphics/Pictures/").


Sprite_Timer Editar

This section defines Sprite_Timer, which handles showing a window displaying a timer, usually one that counts down to 0.


Sprite_Resizer Editar

Definiciones
pbSetResizeFactor
pbConfigureFullScreen

This section extends several classes which allow the game to zoom the game to a 0.5, 1.5, and 2.0 times the size of normal.


Spriteset_Map Editar

This section defines ReflectedSprite and ClippableSprite, which handle reflecting sprites in still water (terrain tag 6 tiles). It also defines Spriteset_Map, which handles displaying maps.


Tilemap_XP Editar

This section defines CustomTilemap, as well as several supporting classes, which reimplement XP's Tilemap class with functionality for scaling and specialized autotiles. (?)


Tilemap_Perspective Editar

Definiciones
ScreenPosHelper::pbScreenZoom{X|Y}
ScreenPosHelper::pbScreen{X|Y|Z}
ScreenPosHelper::bmHeight
bltMinimapAutotile
getPassabilityMinimap
Página principal: Perspective mode

This section defines Draw_Tilemap along with a few helper methods, which deal with showing maps in perspective mode


TilemapLoader Editar

This section defines TilemapLoader, which is a proxy class for the various kinds of TileMap classes defined in previous sections.


TileDrawingHelper Editar

This section defines TileDrawingHelper, which handles how autotile graphics are arranged, and how to draw them and regular tiles.


AnimationSprite Editar

Definiciones
Spriteset_Map
  .addUserSprite
  .addUserAnimation

This section defines AnimationSprite, which is used to display one-off animations on the map (like grass rustling). This section extends Spriteset_Map to use AnimationSprite.


ParticleEngine Editar

Página principal: Particle effects

This section defines Particle_Engine and helper classes, which handle the display of particle effects, such as those on Route 3 in the Essentials example project. It defines the effects "fire", "smoke", "teleport", "spirit", "explosion", "aura", "soot", "sootsmoke", "rocket", "fixteleport", "smokescreen", "flare", "splash", and "starteleport". This section extends the Game_Event class to support these particle effects.


DynamicShadows Editar

This section defines Sprite_Shadow, which displays the dynamic sprite shadows created when walking near a shadow source (as seen on Cycling Road in the Essentials example project). This section extends Sprite_Character, Game_Event, and Spriteset_Map to support this.


Interpreter Editar

Definiciones
pbExecuteScript
get_character

This section defines Interpreter, which handles the running of game events. This class defines how the game runs every command you can put in an event. See the execute_command function to find which command_### function applies to which event command.


Event Editar

Definiciones
Event
  .trigger
  +=proc
  -=proc

This section defines Event, which is an event listener structure (and not related to RMXP events). Given an instance of the Event class evt, you can register a callback to be run by using:

evt+=proc {|sender,params|
  # Your code here
}

Procedures can be deregistered by using -=, and the callback list can be triggered using the trigger(args) and trigger2(args) methods. This is used by item effects, encounter generation, player step reactions, etc.

The class HandlerHash is also defined in this section.


File_Mixins Editar

Definiciones
FileInputMixin
FileOutputMixin
File
StringInput
StringOutput

This section defines several functions for file IO.


Intl_Messages Editar

Definiciones
pbAddScriptTexts
pbAddRgssScriptTexts
pbSetTextMessages
pbGetText
pbCompileText
pbLoadMessages
_INTL(*arg)
_ISPRINTF(*arg)
_I(str)
_MAPINTL(mapid,*arg)
_MAPISPRINTF(mapid,*arg)

This section defines Messages, MessageTypes, OrderedHash, and several functions for internationalization.


PBDebug Editar

This section defines PBDebug, which handles logging to files.


Audio Editar

Definiciones
safeExists?(f)
Audio.bgm_play
Audio.bgm_fade
Audio.bgm_stop
Audio.me_play
Audio.me_fade
Audio.me_stop
Audio.bgs_play
Audio.bgs_fade
Audio.bgs_stop

This section defines the Audio module, which handles the playing of audio files.


AudioPlay Editar

Definiciones
pbBGMPlay(param)
pbBGMFade
pbBGMStop
pbMEPlay(param)
pbMEFade
pbMEStop
pbBGSPlay(param)
pbBGSFade
pbBGSStop
pbSEPlay(param)
pbSEFade
pbSEStop
pbPlayCursorSE
pbPlayDecisionSE
pbPlayCancelSE
pbPlayBuzzerSE

This section defines several global functions for playing audio. These functions are likely what you want to use if you want to play audio from a script.


AudioUtilities Editar

Definiciones
Audio.noise
Audio.envelopeDuration
Audio.oscillateDouble
Audio.oscillate
Audio.frac
Audio.sine
Audio.doubleSine
Audio.noise2
Audio.square
Audio.dtmf
Audio.beep
Audio.triangle
Audio.triangle2
Audio.playTone
Audio.saw
ringtone(duration)
backspace
callwaiting
callheld
loudFastBusy
tone{CountyCode}
beginRecord
getRecorderSample
stopRecord
endRecord

This section extends the Audio module to include ways to generate sounds and notes on the fly. Helper methods include ways to create tones you would hear on a phone. It also defines functions for recording audio and saving it off, used in Essentials' implementation of the Chatter move.


BitmapCache Editar

Definiciones
WeakRef
WeakHashtable
Cache
BitmapWrapper
BitmapCache.load_bitmap

This section defines the BitmapCache module, which handles caching loaded image files.


Window Editar

This section defines the Window class, which is the base class for text windows, command lists, etc. The code to draw the windows from a small bitmap is defined in this section.


SpriteWindow Editar

Definiciones
MessageConfig
GifLibrary
AnimatedBitmap
SpriteWrapper
AnimatedSprite
IconSprite
ColoredPlane
AnimatedPlane
SpriteWindowCursorRect
SpriteWindow
SpriteWindow_Base
SpriteWindow_Selectable
SpriteWindow_SelectableEx
Window_DrawableCommand
Window_CommandPokemon
Window_AdvancedCommandPokemon
Window_UnformattedTextPokemon
Window_AdvancedTextPokemon
Window_InputNumberPokemon
Window_CommandPokemonEx
Window_AdvancedCommandPokemonEx
IconWindow
PictureWindow
pbGetTileBitmap
pbGetAnimation
pbGetTileset
pbGetAutotile
pbFadeOutIn
pbFadeOutAndHide
pbFadeInAndShow
pbResolveBitmap
addBackgroundPlane
pbSetSystemFont
pbRgssExists?
pbRgssOpen

Esta sección define muchas clases y métodos que Essentials utiliza para dibujar sus ventanas de interfaz de usuario y sus animaciones. También define algunos métodos para abrir archivos de datos.

  • El módulo MessageConfig definido en la parte superior del archivo define muchos de los colores y fuentes predeterminados utilizados por el sistema.
  • La clase de proxy AnimatedBitmap es utilizada por gran parte de la biblioteca para mostrar casi todo, desde los iconos de pokemon en la pantalla del equipo, hasta los participantes en batalla, los objetos de la bolsa y las cartas en el minijuego Triple Tríada.
  • La clase SpriteWindow es la base para cada ventana utilizada por la interfaz de usuario de Essentials. Tiene muchas subclases que sirven a muchos propósitos diferentes.
  • El método pbFadeOutIn se utiliza en varios lugares como efecto de transición a un nuevo submenú, como cuando se entra en la pantalla del equipo desde el menú de pausa.


DrawText Editar

Definiciones
getLineBrokenChunks
renderLineBrokenChunks
renderLineBrokenChunksWithShadow
getFormattedText
drawBitmapBuffer
Página principal: Messages

This section defines several methods which handle the drawing of text to the screen, as well as the effects of the various message modifiers (colour changes, repositioning, displaying extra things, etc).


Messages Editar

Definiciones
pbMapInterpreterRunning?
pbMapInterpreter
pbGlobalLock
pbGlobalUnlock
pbChooseNumber
Kernel.pbMessage
Kernel.pbMessageChooseNumber
Kernel.pbConfirmMessage
Kernel.pbConfirmMessageSerious
pbPositionFaceWindow
pbPositionNearMsgWindow
pbGetMapNameFromId
Kernel.pbMessageDisplay
Página principal: Messages

This section defines many of the methods Essentials uses to display messages to the player.

  • Kernel.pbMessage is the most basic message display, and the one you most often will use when displaying a message from a script. It is the method called internally when you use a Text Command in an event.
  • Kernel.pbConfirmMessage and pbConfirmMessageSerious display a Yes/No (or in the case of -Serious, a No/Yes) choice to the player.
  • Kernel.pbMessageChooseNumber will ask the player to enter a number.
  • Kernel.pbMessageDisplay is the eventual call of all of the above. This is where the message you passed has all of its modifiers and text replacements processed.


TextEntry Editar

Definiciones
Window_TextEntry
Window_MultilineTextEntry
Window_TextEntry_Keyboard
PokemonEntryScene
PokemonEntryScene2
getLineBrokenText
Kernel.pbFreeText
Kernel.pbMessageFreeText
pbEnterText
pbEnterPlayerName
pbEnterPokemonName
pbEnterBoxName
pbEnterNPCName

This section defines several methods and classes which handle the various text entry methods available in Essentials.


EventScene Editar

Definiciones
PictureEx
PictureSprite
EventScene
setPictureSprite
pbEventScreen

This section defines the EventScene class, which is the base class for scenes that are not menus and not maps, such as the Intro splash screens, and the screen displaying the controls when starting the game. It also defines pbEventScreen(evtScene), which displays a subclass of the EventScene.


Scene_Map Editar

This section defines the Scene_Map class, which is defines the scenes while the player character is walking around in the overworld. This class is where transferring the player, updating the map, input handling while in the overworld is handled.


Scene_Intro Editar

Página principal: Game intro

This section defines the IntroEventScene and Scene_Intro classes, which handle the intro and splash screens that appear at the start of a game.


Scene_Controls Editar

This section defines the ButtonEventScene class, which handle the display of the controls screen, usually provided at the start of a new game when the professor asks if there is any help he can give.


Scene_Movie Editar

This section defines the Scene_Movie class, which handles the playing of AVI movie files in-game. Movies must be in a folder "Movies" in the main game directory. Use the following code to load a movie scene:

$scene = Scene_Movie.new("MovieName")

When the movie is done or the player presses B, the game will return to the overworld view (the Scene_Map).


Scene_Credits Editar

Página principal: Credits

This section defines the Scene_Credits class, which handles the display of the credits.

To insert your own credits, edit the lines that say "Credits go here". To play the credits, use the following script:

$scene = Scene_Credits.new

All graphics used by this script are in the "Graphics/Titles" folder. You can add or change the images used by editing the CreditsBackgroundList at the top of this script section. The credits are displayed with a scrolling effect.


Transitions Editar

This section overrides Graphics.transition to define several transition effects that occur just before a battle starts.

Tip: If you're experiencing issues with the fade effect when using Graphics.transition comment out lines 95 and 96 in this section:

elsif dc==""
  @@transition=FadeTransition.new(duration)

Doing so will revert the fade effect to the stock RMXP fade effect.


MiscData Editar

Definiciones
PhoneDatabase
PhoneMsgType
PokemonMetadata
pbLoadMetadata
pbGetMetadata
pbLoadPhoneData
pbOpenDexData
pbDexDataOffset
Página principal: Metadata

This section defines the PokemonMetadata module, which defines the various metadata that Essentials looks for in the metadata.txt PBS file. This section also defines a class for Phone metadata and several methods to get map metadata.


PBMove Editar

Página principal: Moves

This section defines PBMoveData and PBMove classes, which handles moves, both reading the move data from the data files and defining the properties of a move (e.g. type, PP, etc.).


PBStatuses Editar

This section defines the PBStatuses module, which is where permanent (i.e. out of battle) Pokémon statuses are enumerated. This does not include confusion/infatuation/etc. which are all "volatile" in-battle conditions which a Pokémon can have in addition to a permanent status.

The effects of these statuses are not included here. The Pokérus status is also not defined here, as it is an unrelated effect.


PBTypes_Extra Editar

This section extends the PBTypes class, which handles data regarding elemental types, including their Physical/Special category and type effectiveness calculations.


PBNatures Editar

This section defines the PBNatures module, which enumerates the ID numbers and names of Pokémon natures. The effects of natures are not included here.


PBExperience Editar

This section defines the PBExperience module, which lists the experience thresholds for each level for each growth type. The thresholds for levels below 100 are listed as individual numbers in an array, whereas those for level 101 and above have formulae for calculating them.


PBStats Editar

This section defines the PBStats module, which enumerates the eight stats that all Pokémon have. This includes HP, Attack, Defense, Speed, Special Attack, and Special Defense, as well as the two in-battle stats, Accuracy and Evasion.


PBRibbons Editar

This section defines the PBRibbons module, which enumerates the ID numbers, names and descriptions of ribbons.


PBEggGroups Editar

This section defines the PBEggGroups module, which enumerates the ID numbers and names of the various egg groups.


PBColors Editar

This section defines the PBColors module, which enumerates the IDs and names of the Pokedex color categories.


PBEnvironment Editar

This section defines the PBEnvironment module, which enumerates the different environment types. These environment types are used to determine the appropriate backdrops for battles, as well as some move effects.


PBEffects Editar

This section defines the PBEffects module, which enumerates all the variables used for lingering effects of attacks/abilities/items (e.g. Choice Band, Disable, Protect, Flinch, Toxic). Their effects are not included here.


PBWeather Editar

This section defines the PBWeather module, which enumerates all the possible in-battle weather types. The effects of in-battle weather are not included here.


PBTargets Editar

This section defines the PBTargets module, which enumerates all possible target combinations for a given move.


PokeBattle_ActiveSide Editar

This section defines the PokeBattle_ActiveSide and PokeBattle_ActiveField classes, which contain the variables used for lingering move effects that affect all Pokémon on the battle field or just one side of a battle (i.e. the player's side or the opposing side). Their effects are not included here.


PokeBattle_DamageState Editar

This section defines the PokeBattle_DamageState class, which is used in the PokeBattler_Battler class (see below) to keep track of several different flags used in battle for damage calculation, including the last amount of hp lost, whether the last hit was a critical, whether a substitute too the damage, etc.


PokeBattle_Battler Editar

Definiciones
PokeBattle_Battler
  .battle
  .pokemon
  .hasMega?
  .isMega?
  .pbThis
  .pbHasMove?
  .hasWorkingAbility
  .hasWorkingItem
  .pbReduceHP
  .pbRecoverHP
  .pbFaint
  .pbObedienceCheck?
  .pbTryUseMove
  .pbUseMove

This section defines the PokeBattle_Battler class.

A battler is a separate entity to a Pokémon. This allows the battler to be changed in dramatic ways (e.g. using Transform) without affecting the Pokémon it is based on.

This section defines all the in-battle properties a battler has. This includes species, level, moves, stats, etc. (copied from the Pokémon), as well as things like whether it is fainted, what its last used move was, the stat modifier stages, and which other battlers will gain experience from it when it is defeated.

It also contains various functions that affect individual battlers, including one that faints the battler, one that determines the battler's modified speed, ones that affect status, one that describes what happens when a held item is consumed, ones that modify attack targets based on various effects, one that determines whether the battler will obey the trainer (and what happens if they don't), and ones that describe how a move is used.

It also contains methods that describe form-changing during battle.


PokeBattle_BattlerEffects Editar

Definiciones
PokeBattle_Battler
  .pbSleep
  .pbPoison
  .pbBurn
  .pbParalyze
  .pbFreeze
  .pbConfuse
  .pbAttract
  .pbFlinch
  .pbIncreaseStat
  .pbReduceStat

This section extends the PokeBattle_Battler class to handle various in-battle effects, such as whether a battler can be given a particular status (also checks immunities to that status), inflicting statuses, status effects, and stat stage modifications.


PokeBattle_Move Editar

Definiciones
PokeBattle_Move
  .battle
  .pp
  .totalpp
  .pbType
  .pbIsPhysical?
  .pbTargetsMultiple?
  .canThawUser?
  .ignoresSubstitute?
  .pbTypeModifier
  .pbIsCritical?
  .pbCalcDamage
  .pbEffect
Página principal: Moves

This section defines the PokeBattle_Move class, which is the base class for all move classes. It handles moves in battle, including effectiveness calculations, accuracy check, power modifications, critical hit chance and damage calculation.


PokeBattle_MoveEffects Editar

Página principal: Function codes

This section defines hundreds of subclasses of PokeBattle_Move, one for each move. Usually each of these subclasses override the pbEffect method to implement the how the given move works and animates in battle.

Notably implemented first in the section are:

  • PokeBattle_UnimplementedMove - a error handler move class for moves which are defined in the PBS file but don't have a subclass defined for them. Damaging moves do damage and nothing else, while status moves always fail.
  • PokeBattle_FailedMove - A superclass for moves that always fail.
  • PokeBattle_Confusion - A class which implements the pseudo-move used by a battler against itself when it hurts itself in confusion.
  • PokeBattle_Struggle - An implementation for Struggle, should the move not be defined in the PBS file.


PokeBattle_Battle Editar

Definiciones
PokeBattle_NullBattlePeer
PokeBattle_BattlePeer
PokeBattle_SuccessState
PokeBattle_BattleCommon
PokeBattle_Battle
  .pbIsUnlosableItem
  .pbPlayer
  .pbGetMegaRingName
  .pbMegaEvolve
  .pbFindNextUnfainted
  .pbAddToPlayerParty
  .pbCanChooseMove?
  .pbCanSwitch?
  .pbSendOut
  .pbGainExpOne
  .pbRun
  .pbLearnMove
  .pbJudge
  .pbDisplay
  .pbStartBattle
  .pbCommandPhase
  .pbAttackPhase
  .pbEndOfRoundPhase
  .pbEndOfBattle
Página principal: Battles

This section defines the PokeBattle_Battle class, which handles the main battle process, from starting the battle through processing the phases (command, attack and end-of-round) to calculating the result and awarding Exp/money.

Two methods defined in PokeBattle_Battle, pbRandom and pbAIRandom, are called whenever the battle needs a random number to use. By default, they simply call Ruby's rand() method, but they can be easily overridden to use another random number generator, if desired.

The method pbJudge is called after every step of battle where a pokemon can get damaged. It determines which side of the battle won, if any side has won yet.

The method pbGainExpOne has code to celebrate a level up, and the method pbLearnMove is called to ask the player which move will be forgotten for a new move learned.


PokeBattle_AI Editar

Definiciones
PBTrainerAI.minimumSkill=1
PBTrainerAI.mediumSkill=32
PBTrainerAI.highSkill=48
PBTrainerAI.bestSkill=100
PokeBattle_Battle
  .pbGetMoveScore
  .pbRoughDamage
  .pbChooseMoves
  .pbEnemyShouldUseItem?
  .pbEnemyShouldWithdraw?
Página principal: Battle AI

This section extends the PokeBattle_Battle class to add several methods for the AI to use in determining what enemy trainers should do in battle. The pbGetMoveScore consists of a gigantic case statement with function codes for every move, and individually weights the viability of the given move.

This section also defines PBTrainerAI, which enumerates the thresholds for AI skill levels (given for a trainer class in the trainertypes.txt file). 0 is defined as a wild pokemon; 1-31 is for basic, inexperienced trainers; 32-47 for trainers with some skill; 48-99 for trainers with high skill, and 100 for expert trainers like gym leaders and the E4.


PokeBattle_SceneConstants Editar

This section defines the PokeBattle_SceneConstants module, which contains various values which are used to determine the layout and appearance of the battle screen.


PokeBattle_Scene Editar

Página principal: Battles

This section defines the PokeBattle_Scene class and several helper classes, which handle all the visual features of the battle screen, including the command menus, information boxes, all the sprites, and various animations (Pokémon being called out/returned, throwing Poké Balls, fainting, HP/EXP bars, etc.).

Note: This section used to be called PokeBattle_ActualScene prior to version 16 of Essentials.


PokeBattle_AnimationPlayer Editar

This section defines a few classes that handle the displaying of animations that were defined in the Database or the Animation Editor, and the conversion of the former to the latter. The vast majority of these animations are those used in battle.


PokeBattle_SafariZone Editar

Página principal: Safari Zone

This section defines the PokeBattle_SafariZone and PokeBattle_FakeBattler classes, which handle the battle process for Safari Zone battles (instead of PokeBattle_Battle).


PokeBattle_BattlePalace Editar

This section defines the PokeBattle_BattlePalace class, a subclass of PokeBattle_Battle, which allows Battle Frontier-style Battle Palace battles, where pokemon choose their own moves based on their nature.


PokeBattle_BattleArena Editar

This section defines the PokeBattle_BattleArena class, a subclass of PokeBattle_Battle, which allows Battle Frontier-style Battle Arena battles, where two pokemon fight for three rounds and are then judged on their mind, body, and skill rankings.


PokeBattle_BattleRecord Editar

Definiciones
PokeBattle_RecordedBattle
PokeBattle_RecordedBattlePalace
PokeBattle_RecordedBattleArena
PokeBattle_BattlePlayer
PokeBattle_BattlePalacePlayer
PokeBattle_BattleArenaPlayer

This section defines several subclasses which allow Essentials to record and play back recorded battles. This is used in the PBattle_OrgBattle section to record the organized battles.


PokeBattle_OtherScenes Editar

This section contains classes which defined simple, debug implementation of a battle scene. It is mainly used for debugging purposes.

Note: This section used to be called PokeBattle_Scene prior to version 16 of Essentials.


PokeBattle_BattlePeer Editar

This section defines the PokeBattle_RealBattlePeer class, which handles the storing of newly-caught Pokémon in either the party or Pokémon storage.


PokeBattle_Clauses Editar

This section extends the PokeBattle_Battle and PokeBattle_Battler classes, as well as a few move classes, to handle various battle rules that can be applied to battles, e.g. in the Battle Factory and various Stadium cups. This includes things like the "sleepclause", the "evasionclause", the "selfkoclause", etc.


PBTerrain Editar

Definiciones
PBTerrain.isWater?
PBTerrain.isGrass?
PBTerrain.isLedge?
PBTerrain.isIce?
PBTerrain.isBridge?
PBTerrain.hasReflections?

This section defines the PBTerrain module, which enumerates the available terrain tags that can be used on a tileset.


PField_Field Editar

Definiciones
DarknessSprite
LocationWindow
LightEffect
EncounterModifier
Events
  .onAction
  .onStartBattle
  .onEndBattle
  .onMapCreate
  .onMapChange
  .onMapChanging
  .onStepTaken
  .onLeaveTile
  .onStepTakenFieldMovement
  .onStepTakenTransferPossible
  .onMapUpdate
  .onWildBattleOverride
  .onWildBattleEnd
  .onWildPokemonCreate
  .onTrainerPartyLoad
  .onMapSceneChange
  .onSpritesetCreate
pbBattleAnimation
pbGenerateWildPokemon
pbWildBattle
pbCheckAllFainted
pbEvolutionCheck
Kernel.pbPickup
Kernel.pbSlideOnIce
Kernel.pbUpdateVehicle
Kernel.pbStartOver
Kernel.pbItemBall
pbRecord
pbEventFacesPlayer?
pbFacingTile
Kernel.pbMoveTowardPlayer

This section contains the bulk of the code for various things done in the field (that is, the overworld). These include:

  • Circle of darkness (for dark caves where Flash hasn't been used yet).
  • Location signpost window (showing the map's name when stepping onto a new map).
  • Light effects (for sprites that illuminate areas - shadows being cast are defined elsewhere).
  • The animation used to fade the screen before a battle.
  • Generating wild Pokémon and battles with them (both single and double).
  • The Pickup ability.
  • Jumping over a ledge.
  • Events that automatically occur:
    • When a battle is started.
    • When the player takes a step (poison and happiness gain, sliding on ice, animating tall grass).
    • When the player enters a different map (change the weather, display the location window, etc.).
    • When the map scene changes (e.g. Flash is used, automatically mount the bicycle).
    • When the map updates (i.e. every frame).
  • Setting the last visited Poké Center location.
  • Starting/finishing surfing and cycling.
  • Fishing.
  • Whiting out after having all party Pokémon faint, and returning to the last Poké Center visited.
  • The animation for entering a cave.
  • Registering and deregistering a partner trainer.
  • Recording sound.
  • Interacting with an item ball, and receiving an item from an NPC.
  • Boulder movements.


PField_FieldWeather Editar

Página principal: Weather

This section defines the PBFieldWeather module, which enumerates all the types of field weather available. It also extends the RPG::Weather class to handle the animations for out-of-battle weather. All other aspects of weather are handled elsewhere.


PField_Metadata Editar

This section defines the PokemonGlobalMetadata class, which is stored in $PokemonGlobal. This class stores a lot of miscellaneous data, including things like if the player is surfing or cycling, the player's step count, the players last pokemon center, the daycare, the mailbox, the item pc storage, etc.


PField_MapFactory Editar

This section defines the MapFactoryHelper module and the PokemonMapFactory class. They handle loading and displaying map connections, and collisions across connection boundaries.


PField_HiddenMoves Editar

Definiciones
Kernel.pbCanUseHiddenMove?
Kernel.pbUseHiddenMove
Kernel.pbHiddenMoveEvent
pbHiddenMoveAnimation
Kernel.pbCut
Kernel.pbHeadbutt
Kernel.pbRockSmash
Kernel.pbStrength
Kernel.pbSurf
Kernel.pbWaterfall
Kernel.pbDive
Kernel.pbTransferUnderwater
Kernel.pbTransferSurfing
Página principal: Using moves outside battle

This section defines the HiddenMoveHandlers module, which handles using moves outside battle. The bulk of this section contains handlers and methods for each of the field moves, including handlers for using them from the menu and using them by interacting with events or particular terrain tags.

Handlers added to HiddenMoveHandlers::CanUseMove and HiddenMoveHandlers::UseMove will be called when the player selects a move from the party menu, while the various Kernel.* methods defined are to be called from events.

This section also defines Kernel.pbTransferSurfing and Kernel.pbTransferUnderwater. If a doorway uses the normal transfer command, it automatically cancels any surfing or diving animations for the player. Thus, if the player can only travel through a given doorway while surfing or diving, you must use these respective methods to keep the player in the state of surfing or diving when they arrive on the other side of the transfer.


PField_Encounters Editar

Página principal: Encounters

This section defines the EncounterTypes module, which enumerates the encounter types and rates. It also defines the PokemonEncounters class, which handles other information relating to wild Pokémon encounters, including generating them.


PField_EncounterModifiers Editar

Página principal: Encounters

This section is for procedures which change wild Pokémon encounters in some way. An existing example is one which makes the wild Pokémon shiny if a certain Global Switch is ON.


PField_RoamingPokemon Editar

Definiciones
pbResetAllRoamers
pbRoamPokemon
pbRoamingPokemonBattle
Página principal: Roaming Pokémon

This section defines several methods which handle roaming Pokémon. It keeps track of all roaming Pokémon, changes their positions when a new map is entered, and triggers a battle with a roamer if appropriate.


PField_RandomDungeons Editar

Definiciones
AntiRandom
DungeonMaze
Maze
Dungeon
pbRandomRoomTile
Página principal: Dungeons

This section defines several classes to handle the generation of random dungeon maps.


PField_BerryPlants Editar

Definiciones
pbBerryPlant
pbPickBerry
BerryPlantSprite
BerryPlantMoistureSprite
Página principal: Berry planting

This section defines the pbBerryPlant method, along with helper classes, which handle the berry planting process.


PField_DayCare Editar

Definiciones
pbEggGenerated?
pbDayCareDeposited
pbDayCareDeposit
pbDayCareGetLevelGain
pbDayCareGetDeposited
pbDayCareWithdraw
pbDayCareChoose
pbDayCareGenerateEgg
Página principal: Day Care
Página principal: Breeding

This section defines several methods which handle the Day Care system, both the storing of Pokémon to be trained and the breeding aspect. It contains scripts that determine whether or not breeding should take place, generate eggs when appropriate, give experience to stored Pokémon, teach moves to Pokémon as they level up while in training, etc.


PField_DependentEvents Editar

Definiciones
pbRemoveDependencies
pbAddDependency
pbRemoveDependency
pbAddDependency2
pbGetDependency
pbRemoveDependency2
DependentEvents
  .pbEnsureEvent
  .pbFollowEventAcrossMaps
  .updateDependentEvents
DependentEventSprites
Página principal: Partner trainer

This section defines the DependentEvents class, which handles dependent events.


PField_Time Editar

Definiciones
pbGetTimeNow
PBDayNight.isDay?
PBDayNight.isNight?
PBDayNight.isMorning?
PBDayNight.isAfternoon?
PBDayNight.isEvening?
PBDayNight.getShade
pbDayNightTint
moonphase
zodiac
pbIsWeekday
pbIsMonth
pbIsSeason
pbIsSpring
Página principal: Time

This section defines the PBDayNight module, which handles the day/night system in Essentials. It also contains some methods that calculate various astrological features (e.g. the moon's phase, the zodiac sign), and methods that check the current day, month, and season.


PokeBattle_Trainer Editar

Definiciones
PokeBattle_Trainer
  .getForeignID
  .outfit
  .pokemonParty
  .ablePokemonParty
  .firstAblePokemon
  .lastPokemon
Página principal: Player

This section defines the PokeBattle_Trainer class, which handles a trainer's information, including their name, badges owned, money, their current party, the Pokédex completion and so on. The player is the primary example of this class, and the only persistent instance (stored in $Trainer). But a PokeBattle_Trainer instance is created for every trainer participant when a battle begins.


PTrainer_NPCTrainers Editar

Definiciones
pbLoadTrainer
pbTrainerCheck
pbMissingTrainer
pbTrainerBattle
pbDoubleTrainerBattle
TrainerWalkingCharSprite
Página principal: Trainers

This section defines several methods which handle enemy trainers, most notably the trainer battle methods. pbLoadTrainer loads and check individual trainers and their teams (from the PBS file "trainers.txt"). Debug features such as the ability to add a new trainer are also defined here.


PItem_Items Editar

Definiciones
pbIsHiddenMove?
pbGetPocket
pbIsMachine?
pbIsMail?
pbIsSnagBall?
pbIsKeyItem?
pbIsMegaStone?
pbChangeLevel
pbItemRestoreHP
pbHPItem
pbRaiseEffortValues
pbRestorePP
pbBikeCheck
pbClosestHiddenItem
pbLearnMove
pbUseItem
ItemHandlers.addUseFromBag
ItemHandlers.addUseInField
ItemHandlers.addUseOnPokemon
ItemHandlers.addBattleUseOnBattler
ItemHandlers.addBattleUseOnPokemon
Página principal: Items

This section defines several methods which handle various generic effects an item can have (e.g. modify HP/PP), as well as teaching a move to a Pokémon. It also contains a few useful methods that can be used to decide what kind of item something is (e.g. one you shouldn't toss, a mail item, etc.).


PItem_ItemEffects Editar

Página principal: Item effects

This section defines over a hundred handlers implementing the effects of each item that can be actively used (i.e. not held items).


PItem_PokeBalls Editar

Definiciones
BallHandlers::IsUnconditional
BallHandlers::ModifyCatchRate
BallHandlers::OnCatch
BallHandlers::OnFailCatch
pbBallTypeToBall
pbGetBallType
$BallTypes
Página principal: Items

This section defines the handlers for modifying the various Poké Balls, or handling their effects. This file also has the mapping from ball type to PBItem enum.


PItem_PokeRadar Editar

Definiciones
pbCanUsePokeRadar?
pbUsePokeRadar
pbPokeRadarHighlightGrass
pbPokeRadarGetShakingGrass
pbPokeRadarGetEncounter
Página principal: Poké Radar

This section defines methods and item handlers to operate the Poké Radar, including using the item, making grass shake and changing the probability that the chained Pokémon are shiny.


PItem_Mail Editar

Definiciones
PokemonMail
pbMoveToMailbox
pbStoreMail
pbDisplayMail

This section defines the PokemonMail class, as well as several helper methods to use and move mail around.


PItem_Sprites Editar

This section defines the ItemIconSprite class, which handles displaying the item icon in the bag or mart screen. Interestingly, the icons can be animated if the icon is a 48 pixel tall image that has its animation frames laid out horizontally (48 pixels wide for each frame).


PokeBattle_Pokemon Editar

Definiciones
PokeBattle_Pokemon
  .isForeign?
  .timeReceived
  .isEgg?
  .isMale?
  .makeMale
  .setAbility
  .hasHiddenAbility?
  .isShiny?
  .makeShiny
  .makeNotShiny
  .givePokerus
  .hasType?
  .knowsMove?
  .resetMoves
  .pbLearnMove
  .pbRecordFirstMoves
  .hasRibbon?
  .hasItem?
  .unownShape
  .heal
  .calcStats
Página principal: Pokémon

This section defines the PokeBattle_Pokemon class, which (despite its name) defines a Pokémon outside of battle.


Pokemon_MultipleForms Editar

Definiciones
PokeBattle_Pokemon
  .form
  .forceForm
MultipleForms
pbSpindaSpots
Página principal: Multiple forms

This section extends the PokeBattle_Pokemon class and defines the MultipleForms module to handle the multiple forms some Pokémon can have, and defines all the stats and other information for each form that differs from its base form.


Pokemon_MegaEvolution Editar

Página principal: Mega Evolution

This section extends the PokeBattle_Pokemon class to add mega forms to all appropriate pokemon, by adding handlers to the the MultipleForms module defined above.


Pokemon_ShadowPokemon Editar

Definiciones
pbPurify
pbRelicStoneScreen
pbRelicStone
pbIsPurifiable?
pbRaiseHappinessAndReduceHeart
PokeBattle_Pokemon
  .hypermode
  .heartStage
  .makeShadow
pbReadyToPurify
PokeBattle_Battler
  .pbHyperMode
  .pbHyperModeObedience
Página principal: Shadow Pokémon

This section handles everything related to Shadow Pokémon. This section defines the heart gauges on pokemon, defines the Relic Stone, adds handlers for scent items, defines the effects of Hyper Mode (actually Pokemon XD-style "Reverse Mode", but misnamed "Hyper Mode"), and defines classes for every shadow move introduced in XD.

The Purify Chamber is handled in its own section.


Pokemon_Evolution Editar

Definiciones
PBEvolution
SpriteMetafile
SpriteMetafilePlayer
PokemonEvolutionScene
pbGetEvolvedFormData
pbGetPreviousForm
pbGetMinimumLevel
pbGetBabySpecies
pbSaveSpriteState
pbRestoreSpriteState
pbSaveSpriteStateAndBitmap
pbRestoreSpriteStateAndBitmap
pbCheckEvolution
Página principal: Evolution

This section defines the PBEvolution module, which enumerates all of the various evolution methods available (including 5 "custom" methods). It also defines PokemonEvolutionScene, which plays the evolution animation scene, and the pbCheckEvolution method, which checks if the pokemon can evolve now.


Pokemon_Chatter Editar

This section defines the pbChatter, which handles the out-of-battle part of the move Chatter, which is the ability to record a new sound for it to use.


Pokemon_Sprites Editar

Definiciones
PokemonSprite
PokemonBattlerSprite
PokemonIconSprite
PokemonSpeciesIconSprite
getBattleSpriteMetricOffset
adjustBattleSpriteY
pbPositionPokemonSprite
pbSpriteSetCenter
showShadow?

Esta sección define cuatro clases de sprite para mostrar pokemon. También define métodos que manejan el ajuste de la altura de los sprites battler de acuerdo con las tres métricas definidas para esa especie en el archivo PBS "pokemon.txt".

PScreen_PauseMenu Editar

Página principal: Pause menu

This section defines PokemonMenu_Scene and PokemonMenu, which handles the Pause menu. There is code in here to modify the menu when the player is in the Safari Zone or a Bug Catching Contest.


PScreen_Pokedex Editar

Definiciones
Window_DexesList
Scene_PokedexMenu
Window_CommandPokemonWhiteArrow
Window_Pokedex
Window_ComplexCommandPokemon
PokemonPokedexScene
PokemonPokedex
Página principal: Pokédex

This section defines PokemonPokedexScene, which handles the Pokédex screens, namely everything except the Area and Forms pages.


PScreen_PokedexNestForm Editar

Definiciones
pbFindEncounter
PokemonNestMapScene
PokemonNestMap
PokedexFormScene
PokedexForm
Página principal: Pokédex

This section defines PokemonNestMapScene and PokedexFormScene, which handles (respectfully) the Area and Forms pages of the Pokédex.


PScreen_Party Editar

Definiciones
PokeSelectionPlaceholderSprite
PokeSelectionConfirmCancelSprite
PokeSelectionCancelSprite
PokeSelectionConfirmSprite
ChangelingSprite
PokeSelectionSprite
PokemonScreen_Scene
PokemonScreen
Página principal: Party

This section defines PokemonScreen, which handles the party screen and choosing Pokémon from the party.


PScreen_Summary Editar

Definiciones
MoveSelectionSprite
PokemonSummaryScene
PokemonSummary
Página principal: Summary screens

This section defines PokemonSummaryScene, which handles the Pokémon summary screens, accessible from the Party screen and Pokémon storage. Data relevant to the selected Pokémon is displayed across five pages.


PScreen_Bag Editar

Definiciones
Window_PokemonBag
PokemonBag_Scene
PokemonBagScreen
PokemonBag
Window_PokemonItemStorage
ItemStorageScene
WithdrawItemScene
TossItemScene
PCItemStorage
UIHelper
Página principal: Bag

This section defines the PokemonBag and PCItemStorage classes, which hold the items the player is carrying (stored in $PokemonBag and $PokemonGlobal.pcItemStorage, respectfully). This section also defines the PokemonBagScreen and ItemStorageScene classes, which handle the Bag screen and item storage screen, respectfully.


PScreen_Pokegear Editar

Definiciones
PokegearButton
Scene_Pokegear
Página principal: Pokégear

This section defines the Scene_Pokegear class, which handles the Pokégear's main screen, i.e. the list of applications it has.


PScreen_RegionMap Editar

Definiciones
MapBottomSprite
PokemonRegionMapScene
PokemonRegionMap
pbShowMap
Página principal: Region map

This section defines the PokemonRegionMapScene screen, which handles displaying the region map. It is used when examining a map (from the Pokégear, the Town Map item, or a map on a wall) or when using Fly. This section defines the pbShowMap method, which can be called from an event to display a wall map.


PScreen_Phone Editar

Definiciones
Window_PhoneList
PokemonPhoneScene
pbRandomPhoneTrainer
pbPhoneRegisterNPC
pbPhoneRegister
pbPhoneRegisterBattle
pbPhoneDeleteContact
pbPhoneReadyToBattle?
pbCallTrainer
pbSetReadyToBattle
pbPhoneGenerateCall
pbEncounterSpecies
pbTrainerMapName
pbTrainerSpecies
pbPhoneCall
Página principal: Phone

This section defines the PokemonPhoneScene and several methods which handle the phone, including registering trainers, generating random phone calls, deciding when the trainers become available for rematches, and the phone screen.


PScreen_Jukebox Editar

Página principal: Jukebox

This section defines the Scene_Jukebox class, which handles the Jukebox application of the Pokégear.


PScreen_TrainerCard Editar

Página principal: Trainer card

This section defines the PokemonTrainerCardScene and PokemonTrainerCard classes, which handle the Trainer card screen.


PScreen_Load Editar

Definiciones
PokemonLoadPanel
PokemonLoadScene
PokemonLoad
FontInstaller
Página principal: Saving and loading

This section defines the PokemonLoad class. This class handles loading data from the save file, as well as displaying the Continue/New Game screen, starting a new game, and deleting a save file.

This section also contains the FontInstaller class, which checks whether the necessary fonts are installed, and attempts to install them if they are not.


PScreen_Save Editar

Definiciones
PokemonSaveScene
pbEmergencySave
pbSave
PokemonSave
Página principal: Saving and loading

This section defines the pbSave method, which handles saving the game.


PScreen_Options Editar

Definiciones
Window_PokemonOption
EnumOption
NumberOption
SliderOption
PokemonSystem
PokemonOptionScene
PokemonOption
Página principal: Options screen

This section defines PokemonOptionScene, which handles the Options screen. This screen includes settings for the window skin, font, text speed, etc. It also lists the available message box skins and fonts.

Lines 512 to 526 and specially marked with comments in this section: if you do not want your players to be able to change the size of the game from the default "Medium" (that is, 2 times the size of pokemon's graphics), you should comment out or delete that section.


PScreen_Storage Editar

Página principal: Pokémon storage
Página principal: PC
Definiciones
PokemonBox
PokemonStorage
PokemonStorageWithParty
PokemonStorageScreen
Interpolator
PokemonBoxArrow
PokemonBoxPartySprite
MosaicPokemonSprite
AutoMosaicPokemonSprite
PokemonBoxSprite
PokemonStorageScene
RegionalStorage
TrainerPC
StorageSystemPC
Kernel.pbGetStorageCreator
pbPCItemStorage
pbPCMailbox
pbTrainerPC
pbPokeCenterPC
PokemonPCList.registerPC

This section defines PokemonStorage and PokemonBox, which contain pokemon stored in the storage system. It also defines various classes to implement the storage screen, and a class to handle Regional Pokémon storage.

At the bottom of this section, there are scripts that handle what happens when the PC is used (i.e. the menus and mail storage).

Note: This section adds the Storage System PC and Trainer PC to the Pokemon Center PC list that is displayed when the player turns on a PC. It does this by creating classes for each, with the methods shouldShow?, name, and access defined, and passing a new instance of that class to PokemonPCList.registerPC.


PScreen_EggHatching Editar

Definiciones
PokemonEggHatchScene
PokemonEggHatchScreen
pbHatchAnimation
pbHatch

This section contains all the scripts relating to the hatching of eggs, including the animation that plays when an egg hatches and the timer which reduces the number of steps left before an egg hatches.


PScreen_Trading Editar

Definiciones
PokemonTradeScene
pbStartTrade
pbTradeCheckEvolution
Página principal: Trading Pokémon

This section defines the pbStartTrade method, which handles the Pokémon trade screen. It also contains a check for whether the newly received Pokémon should evolve because of the trade.


PScreen_MoveRelearner Editar

Definiciones
MoveRelearnerScene
MoveRelearnerScreen
pbEachNaturalMove
pbGetRelearnableMoves
pbRelearnMoveScreen
Página principal: Special NPCs

This section defines the pbRelearnMoveScreen method, which handles the Move Relearner feature. It handles the teaching part only; usually there is a price to pay for this feature, and that should be implemented separately.


PScreen_PurifyChamber Editar

Definiciones
PurifyChamberSet
PurifyChamber
PurifyChamberPC
PurifyChamberHelper
PurifyChamberScreen
Window_PurifyChamberSets
DirectFlowDiagram
FlowDiagram
PurifyChamberSetView
PurifyChamberScene
pbPurifyChamber
Página principal: Shadow Pokémon

This section defines the pbPurifyChamber method, and many support classes, which handle the Purify Chamber for Shadow Pokémon. This section adds the Purify Chamber option to the PC in the same way as outlined in PScreen_Storage.


PScreen_Mart Editar

Definiciones
PokemonMartAdapter
RpgxpMartAdapter
Window_PokemonMart
PokemonMartScene
PokemonMartScreen
pbPokemonMart
Página principal: Poké Mart

This section defines the pbPokemonMart method, which handles the Poké Mart screen.


PScreen_MysteryGift Editar

Definiciones
MYSTERYGIFTURL
pbEditMysteryGift
pbCreateMysteryGift
pbManageMysteryGifts
pbRefreshMGCommands
pbDownloadMysteryGift
pbReceiveMysteryGift
Página principal: Mystery Gift

This section handles the Mystery Gift system. The methods defined here are called by the load screen, defined above.

Tip: The MYSTERYGIFTURL constant, defined at the top of this file, is the URL the game will check for the mystery gift. This url must point to the raw text file and not a landing page generated by an uploading service. You can test to see if the game will accept the mystery gift file by putting the url you have into a browser's incognito mode / private browsing mode window. If you can load up the text file in that window without logging into anything or clicking through anything, then the game will be able to access the text file successfully itself.


PScreen_HallOfFame Editar

Definiciones
HallOfFameScene
HallOfFameScreen
HallOfFamePC
pbHallOfFameEntry
pbHallOfFamePC

This section defines the HallOfFameScene class, which contains all the scripts related to the Hall of Fame. This section adds the Hall of Fame option to the PC in the same way as outlined in PScreen_Storage.


PBattle_Safari Editar

Definiciones
SafariState
pbInSafari?
pbSafariState
pbSafariBattle
Página principal: Safari Zone

This section handles the Safari Zone, except the Safari Zone battles themselves. It keeps track of steps taken, Balls remaining, etc.


PBattle_BugContest Editar

Definiciones
BugContestState
pbBugContestScore
pbBugContestState
pbInBugContest?
PokeBattle_BugContestBattle
Kernel.pbBugContestStartOver
pbBugContestBattle
Página principal: Bug Catching Contest

This section handles all aspects of Bug Catching Contests, including battles, keeping track of time, Park Balls, and judging.


PBattle_OrgBattle Editar

Definiciones
PBPokemon
BattleChallengeType
BattleChallengeData
BattleChallenge
BattleFactoryData
pbHasEligible?
pbIsBanned?
pbGetBTTrainers
pbGetBTPokemon
pbRecordLastBattle
pbPlayBattle
pbPlayLastBattle
pbBattleChallenge
pbBattleChallengeTrainer
pbBattleFactoryPokemon
pbGenerateBattleTrainer
pbOrganizedBattleEx

This section defines several methods and classes related to organized Battle Frontier-style battles. This includes:

  • Methods to record a battle challenge battle.
  • Methods to create a Battle Challenge or Battle Factory battle
  • Methods to determine if a trainer has eligible pokemon.


PBattle_OrgBattleRules Editar

Definiciones
LevelAdjustment
LevelBalanceAdjustment
SinglePlayerCappedLevelAdjustment
OpenLevelAdjustment
TotalLevelAdjustment
AblePokemonRestriction
SpeciesRestriction
BannedSpeciesRestriction
BannedItemRestriction
StandardRestriction
MaximumLevelRestriction
WeightRestriction
HeightRestriction
ItemsDisallowedClause
SameSpeciesClause
BabyRestriction
LittleCupRestriction
NicknameClause
PokemonRuleSet
BattleType
BattleRule
PokemonChallengeRules
StandardRules
pbPikaCupRules
pbFancyCupRules
pbBattleTowerRules
pbBattleFactoryRules

This section defines dozens of classes related to rules and restrictions on organized battles, as well as method to combine these classes into a ruleset for use in challenges and tournaments. It also has a commented out section at the bottom which outlines various rulesets previously used by real world Tournaments put on by the Pokemon Company in the past.


PBattle_OrgBattleGenerator Editar

Definiciones
BaseStatRestriction
NonlegendaryRestriction
InverseRestriction
SingleMatch
MatchHistory
PlayerRating
RuledTeam
pbRandomMove
addMove
pbGetLegalMoves2
baseStatTotal
withRestr
pbArrangeByTier
pbRandomPokemonFromRule
pbRuledBattle
pbTrainerInfo
pbGenerateChallenge
pbWriteCup

This section defines several methods and classes related to generating random trainers to adhere to a given ruleset for an organized battle.


PBattle_BattleSwap Editar

Definiciones
BattleSwapScene
BattleSwapScreen

This section defines the BattleSwapScreen and BattleSwapScene classes, which implement the pokemon rental screen used for the Battle Frontier-style Battle Factory.


PMinigame_Duel Editar

Definiciones
DuelWindow
PokemonDuel
pbDuel
Página principal: Mini-games

This section defines the pbDuel method and PokemonDuel class, which handles the overworld Duel mini-game.


PMinigame_TripleTriad Editar

Definiciones
TriadCard
TriadSquare
TriadScene
TriadScreen
TriadStorage
pbBuyTriads
pbSellTriads
pbTriadList
pbTriadDuel
pbGiveTriadCard
Página principal: Triple Triad

This section defines methods and classes which handle the Triple Triad card mini-game.


PMinigame_SlotMachine Editar

Definiciones
SlotMachineReel
SlotMachineScore
SlotMachineScene
SlotMachine
pbSlotMachine
Página principal: Mini-games

This section defines the pbSlotMachine method, which handles the Slot Machine mini-game.


PMinigame_VoltorbFlip Editar

Definiciones
VoltorbFlip
VoltorbFlipScreen
pbVoltorbFlip
Página principal: Mini-games

This section defines the pbVoltorbFlip method, which handles the Voltorb Flip mini-game.


PMinigame_Lottery Editar

Definiciones
pbSetLotteryNumber
pbLottery
Página principal: Mini-games

This section defines the pbLottery method, which handles the lottery mini-game.


PMinigame_Mining Editar

Definiciones
MiningGameCounter
MiningGameTile
MiningGameCursor
MiningGameScene
MiningGame
pbMiningGame
Página principal: Mini-games

This section defines the pbMiningGame method, which handles the Mining mini-game.


PMinigame_TilePuzzles Editar

Definiciones
TilePuzzleCursor
TilePuzzleScene
TilePuzzle
pbTilePuzzle
Página principal: Mini-games

This section defines the pbTilePuzzle method, which handles the Tile Puzzle game.


PSystem_Controls Editar

Definiciones
Input
Mouse
Página principal: Controls

This section redefines the Input module, which handles the game controls and translating them from a keyboard press into an input. It also contains some mouse support.


PSystem_System Editar

Definiciones
pbSafeLoad
pbChooseLanguage
pbSetUpSystem
pbScreenCapture
pbDebugF7

This section defines a few small methods which set up the game.


PSystem_Utilities Editar

Definiciones
LinearCongRandom
ItemStorageHelper
pbEachCombination
pbGetMyDocumentsFolder
pbGetLanguage
toFahrenheit
toCelsius
pbIsJsonString
pbParseJson
MiniXmlReader
pbChangePlayer
pbGetPlayerGraphic
pbTrainerName
pbSuggestTrainerName
pbGetUserName
getRandomName
pbTimeEvent
pbTimeEventValid
isConst?
getConst
getID
pbFadeOutInWithMusic
getWaveDataUI
beginRecordUI
pbHideVisibleObjects
pbLoadRpgxpScene
pbCommonEvent
pbPokemonBitmapFile
pbLoadPokemonBitmap
pbLoadPokemonBitmapSpecies
pbLoadSpeciesBitmap
pbLoadPokemonIcon
pbPokemonIconFile
pbItemIconFile
pbTrainerCharFile
pbTrainerSpriteFile
pbPlayerSpriteFile
pbResolveAudioSE
pbCryFrameLength
pbPlayCry
pbGetWildBattleBGM
pbGetTrainerBattleBGM
pbGetTrainerVictoryME
pbNickname
pbStorePokemon
pbNicknameAndStore
pbAddPokemon
pbAddPokemonSilent
pbAddToParty
pbAddForeignPokemon
pbGenerateEgg
pbSeenForm
pbHealAll
pbAllFainted
pbBalancedLevel
pbSize
pbHasEgg?
pbChoosePokemon
pbChooseAblePokemon
pbChoosePokemonForTrade
pbHasSpecies?
pbHasFatefulSpecies?
pbCheckMove
pbGetRegionalNumber
pbGetCurrentRegion
pbGetNationalNumber
pbUnlockDex
pbTextEntry
pbMoveTutorChoose
pbChooseMove
pbPokemonScreen
pbSaveScreen
pbRecordTrainer

This section contains a number of extra methods that don't fit elsewhere. These include:

  • Methods that gather information from the player's computer.
  • The LinearCongRandom class, which is an implementation of the RNG system used by the actual pokemon core series (but is unused in Essentials by default).
  • Methods to parse JSON and XML.
  • Convenience methods to define and name the player character, or get information about the player character.
  • Various utility methods, including those for Event timing and getting Constants.
    • pbGet and pbSet: the preferred way to get and set global variables.
    • pbExclaim and pbNoticePlayer: used for events that spot the player at a distance.
    • Methods that load Pokémon sprites and icons.
    • Various sound- and music-related methods.
    • Methods that add Pokémon in various ways, and stores/nicknames them.
  • The pbCreatePokemon method, which generates the Demo Party available from the Debug menu.
  • Methods involved with party manipulation.
  • A method that calculates a balanced version of a given party of Pokémon.
  • Methods that let the player choose a Pokémon from their party.
  • Methods that check if a pokemon in the player's party has a move.
  • Methods that return the Regional/National Dex numbers of a species, and one that compiles a Regional Dex list.
  • Move Tutor methods.


Debug Editar

Definiciones
PokemonDataCopy
PokemonDataWrapper
CommandList
Scene_Debug
pbMapTree
pbCompileTextUI
pbWarpToMap
pbDebugMenu
pbDebugScreen
pbDebugSetVariable
Página principal: Debug mode

This section defines the pbDebugMenu methods, which defines the Debug menu that can be accessed from the Pause menu.


TilesetEditor Editar

Definiciones
pbTilesetWrapper
PokemonTilesetScene
pbTilesetScreen

This section handles the Debug mode option that allows you to change the terrain tags of tiles in a tileset.


BattleAnimationsEditor Editar

Definiciones
Window_Menu
UIControl
Label
Button
Checkbox
TextField
Slider
OptionalSlider
TextSlider
OptionalTextSlider
ControlWindow
Clipboard
AnimationWindow
SpriteFrame
AnimationCanvas
pbSpriteHitTest
pbTrackPopupMenu
pbChooseNum
pbSetTone
pbCellProperties
pbTimingList
pbSelectAnim
pbAnimationsOrganiser
Página principal: Attack animations

This section defines dozens of UI classes and methods that are used in the Animation Editor, which is used for creating animations of moves being used in battle.


Editor Editar

Definiciones
GraphicsLister
MusicFileLister
MapScreenScene
MapLister
ItemLister
TrainerTypeLister
TrainerBattleLister
LimitProperty
ReadOnlyProperty
BooleanProperty
BGMProperty
TypeProperty
NatureProperty
PlayerProperty
MapProperty
pbIsOldSpecialType?
MakeshiftConsts.get
pbSavePokemonData
pbSaveItems
pbSaveTrainerTypes
pbSaveTownMap
pbSavePhoneData
pbSaveBTTrainers
pbFastInspect
pbSaveAllData
pbChooseSpecies
pbChooseItemList
pbCommands3
pbListScreen
pbPropertyList
pbEncounterEditorMap
pbTrainerTypeEditor
createRegionMap
pbEditorScreen
Página principal: Debug mode

This section defines many UI elements to handle the in-game Debug Mode editors, allowing you to edit the contents of some of the PBS files.


Compiler Editar

Definiciones
FileLineData
TrainerChecker
pbPrintException
pbEachFileSectionEx
pbCheckByte
csvfield!
pbGetCsvRecord
pbGetConst
parseTrainer
pbAddScript
pbWriteDefaultTypes
pbCompileTypes
pbCompileConnections
pbCompileItems
pbCompilePokemonData
pbCompileMachines
pbCompileTrainers
pbCompileMetadata
pbCompileAnimations
pbUpdateDoor
pbCompileAllData

This section handles the compiling of all information in the PBS files into a set of data the game can actually use.

Note: This section defines pbFixEventUse, which is responsible for going through your maps and events and fixing many minor common errors developers make in their coding, including things like replacing door transfers with properly done door events, normalizing the use of "\b" and "\r" in text, replacing "pbItemBall" with "pbReceiveItem" on non-item events, deleting superfluous exit commands, etc.

This section also defines pbConvertToItemEvent, which will turn a simple events named a certain way into full item ball events. For example, if you make a new event simply named "Item:POTION" or "HiddenItem:POTION", the compile will turn the event into a full Item Ball or Hidden Item event which will give the player one potion.

This section also defines pbConvertToTrainerEvent, which will turn an event into a trainer, as outlined by the Trainers page.

Basically, if something changes in your project after you do a test run of your game without your doing it (for better or worse), it is likely the fault of the Compiler script section.


Main Editar

This section defines the entry point of the game. It is what starts the game running and brings up the title screen. This section must always be the last script section.

If you are adding any extensions to the game from a tutorial on this wiki or a thread in the community forum, they will more often than not tell you to place it right above this section. This is because scripts placed lower will override scripts placed in higher script sections, but scripts placed below Main will never run, as Main is where the main game loop runs.


Compiled Scripts Editar

There are some classes and methods which are not defined in script sections, but are compiled directly from from PBS files by the Compiler. The following are classes you won't find defined in the Script Editor. All of these classes simply enumerate their values. They don't have any logic, but they'll usually have a method to get the printable name of the enum.

PBTypes Editar

This is the list of types, defined in types.txt. The script compiles to the following, from the unmodified example project:

 class PBTypes
   NORMAL=0
   #[...all defined types...]
   DARK=17
   def PBTypes.getName(id)
     return pbGetMessage(MessageTypes::Types,id)
   end
   def PBTypes.getCount; return 18; end
   def PBTypes.maxValue; return 17; end
 end

PBAbilities Editar

This is the list of all abilities, defined in abilities.txt. The script compiles to the following, from the unmodified example project:

 class PBAbilities
   STENCH=1
   #[...all defined abilities...]
   TERAVOLT=164
   def PBAbilities.getName(id)
     return pbGetMessage(MessageTypes::Abilities,id)
   end
   def PBAbilities.getCount
     return 164
   end
   def PBAbilities.maxValue
     return 164
   end
 end

PBMoves Editar

This is a list of all moves, defined in moves.txt. The script compiles to the following, from the unmodified example project:

 class PBMoves
   MEGAHORN=1
   #[...all defined moves...]
   WITHDRAW=559
   def PBMoves.getName(id)
     return pbGetMessage(MessageTypes::Moves,id)
   end
   def PBMoves.getCount
     return 559
   end
   def PBMoves.maxValue
     return 559
   end
 end

PBItems Editar

This is a list of all items, defined in items.txt. The script compiles to the following, from the unmodified example project:

 class PBItems
   REPEL=1
   #[...all defined items...]
   SHINYCHARM=525
   def PBItems.getName(id)
     return pbGetMessage(MessageTypes::Items,id)
   end
   def PBItems.getNamePlural(id)
     return pbGetMessage(MessageTypes::ItemPlurals,id)
   end
   def PBItems.getCount
     return 525
   end
   def PBItems.maxValue
     return 525
   end
 end

PBSpecies Editar

This is the list of pokemon species, defined from pokemon.txt. Note that the PBSpecies enum corresponds to the national pokedex number of the pokemon species, and thus you can use PBSpecies::QUILAVA as a constant for Quilava's national dex number. The script compiles to the following, from the unmodified example project:

 module PBSpecies
   BULBASAUR=1
   IVYSAUR=2
   #[...all defined pokemon...]
   MELOETTA=648
   GENESECT=649
   def PBSpecies.getName(id)
     return pbGetMessage(MessageTypes::Species,id)
   end
   def PBSpecies.getCount
     return 649
   end
   def PBSpecies.maxValue
     return 649
   end
 end

PBTrainers Editar

This is a list of all trainer types, defined in trainertypes.txt. The script compiles to the following, from the unmodified example project:

 class PBTrainers
   POKEMONTRAINER_Red=0
   #[...all defined trainer types...]
   CHAMPION=71
   def PBTrainers.getName(id)
     return pbGetMessage(MessageTypes::TrainerTypes,id)
   end
   def PBTrainers.getCount
     return 72
   end
   def PBTrainers.maxValue
     return 71
   end
end