Class: Interpreter

Inherits:
Interpreter_RMXP show all
Includes:
Util::SystemMessage
Defined in:
docs/00700_PSDK_Event_Interpreter.rb,
docs/00600_Script_RMXP.rb,
docs/01450_Systems_09000_Games.rb,
docs/01450_Systems_99990_Global_Systems.rb

Overview

Interpreter of the event script commands

Constant Summary collapse

FEC_SKIP_CODES =

List of command cods that needs to be skipped in order to detect the from event calling call

[108, 121, 122]
MODE_SWOOSH =

If the put item in pocket message is not shown

true
RECEIVED_POKEMON_ME =

Name of the file used as Received Pokemon ME (with additional parameter like volume)

['audio/me/rosa_yourpokemonevolved', 80]
SYSTEM_MESSAGE_HEADER =

Header of the system messages

':[windowskin=m_18]:\\c[10]'
DEFAULT_TRAINER_BGM =

Default BGM used for trainer battle (sent to AudioFile so no audio/bgm)

['xy_trainer_battle', 100, 100]
DEFAULT_EYE_BGM =

Default eye bgm for trainer encounter (direct, requires audio/bgm)

['audio/bgm/pkmrs-enc1', 100, 100]
DEFAULT_EXCLAMATION_SE =

Default exclamation SE for trainer encounter (direct, requires audio/se)

['audio/se/015-jump01', 65, 95]
EXCLAMATION_PARTICLE_DURATION =

Duration of the exclamation particle

54

Constants included from Util::SystemMessage

Util::SystemMessage::HAS_NUMBER_REG, Util::SystemMessage::IS_ITEM, Util::SystemMessage::IS_NUMBER1, Util::SystemMessage::IS_NUMBER2, Util::SystemMessage::IS_NUMBER3, Util::SystemMessage::IS_POKEMON, Util::SystemMessage::MESSAGES

Constants inherited from Interpreter_RMXP

Interpreter_RMXP::COMMAND_TRANSLATION, Interpreter_RMXP::LiteRGSS2RGSS_Input, Interpreter_RMXP::RGSS2LiteRGSS_Input

Instance Attribute Summary

Attributes inherited from Interpreter_RMXP

#event_id

Instance Method Summary collapse

Methods included from Util::SystemMessage

load_message, parse_opts, show_message, show_message_and_wait

Methods inherited from Interpreter_RMXP

#clear, #command_101, #command_102, #command_103, #command_104, #command_105, #command_106, #command_111, #command_112, #command_113, #command_115, #command_116, #command_117, #command_118, #command_119, #command_121, #command_122, #command_123, #command_124, #command_125, #command_126, #command_127, #command_128, #command_129, #command_131, #command_132, #command_133, #command_134, #command_135, #command_136, #command_201, #command_202, #command_203, #command_204, #command_205, #command_206, #command_207, #command_208, #command_209, #command_210, #command_221, #command_222, #command_223, #command_224, #command_225, #command_231, #command_232, #command_233, #command_234, #command_235, #command_236, #command_241, #command_242, #command_245, #command_246, #command_247, #command_248, #command_249, #command_250, #command_251, #command_301, #command_302, #command_303, #command_311, #command_312, #command_313, #command_314, #command_315, #command_316, #command_317, #command_318, #command_319, #command_320, #command_321, #command_322, #command_331, #command_332, #command_333, #command_334, #command_335, #command_336, #command_337, #command_338, #command_339, #command_340, #command_351, #command_352, #command_353, #command_354, #command_355, #command_402, #command_403, #command_411, #command_413, #command_601, #command_602, #command_603, #command_end, #command_skip, #eval_condition_script, #eval_script, #execute_command, #get_character, #initialize, #input_button, #iterate_actor, #iterate_battler, #iterate_enemy, #launch_common_event, #operate_value, #running?, #setup, #setup_choices, #setup_starting_event, #update

Constructor Details

This class inherits a constructor from Interpreter_RMXP

Instance Method Details

#add_egg(id) ⇒ PFM::Pokemon? Also known as: ajouter_oeuf

Add an egg to the Party (or in the PC)

Parameters:

  • id (Integer, Hash, Symbol, PFM::Pokemon)

    the id of the Pokemon, its db_symbol, a hash describing it (see: #generate_from_hash), or the Pokemon itself

Returns:

Author:

  • Nuri Yuri



164
165
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 164

def add_egg(id)
end

#add_item(item_id, no_delete = false, text_id: 4, no_space_text_id: 7, color: 11, count: 1)

Add an item to the bag if possible, will delete the event forever

Parameters:

  • item_id (Integer, Symbol)

    id of the item in the database

  • no_delete (Boolean) (defaults to: false)

    bypass the deletion of the event

  • text_id (Integer) (defaults to: 4)

    ID of the text used when the item is found

  • no_space_text_id (Integer) (defaults to: 7)

    ID of the text when the player has not enough space in the bag

  • count (Integer) (defaults to: 1)

    number of item to add

  • color (Integer) (defaults to: 11)

    color to put on the item name



535
536
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 535

def add_item(item_id, no_delete = false, text_id: 4, no_space_text_id: 7, color: 11, count: 1)
end

#add_items_to_limited_shop(symbol_of_shop, items_to_refill = [], quantities_to_refill = []) Also known as: ajouter_objets_magasin

Add items to a limited shop

Parameters:

  • symbol_of_shop (Symbol)

    the symbol of the existing shop

  • items_to_refill (Array<Symbol, Integer>) (defaults to: [])

    the array of the items’ db_symbol/id

  • quantities_to_refill (Array<Integer>) (defaults to: [])

    the array of the quantity to refill



704
705
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 704

def add_items_to_limited_shop(symbol_of_shop, items_to_refill = [], quantities_to_refill = [])
end

#add_limited_shop(symbol_of_shop, items_sym = [], items_quantity = [], shop_rewrite: false) Also known as: ajouter_un_magasin_limite

Create a limited shop (in the main PFM::Shop object)

Parameters:

  • symbol_of_shop (Symbol)

    the symbol to link to the new shop

  • items_sym (Array<Symbol, Integer>) (defaults to: [])

    the array containing the symbols/id of the items to sell

  • items_quantity (Array<Integer>) (defaults to: [])

    the array containing the quantity of the items to sell

  • shop_rewrite (Boolean) (defaults to: false)

    if the system must completely overwrite an already existing shop



697
698
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 697

def add_limited_shop(symbol_of_shop, items_sym = [], items_quantity = [], shop_rewrite: false)
end

#add_new_pokemon_shop(sym_new_shop, list_id, list_price, list_param, list_quantity = [], shop_rewrite: false) Also known as: ajouter_nouveau_magasin_pokemon

Create a limited Pokemon Shop

Parameters:

  • sym_new_shop (Symbol)

    the symbol to link to the new shop

  • list_id (Array<Integer>)

    the array containing the id of the Pokemon to sell

  • list_price (Array<Integer>)

    the array containing the prices of the Pokemon to sell

  • list_param (Array)

    the array containing the infos of the Pokemon to sell

  • list_quantity (Array<Integer>) (defaults to: [])

    the array containing the quantity of the Pokemon to sell

  • shop_rewrite (Boolean) (defaults to: false)

    if the system must completely overwrite an already existing shop



734
735
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 734

def add_new_pokemon_shop(sym_new_shop, list_id, list_price, list_param, list_quantity = [], shop_rewrite: false)
end

#add_parallax(image, x, y, z, zoom_x = 1, zoom_y = 1, opacity = 255, blend_type = 0)

Add a parallax

Parameters:

  • image (String)

    name of the image in Graphics/Pictures/

  • x (Integer)

    x coordinate of the parallax from the first pixel of the Map (16x16 tiles /!)

  • y (Integer)

    y coordinate of the parallax from the first pixel of the Map (16x16 tiles /!)

  • z (Integer)

    z superiority in the tile viewport

  • zoom_x (Numeric) (defaults to: 1)

    zoom_x of the parallax

  • zoom_y (Numeric) (defaults to: 1)

    zoom_y of the parallax

  • opacity (Integer) (defaults to: 255)

    opacity of the parallax (0~255)

  • blend_type (Integer) (defaults to: 0)

    blend_type of the parallax (0, 1, 2)



422
423
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 422

def add_parallax(*args)
end

#add_pokemon(pokemon_or_id, level = 5, shiny = false) ⇒ PFM::Pokemon? Also known as: ajouter_pokemon, ajouter_stocker_pokemon

Add a pokemon to the party or store it in the PC

Parameters:

  • pokemon_or_id (Integer, Symbol, PFM::Pokemon)

    the ID of the pokemon in the database or a Pokemon

  • level (Integer) (defaults to: 5)

    the level of the Pokemon (if ID given)

  • shiny (Boolean, Integer) (defaults to: false)

    true means the Pokemon will be shiny, 0 means it’ll have no chance to be shiny, other number are the chance (1 / n) the pokemon can be shiny.

Returns:

  • (PFM::Pokemon, nil)

    if nil, the Pokemon couldn’t be stored in the PC or added to the party. Otherwise it’s the Pokemon that was added.

Author:

  • Nuri Yuri



97
98
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 97

def add_pokemon(pokemon_or_id, level = 5, shiny = false)
end

#add_pokemon_to_shop(symbol_of_shop, list_id, list_price, list_param, list_quantity = [], pkm_rewrite: false) Also known as: ajouter_pokemon_au_magasin

Add Pokemon to a Pokemon Shop

Parameters:

  • symbol_of_shop (Symbol)

    the symbol of the shop

  • list_id (Array<Integer>)

    the array containing the id of the Pokemon to sell

  • list_price (Array<Integer>)

    the array containing the prices of the Pokemon to sell

  • list_param (Array)

    the array containing the infos of the Pokemon to sell

  • list_quantity (Array<Integer>) (defaults to: [])

    the array containing the quantity of the Pokemon to sell

  • pkm_rewrite (Boolean) (defaults to: false)

    if the system must completely overwrite the existing Pokemon



744
745
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 744

def add_pokemon_to_shop(symbol_of_shop, list_id, list_price, list_param, list_quantity = [], pkm_rewrite: false)
end

#add_rename_pokemon(pokemon_or_id, level = 5, shiny = false, num_char = 12) ⇒ PFM::Pokemon? Also known as: ajouter_renommer_pokemon

Add a pokemon to the party or store it in the PC and rename it

Parameters:

  • pokemon_or_id (Integer, Symbol, PFM::Pokemon)

    the ID of the pokemon in the database or a Pokemon

  • level (Integer) (defaults to: 5)

    the level of the Pokemon (if ID given)

  • shiny (Boolean, Integer) (defaults to: false)

    true means the Pokemon will be shiny, 0 means it’ll have no chance to be shiny, other number are the chance (1 / n) the pokemon can be shiny.

  • num_char (Integer) (defaults to: 12)

    the number of character the Pokemon can have in its name.

Returns:

  • (PFM::Pokemon, nil)

    if nil, the Pokemon couldn’t be stored in the PC or added to the party. Otherwise it’s the Pokemon that was added.

Author:

  • Nuri Yuri



157
158
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 157

def add_rename_pokemon(pokemon_or_id, level = 5, shiny = false, num_char = 12)
end

#add_specific_pokemon(hash) ⇒ PFM::Pokemon? Also known as: ajouter_pokemon_param

Add a pokemon (#add_pokemon) with specific informations

Parameters:

  • hash (Hash)

    the parameters of the Pokemon, see PFM::Pokemon#generate_from_hash.

Returns:

Author:

  • Nuri Yuri



114
115
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 114

def add_specific_pokemon(hash)
end

#animate_from_charset(lines, duration, reverse: false, repeat: false, last_frame_delay: false) ⇒ Boolean

Shortcut for get_character(@event_id).animate_from_charset(*args)

Parameters:

  • lines (Array<Integer>)

    list of the lines to animates (0,1,2,3)

  • duration (Integer)

    duration of the animation in frame (60frame per secondes)

  • reverse (Boolean) (defaults to: false)

    <default: false> set it to true if the animation is reversed

  • repeat (Boolean) (defaults to: false)

    <default: false> set it to true if the animation is looped

Returns:

  • (Boolean)


457
458
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 457

def animate_from_charset(lines, duration, reverse: false, repeat: false, last_frame_delay: false)
end

#call_battle_wild(id, level, shiny, no_shiny) #call_battle_wild(id, level, *args) #call_battle_wild(id, level, *args) Also known as: demarrer_combat

Start a wild battle

Overloads:

  • #call_battle_wild(id, level, shiny, no_shiny)

    Parameters:

    • id (Integer, Symbol)

      id of the Pokemon in the database

    • level (Integer)

      level of the Pokemon

    • shiny (Boolean)

      if the Pokemon is shiny

    • no_shiny (Boolean)

      if the Pokemon cannot be shiny

  • #call_battle_wild(id, level, *args)

    Parameters:

    • id (PFM::Pokemon, Symbol)

      First Pokemon in the wild battle.

    • level (Object)

      ignored

    • args (Array<PFM::Pokemon>)

      other pokemon in the wild battle.

  • #call_battle_wild(id, level, *args)

    Parameters:

    • id (Integer, Symbol)

      id of the Pokemon in the database

    • level (Integer)

      level of the first Pokemon

    • args (Array<Integer, Integer>)

      array of id, level of the other Pokemon in the wild battle.

Author:

  • Nuri Yuri



182
183
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 182

def call_battle_wild(id, level, *args)
end

#call_party_menu(id_var = ::Yuki::Var::Party_Menu_Sel, party = $actors, mode = :map, extend_data = nil) Also known as: appel_menu_equipe

Show the party menu in order to select a Pokemon

Parameters:

  • id_var (Integer) (defaults to: ::Yuki::Var::Party_Menu_Sel)

    id of the variable in which the index will be store (-1 = no selection)

  • party (Array<PFM::Pokemon>) (defaults to: $actors)

    the array of Pokemon to show in the menu

  • mode (Symbol) (defaults to: :map)

    the mode of the Menu (:map, :menu, :item, :hold, :battle)

  • extend_data (Integer, PFM::ItemDescriptor::Wrapper, Array, Symbol) (defaults to: nil)

    extend_data informations

Author:

  • Nuri Yuri



404
405
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 404

def call_party_menu(id_var = ::Yuki::Var::Party_Menu_Sel, party = $actors, mode = :map, extend_data = nil)
end

#can_move_reminder_be_called?(mode = 0) ⇒ Boolean Also known as: maitre_capacites_appelable?

Detect if the move reminder can remind a move to the selected pokemon

Parameters:

Returns:

  • (Boolean)

    if the scene can be called



252
253
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 252

def can_move_reminder_be_called?(mode = 0)
end

#carte_du_monde(arg = :view, wm_id = $env.get_worldmap) Also known as: world_map

Open the world map

Parameters:

  • arg (Symbol) (defaults to: :view)

    the mode of the world map, :view or :fly

  • wm_id (Integer) (defaults to: $env.get_worldmap)

    the world map id to display

Author:

  • Nuri Yuri



373
374
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 373

def carte_du_monde(arg = :view, wm_id = $env.get_worldmap)
end

#casino(arg = :voltorb_flip, speed = 2)

Open the casino gameplay

Parameters:

  • arg (Symbol) (defaults to: :voltorb_flip)

    the mode of the casino :voltorb_flip, :slotmachine, …

  • speed (Integer) (defaults to: 2)

    speed of the slot machine

Author:

  • Nuri Yuri



477
478
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 477

def casino(arg = :voltorb_flip, speed = 2)
end

#choice(variable_id, cancel_type, *choices)

Start a choice with more option than RMXP allows.

Parameters:

  • variable_id (Integer)

    the id of the Variable where the choice will be store.

  • cancel_type (Integer)

    the choice that cancel (-1 = no cancel)

  • choices (Array<String>)

    the list of possible choice.

Author:

  • Nuri Yuri



367
368
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 367

def choice(variable_id, cancel_type, *choices)
end

#clear_saved_fog

Clear the saved fog



83
84
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 83

def clear_saved_fog
end

#combine_with_saved_bag(id_storage = nil)

Combined the saved bag with the current bag

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil $storage.other_bag is picked

Author:

  • Beef’



769
770
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 769

def combine_with_saved_bag(id_storage = nil)
end

#combine_with_saved_money(id_storage = nil)

Combined the saved money with the current money

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil $storage.other_money is picked

Author:

  • Beef’



809
810
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 809

def combine_with_saved_money(id_storage = nil)
end

#combine_with_saved_pokedex(id_storage = nil, empty_pokedex: false)

Combined the saved pokedex with the current pokedex

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil $storage.other_pokedex is picked

Author:

  • Beef’



794
795
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 794

def combine_with_saved_pokedex(id_storage = nil, empty_pokedex: false)
end

#cry_pokemon(id, volume: 100, tempo: 100)

Play the cry of a Pokemon

Parameters:

  • id (Integer, Symbol)

    the id of the Pokemon in the database

  • volume (Integer) (defaults to: 100)

    the volume of the cry

  • tempo (Integer) (defaults to: 100)

    the tempo/pitch of the cry



141
142
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 141

def cry_pokemon(id, volume: 100, tempo: 100)
end

#current_timeInteger

Return the current time in minute

Returns:

  • (Integer)


258
259
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 258

def current_time
end

#delete_event_forever(event_id) Also known as: delete_event

Delete the provided event forever

Parameters:

  • event_id (Integer)


54
55
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 54

def delete_event_forever(event_id)
end

#delete_this_event_forever

Delete the current event forever



50
51
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 50

def delete_this_event_forever
end

#detect_invalid_tile(x, y, width, height, tile_id) ⇒ Boolean

Detect if a specified tile (in layer 3) is in the specified zone

Examples:

To detect if there is non-cracked ice floor tile in a zone going from

X = 15 (included) to 24 and Y = 10 (included) to 15, you have to write : 
detect_invalid_tile(15, 10, 10, 6, 394)
To calculate tile_id the formula is this one : 384 + tileset_x + tileset_y * 8
For example : the tile is the third of the second line we then have tileset_x = 2, tileset_y = 1 which gives 394.

Parameters:

  • x (Integer)

    the coordinate x of the zone

  • y (Integer)

    the coordinate y of the zone

  • width (Integer)

    the width of the zone

  • height (Integer)

    the height of the zone

  • tile_id (Integer)

    the tile’s id in the tileset

Returns:

  • (Boolean)

    “true” if the tile is detected in the zone, else “false”



76
77
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 76

def detect_invalid_tile(x, y, width, height, tile_id)
end

#detect_player(nb_pas, direction) ⇒ Boolean

Detect the player in a specific direction

Parameters:

  • nb_pas (Integer)

    the number of step between the event and the player

  • direction (Symbol, Integer)

    the direction : :right, 6, :down, 2, :left, 4, :up or 8

Returns:

  • (Boolean)

Author:

  • Nuri Yuri



34
35
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 34

def detect_player(nb_pas, direction)
end

#detect_player_circle(r) ⇒ Boolean

Detect the player in a circle around the event

Parameters:

  • r (Numeric)

    the square radius (r = R²) of the circle around the event

Returns:

  • (Boolean)

Author:

  • Nuri Yuri



47
48
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 47

def detect_player_circle(r)
end

#detect_player_rect(nx, ny) ⇒ Boolean

Detect the player in a rectangle around the event

Parameters:

  • nx (Integer)

    the x distance of detection between the event and the player

  • ny (Integer)

    the y distance of detection between the event and the player

Returns:

  • (Boolean)

Author:

  • Nuri Yuri



41
42
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 41

def detect_player_rect(nx, ny)
end

#dynamic_lightNuriYuri::DynamicLight Also known as: dyn_light

Return the NuriYuri::DynamicLight module



306
307
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 306

def dynamic_light
end

#emotion(type, char_id = 0, wait = 34, params = {})

Note:

The available emotion type are :

  • :exclamation

  • :exclamation2

  • :poison

  • :interrogation

  • :music

  • :love

  • :joy

  • :sad

  • :happy

  • :angry

  • :sulk

  • :nocomment

Show an emotion to an event or the player

Examples:

Displaying the poison emotion :

emotion(:poison)

Displaying the poison emotion on the player (with offset) :

emotion(:poison, -1, 34, oy_offset: 10)

Parameters:

  • type (Symbol)

    the type of emotion (see wiki)

  • char_id (Integer) (defaults to: 0)

    the ID of the event (> 0), the current event (0) or the player (-1)

  • wait (Integer) (defaults to: 34)

    the number of frame the event will wait after this command.

  • params (Hash) (defaults to: {})

    particle



335
336
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 335

def emotion(type, char_id = 0, wait = 34, params = {})
end

#emotion_on_multiple_npc(type, chars_id = [0], wait = 34, params = {}) Also known as: emotion_on_multiple_pnj

Note:

See the #emotion method comments for the available emotion type

Show an emotion on multiple events and/or the player

Examples:

Displaying the poison emotion on the player and multiple NPCs (with offset) :

emotion_on_multiple_npc(:poison, [-1, 5, 8, 15], 34, oy_offset: 10)

Parameters:

  • type (Symbol)

    the type of emotion (see wiki)

  • chars_id (Array<Integer>) (defaults to: [0])

    the ID of the event (> 0), the current event (0) or the player (-1)

  • wait (Integer) (defaults to: 34)

    the number of frame the event will wait after this command.

  • params (Hash) (defaults to: {})

    particle



345
346
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 345

def emotion_on_multiple_npc(type, chars_id = [0], wait = 34, params = {})
end

#empty_and_save_appearance(id_storage = nil)

Save the appearance somewhere and set the default in the point of view of the player.

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_appearance

Author:

  • Beef’



814
815
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 814

def empty_and_save_appearance(id_storage = nil)
end

#empty_and_save_bag(id_storage = nil)

Save the bag somewhere and make it empty in the point of view of the player.

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_bag

Author:

  • Beef’



759
760
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 759

def empty_and_save_bag(id_storage = nil)
end

#empty_and_save_money(id_storage = nil)

Save the money somewhere and make it null in the point of view of the player.

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_money

Author:

  • Beef’



799
800
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 799

def empty_and_save_money(id_storage = nil)
end

#empty_and_save_party(id_storage = nil)

Save the team somewhere and make it empty in the point of view of the player.

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_party

Author:

  • Nuri Yuri



824
825
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 824

def empty_and_save_party(id_storage = nil)
end

#empty_and_save_pokedex(id_storage = nil)

Save the pokedex somewhere and make it empty in the point of view of the player.

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_pokedex

Author:

  • Beef’



784
785
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 784

def empty_and_save_pokedex(id_storage = nil)
end

#empty_and_save_trainer(id_storage = nil)

Save the trainer somewhere and make it empty in the point of view of the player.

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_trainer

Author:

  • Beef’



774
775
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 774

def empty_and_save_trainer(id_storage = nil)
end

#event_calling(common_event, event_id) ⇒ Boolean

Check if an event is calling a common event (in its first non comment commands)

Parameters:

  • common_event (Integer)

    the id of the common event

  • event_id (Integer)

    the id of the event on the MAP

Returns:

  • (Boolean)


360
361
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 360

def event_calling(common_event, event_id)
end

#fast_travel(x, y = nil, ms = 5)

Shortcut defining the pathfinding request and wait for the end of the path following

Parameters:

  • x (Integer)

    x coords to reach

  • y (Integer) (defaults to: nil)

    y coords to reach

  • ms (Integer) (defaults to: 5)

    <default : 5> movement speed



449
450
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 449

def fast_travel(x, y = nil, ms = 5)
end

#find_path(to:, radius: 0, tries: Pathfinding::TRY_COUNT, type: nil)

Use path finding to locate the current event move else

Examples:

find path to x=10 y=15 with an error radius of 5 tiles

find_path(to:[10,15], radius:5)

Parameters:

  • to (Array<Integer, Integer>, Game_Character)

    the target, [x, y] or Game_Character object

  • radius (Integer) (defaults to: 0)

    <default : 0> the distance from the target to consider it as reached

  • tries (Integer, Symbol) (defaults to: Pathfinding::TRY_COUNT)

    <default : 5> the number of tries allowed to this request, use :infinity to unlimited try count

  • type (Symbol) (defaults to: nil)


440
441
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 440

def find_path(to:, radius: 0, tries: Pathfinding::TRY_COUNT, type: nil)
end

#force_save Also known as: forcer_sauvegarde

Save the game without asking



377
378
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 377

def force_save
end

#front_event_calling(common_event) ⇒ Boolean

Check if the front event calls a common event (in its first non comment commands)

Parameters:

  • common_event (Integer)

    the id of the common event in the database

Returns:

  • (Boolean)

Author:

  • Nuri Yuri



354
355
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 354

def front_event_calling(common_event)
end

#ge(id = @event_id) ⇒ Game_Event

Return the $game_map.events

Returns:



298
299
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 298

def ge(id = @event_id)
end

#get_local_variable(id_var) ⇒ Object #get_local_variable(id_var, operation, value = nil) ⇒ Object #get_local_variable(id_event, id_var) ⇒ Object #get_local_variable(id_event, id_var, operation, value = nil) ⇒ Object #get_local_variable(id_map, id_event, id_var) ⇒ Object #get_local_variable(id_map, id_event, id_var, operation, value = nil) ⇒ Object Also known as: VL, LV

Overloads:

  • #get_local_variable(id_var) ⇒ Object

    Get a local variable

    Parameters:

    • id_var (Symbol)

      the id of the variable

  • #get_local_variable(id_var, operation, value = nil) ⇒ Object

    Perform an operation on a local variable and get the result

    Parameters:

    • id_var (Symbol)

      the id of the variable

    • operation (Symbol)

      symbol of the operation to do on the variable

    • value (Object) (defaults to: nil)

      value associated to the operation

  • #get_local_variable(id_event, id_var) ⇒ Object

    Get a local variable of a specific event

    Parameters:

    • id_event (Integer)

      the id of the event

    • id_var (Symbol)

      the id of the variable

  • #get_local_variable(id_event, id_var, operation, value = nil) ⇒ Object

    Perform an operation on a local variable of an specific event and get the result

    Parameters:

    • id_event (Integer)

      the id of the event

    • id_var (Symbol)

      the id of the variable

    • operation (Symbol)

      symbol of the operation to do on the variable

    • value (Object) (defaults to: nil)

      value associated to the operation

  • #get_local_variable(id_map, id_event, id_var) ⇒ Object

    Get a local variable of a specific event on a specific map

    Parameters:

    • id_map (Integer)

      the id of the map

    • id_event (Integer)

      the id of the event

    • id_var (Symbol)

      the id of the variable

  • #get_local_variable(id_map, id_event, id_var, operation, value = nil) ⇒ Object

    Perform an operation on a local variable of an specific event on a specific map and get the result

    Parameters:

    • id_map (Integer)

      the id of the map

    • id_event (Integer)

      the id of the event

    • id_var (Symbol)

      the id of the variable

    • operation (Symbol)

      symbol of the operation to do on the variable

    • value (Object) (defaults to: nil)

      value associated to the operation

Returns:



1022
1023
# File 'docs/00600_Script_RMXP.rb', line 1022

def get_local_variable(*args)
end

#get_self_switch(self_switch, event_id = @event_id, map_id = @map_id) ⇒ Boolean Also known as: get_ss

Get the value of a self_switch

Parameters:

  • self_switch (String)

    the name of the self switch (“A”, “B”, “C”, “D”)

  • event_id (Integer) (defaults to: @event_id)

    the id of the event that see the self switch

  • map_id (Integer) (defaults to: @map_id)

    the id of the map where the event see the self switch

Returns:

  • (Boolean)

    the value of the self switch

Author:

  • Leikt



395
396
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 395

def get_self_switch(self_switch, event_id = @event_id, map_id = @map_id)
end

#give_exp(index, amount)

Give a certain amount of exp to one Pokemon

Parameters:

  • index (Integer)

    the Pokemon index

  • amount (Integer)

    the amount of exp to give



505
506
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 505

def give_exp(index, amount)
end

#give_exp_all(amount)

Give a certain amount of exp to every Pokemon in party

Parameters:

  • amount (Integer)

    the amount of exp to give



509
510
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 509

def give_exp_all(amount)
end

#give_item(item_id, count = 1)

Give an item to the player

Parameters:

  • item_id (Integer, Symbol)

    id of the item in the database

  • count (Integer) (defaults to: 1)

    number of item



546
547
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 546

def give_item(item_id, count = 1)
end

#give_level(index, amount)

Give a certain amount of level to one Pokemon

Parameters:

  • index (Integer)

    the Pokemon index

  • amount (Integer)

    the amount of level to give



514
515
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 514

def give_level(index, amount)
end

#give_level_all(amount)

Give a certain amount of level to every Pokemon in party

Parameters:

  • amount (Integer)

    the amount of level to give



518
519
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 518

def give_level_all(amount)
end

#gmGame_Map

Return the $game_map

Returns:



290
291
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 290

def gm
end

#gpGame_Player

Return the $game_player

Returns:



294
295
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 294

def gp
end

#gsGame_Switches

Return the $game_switches

Returns:



282
283
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 282

def gs
end

#gtGame_Temp

Return the $game_temp

Returns:



286
287
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 286

def gt
end

#gvGame_Variables

Return the $game_variables

Returns:



278
279
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 278

def gv
end

#hall_of_fame(filename_bgm = 'audio/bgm/Hall-of-Fame', context_of_victory = :league)

Open the Hall of Fame UI

Parameters:

  • filename_bgm (String) (defaults to: 'audio/bgm/Hall-of-Fame')

    the bgm to play during the Hall of Fame

  • context_of_victory (Symbol) (defaults to: :league)

    the symbol to put as the context of victory



482
483
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 482

def hall_of_fame(filename_bgm = 'audio/bgm/Hall-of-Fame', context_of_victory = :league)
end

#honey_tree_event(id)

Function calling the honey tree event

Parameters:

  • id (Integer)

    ID of the honey tree



96
97
# File 'docs/01450_Systems_99990_Global_Systems.rb', line 96

def honey_tree_event(id)
end

#internal_add_pokemon_check_level_shiny(pokemon_id, level, shiny, method_name) ⇒ PFM::Pokemon

Check the input parameters and send the Pokemon to method_name

Parameters:

  • pokemon_id (Integer)

    ID of the Pokemon in the database

  • level (Integer)

    level of the Pokemon to add

  • shiny (Integer, Boolean)

    the shiny chance

  • method_name (Symbol)

    Method to use in order to add the Pokemon somewhere

Returns:



234
235
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 234

def internal_add_pokemon_check_level_shiny(pokemon_id, level, shiny, method_name)
end

#internal_add_pokemon_check_symbol(pokemon_or_id, level, shiny, method_name) ⇒ PFM::Pokemon

Check the symbol of the Pokemon and send the Pokemon to method_name

Parameters:

  • pokemon_or_id (Symbol)

    Symbol ID of the Pokemon in the database

  • level (Integer)

    level of the Pokemon to add

  • shiny (Integer, Boolean)

    the shiny chance

  • method_name (Symbol)

    Method to use in order to add the Pokemon somewhere

Returns:



226
227
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 226

def internal_add_pokemon_check_symbol(pokemon_or_id, level, shiny, method_name)
end

#internal_add_pokemon_final(pokemon) ⇒ PFM::Pokemon

Try to add Pokemon to the party or store the Pokemon in the storage system

Parameters:

Returns:



218
219
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 218

def internal_add_pokemon_final(pokemon)
end

#internal_store_pokemon_final(pokemon) ⇒ PFM::Pokemon

Try to add Pokemon to the party or store the Pokemon in the storage system

Parameters:

Returns:



239
240
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 239

def internal_store_pokemon_final(pokemon)
end

#message(string, cancel_type = 0, *choices) ⇒ Integer

Note:

This function should only be called from text events!

Show a message with eventually a choice

Examples:

Simple message

message("It's a message!")

Message from CSV files

message(ext_text(csv_id, index))

Message with choice

choice_result = message("You are wonkru or you are the enemy of wonkru!\nChoose !", 1, 'Wonkru', '*Knifed*')

Parameters:

  • string (String)

    message to show

  • cancel_type (Integer) (defaults to: 0)

    option used to cancel (1 indexed position, 0 means no cancel)

  • choices (Array<String>)

    all the possible choice

Returns:

  • (Integer)

    the choosen choice (0 indexed this time)



576
577
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 576

def message(string, cancel_type = 0, *choices)
end

#mining_game(item_count, music_filename = GamePlay::MiningGame::DEFAULT_MUSIC) #mining_game(wanted_item_db_symbols, music_filename = GamePlay::MiningGame::DEFAULT_MUSIC)

Open the Mining Game UI

Overloads:

  • #mining_game(item_count, music_filename = GamePlay::MiningGame::DEFAULT_MUSIC)

    Parameters:

    • item_count (Integer)

      the number of items to search

    • music_filename (String) (defaults to: GamePlay::MiningGame::DEFAULT_MUSIC)

      the filename of the music to play

    • delete_after (Boolean)

      if the event should be deleted forever afterward

    • grid_handler (PFM::MiningGame::GridHandler, nil)

      a specific GridHandler for this instance of the Mining Game

  • #mining_game(wanted_item_db_symbols, music_filename = GamePlay::MiningGame::DEFAULT_MUSIC)

    Parameters:

    • wanted_item_db_symbols (Array<Symbol>)

      the array containing the specific items (comprised between 1 and 5 items)

    • music_filename (String) (defaults to: GamePlay::MiningGame::DEFAULT_MUSIC)

      the filename of the music to play

    • delete_after (Boolean)

      if the event should be deleted forever afterward

    • grid_handler (PFM::MiningGame::GridHandler, nil)

      a specific GridHandler for this instance of the Mining Game



495
496
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 495

def mining_game(param = nil, music_filename = GamePlay::MiningGame::DEFAULT_MUSIC, delete_after: true, grid_handler: nil)
end

#mirror_picture(id, bool = true)

Mirror a RMXP Picture

Parameters:

  • id (Integer)

    the picture id

  • bool (Boolean) (defaults to: true)

    the mirroring state



500
501
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 500

def mirror_picture(id, bool = true)
end

#move_reminder(pokemon = $actors[$game_variables[::Yuki::Var::Party_Menu_Sel]], mode = 0) ⇒ Boolean Also known as: maitre_capacites

Call the move reminder UI with the choosen Pokemon and a specific mode (0 by default)

Parameters:

Returns:

  • (Boolean)

    if the Pokemon learnt a move or not



246
247
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 246

def move_reminder(pokemon = $actors[$game_variables[::Yuki::Var::Party_Menu_Sel]], mode = 0)
end

#npc_trade_sequence(index, pokemon)

Sequence that perform NPC trade

Parameters:

  • index (Integer)

    index of the Pokemon in the party

  • pokemon (PFM::Pokemon)

    Pokemon that is traded with



666
667
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 666

def npc_trade_sequence(index, pokemon)
end

#open_shop(items, prices) #open_shop(items, prices) Also known as: ouvrir_magasin

Open a shop

Overloads:

  • #open_shop(items, prices)

    Parameters:

    • symbol_or_list (Symbol)
    • prices (Hash)

      (optional)

  • #open_shop(items, prices)

    Parameters:

    • symbol_or_list (Array<Integer, Symbol>)
    • prices (Hash)

      (optional)



689
690
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 689

def open_shop(symbol_or_list, prices = {}, show_background: true)
end

#partyPFM::GameState

Return the party object (game state)

Returns:



302
303
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 302

def party
end

#pfm_textPFM::Text

Return the PFM::Text module

Returns:



426
427
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 426

def pfm_text
end

#pick_item(item_id, count = 1, no_delete = false)

Pick an item on the ground (and delete the event)

Parameters:

  • item_id (Integer, Symbol)

    id of the item in the database

  • count (Integer) (defaults to: 1)

    number of item

  • no_delete (Boolean) (defaults to: false)

    if the event should not be delete forever



541
542
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 541

def pick_item(item_id, count = 1, no_delete = false)
end

#player_spotted?(nb_pas) ⇒ Boolean Also known as: trainer_spotted

Detect if the event can spot the player and move to the player

Examples:

To detect the player 7 tiles in front of the event, put in a condition :

player_spotted?(7)

Parameters:

  • nb_pas (Integer)

    number of step the event should do to spot the player

Returns:

  • (Boolean)

    if the event spot the player or not

Author:

  • Nuri Yuri



9
10
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 9

def player_spotted?(nb_pas)
end

#player_spotted_directional?(up: nil, down: nil, left: nil, right: nil) ⇒ Boolean

Detect if the event can spot the player and move to the player with direction relative detection

Examples:

The event turn left and bottom but does not have the same vision when turned bottom

player_spotted_directional?(left: 7, bottom: 3)

Parameters:

  • up (Integer) (defaults to: nil)

    number of step to the up direction

  • down (Integer) (defaults to: nil)

    number of step to the down direction

  • left (Integer) (defaults to: nil)

    number of step to the left direction

  • right (Integer) (defaults to: nil)

    number of step to the right direction

Returns:

  • (Boolean)

    if the event spotted the player



27
28
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 27

def player_spotted_directional?(up: nil, down: nil, left: nil, right: nil)
end

#player_spotted_rect?(nb_pas, dist) ⇒ Boolean Also known as: trainer_spotted_rect

Detect if the event can spot the player in a certain rect in frond of itself

Parameters:

  • nb_pas (Integer)

    number of step the event should do to spot the player

  • dist (Integer)

    distance in both side of the detection

Returns:

  • (Boolean)

    if the event spot the player or not



16
17
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 16

def player_spotted_rect?(nb_pas, dist)
end

#pokemon_hidden_power(index_or_pokemon)

Returns the db_symbol of the type of the Pokemon’s Hidden Power

Parameters:

  • index_or_pokemon (Integer, PFM::Pokemon)

    the Pokemon or the index of the Pokemon in the party (0~5)

Author:

  • Rey



212
213
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 212

def pokemon_hidden_power(index_or_pokemon)
end

#pokemon_index(method_name, *args)

Return the index of the choosen Pokemon or call a method of GameState to find the right Pokemon

Parameters:

  • method_name (Symbol)

    identifier of the method

  • args (Array)

    parameters to send to the method



431
432
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 431

def pokemon_index(method_name, *args)
end

#open_shop(items, prices) #open_shop(items, prices) Also known as: ouvrir_magasin_pokemon

Open a Pokemon shop

Overloads:

  • #open_shop(items, prices)

    Parameters:

    • symbol_or_list (Symbol)
    • prices (Hash)

      (optional)

    • show_background (Boolean)

      (optional)

  • #open_shop(items, prices)

    Parameters:

    • symbol_or_list (Array<Integer, Symbol>)
    • prices (Array<Integer>)
    • param (Array<Hash, Integer>)
    • show_background (Boolean)

      (optional)



724
725
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 724

def pokemon_shop_open(symbol_or_list, prices = [], param = [], show_background: true)
end

#pokemon_stored_sequence(pokemon)

Show the “Pokemon was sent to BOX $” message

Parameters:



620
621
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 620

def pokemon_stored_sequence(pokemon)
end

#puzzle_alpha(id = 1, id_switch = Yuki::Sw::RuinsVictory)

Start the Alpha Ruins puzzle

Parameters:

  • id (Integer) (defaults to: 1)

    ID of the puzzle (see graphics/interface/puzzle_ruines files)

  • id_switch (Integer) (defaults to: Yuki::Sw::RuinsVictory)

    ID of the switch to enable when winning



513
514
# File 'docs/01450_Systems_09000_Games.rb', line 513

def puzzle_alpha(id = 1, id_switch = Yuki::Sw::RuinsVictory)
end

#quest_book Also known as: livre_quetes, quest_ui

Show the quest book



408
409
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 408

def quest_book
end

#receive_pokemon_sequence(pokemon_or_id, level = 5, shiny = false) ⇒ PFM::Pokemon?

Receive Pokemon sequence, when the player is given a Pokemon

Parameters:

  • pokemon_or_id (Integer, Symbol, PFM::Pokemon)

    the ID of the pokemon in the database or a Pokemon

  • level (Integer) (defaults to: 5)

    the level of the Pokemon (if ID given)

  • shiny (Boolean, Integer) (defaults to: false)

    true means the Pokemon will be shiny, 0 means it’ll have no chance to be shiny, other number are the chance (1 / n) the pokemon can be shiny.

Returns:

  • (PFM::Pokemon, nil)

    if nil, the Pokemon couldn’t be stored in the PC or added to the party. Otherwise it’s the Pokemon that was added.



616
617
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 616

def receive_pokemon_sequence(pokemon_or_id, level = 5, shiny = false)
end

#remove_items_from_limited_shop(symbol_of_shop, items_to_remove, quantities_to_remove) Also known as: enlever_objets_magasin

Remove items from a limited shop

Parameters:

  • symbol_of_shop (Symbol)

    the symbol of the existing shop

  • items_to_remove (Array<Symbol, Integer>)

    the array of the items’ db_symbol/id

  • quantities_to_remove (Array<Integer>)

    the array of the quantity to remove



711
712
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 711

def remove_items_from_limited_shop(symbol_of_shop, items_to_remove, quantities_to_remove)
end

#remove_pokemon_from_shop(symbol_of_shop, remove_list_mon, param_form, quantities_to_remove = []) Also known as: enlever_pokemon_du_magasin

Remove Pokemon from a Pokemon Shop

Parameters:

  • symbol_of_shop (Symbol)

    the symbol of the existing shop

  • remove_list_mon (Array<Integer>)

    the array of the Pokemon id

  • param_form (Array<Hash>)

    the form of the Pokemon to delete (only if there is more than one form of a Pokemon in the list)

  • quantities_to_remove (Array<Integer>) (defaults to: [])

    the array of the quantity to remove



752
753
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 752

def remove_pokemon_from_shop(symbol_of_shop, remove_list_mon, param_form, quantities_to_remove = [])
end

#rename_pokemon(index_or_pokemon, num_char = 12) Also known as: renommer_pokemon

Show the rename interface of a Pokemon

Parameters:

  • index_or_pokemon (Integer, PFM::Pokemon)

    the Pokemon or the index of the Pokemon in the party (0~5)

  • num_char (Integer) (defaults to: 12)

    the number of character the Pokemon can have in its name.

Author:

  • Nuri Yuri



147
148
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 147

def rename_pokemon(index_or_pokemon, num_char = 12)
end

#retrieve_saved_appearance(id_storage = nil)

Retrieve the saved appearance

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_appearance

Author:

  • Beef’



819
820
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 819

def retrieve_saved_appearance(id_storage = nil)
end

#retrieve_saved_bag(id_storage = nil)

Retrieve the saved bag when emptied ( /!\ empty the current bag)

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_bag

Author:

  • Beef’



764
765
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 764

def retrieve_saved_bag(id_storage = nil)
end

#retrieve_saved_money(id_storage = nil)

Retrieve the saved money

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_money

Author:

  • Beef’



804
805
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 804

def retrieve_saved_money(id_storage = nil)
end

#retrieve_saved_party(id_storage = nil) Also known as: retreive_saved_party

Retrieve the saved team when emptied ( /!\ empty the current team)

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_party

Author:

  • Nuri Yuri



829
830
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 829

def retrieve_saved_party(id_storage = nil)
end

#retrieve_saved_pokedex(id_storage = nil)

Retrieve the saved pokedex when emptied

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_pokedex

Author:

  • Beef’



789
790
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 789

def retrieve_saved_pokedex(id_storage = nil)
end

#retrieve_saved_trainer(id_storage = nil)

Retrieve the saved trainer

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_trainer

Author:

  • Beef’



779
780
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 779

def retrieve_saved_trainer(id_storage = nil)
end

#retrieve_stolen_pokemon(id_storage = nil) Also known as: retreive_stolen_pokemon

Retrieve previously stolen Pokemon ( /!\ uses #add_pokemon)

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_party

Author:

  • Nuri Yuri



195
196
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 195

def retrieve_stolen_pokemon(id_storage = nil)
end

#save_this_fogArray

Save the current fog

Returns:

  • (Array)

    the fog info



80
81
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 80

def save_this_fog
end

#set_local_variable(value, id_var, id_event = @event_id, id_map = @map_id) Also known as: set_VL, set_LV

Set a local variable

Parameters:

  • value (Object)

    the new value of the variable

  • id_var (Symbol)

    the id of the variable

  • id_event (Integer) (defaults to: @event_id)

    the id of the event

  • id_map (Integer) (defaults to: @map_id)

    the id of the map



1031
1032
# File 'docs/00600_Script_RMXP.rb', line 1031

def set_local_variable(value, id_var, id_event = @event_id, id_map = @map_id)
end

#set_self_switch(value, self_switch, event_id = @event_id, map_id = @map_id) Also known as: set_ss

Set the value of a self_switch

Parameters:

  • value (Boolean)

    the new value of the switch

  • self_switch (String)

    the name of the self switch (“A”, “B”, “C”, “D”)

  • event_id (Integer) (defaults to: @event_id)

    the id of the event that see the self switch

  • map_id (Integer) (defaults to: @map_id)

    the id of the map where the event see the self switch

Author:

  • Leikt



386
387
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 386

def set_self_switch(value, self_switch, event_id = @event_id, map_id = @map_id)
end

#show_pokemon(pokemon) #show_pokemon(pokemon_id)

Show the Pokemon dex info

Overloads:

  • #show_pokemon(pokemon)

    Parameters:

  • #show_pokemon(pokemon_id)

    Parameters:

    • pokemon_id (Integer, Symbol)

      ID of the Pokemon in the dex



207
208
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 207

def show_pokemon(pokemon_id)
end

#skill_learn(pokemon, id_skill) ⇒ Boolean Also known as: enseigner_capacite

Learn a skill to a Pokemon

Parameters:

  • pokemon (PFM::Pokemon, Integer)

    the Pokemon that will learn the skill (use $actors for a Pokemon in the party). An integer will automatically search into the party

  • id_skill (Integer, Symbol)

    the id of the skill in the database

Returns:

  • (Boolean)

    if the move was learnt or not

Author:

  • Nuri Yuri



134
135
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 134

def skill_learn(pokemon, id_skill)
end

#start_double_trainer_battle(trainer_id, second_trainer_id, bgm: DEFAULT_TRAINER_BGM, disable: 'A', enable: 'B', troop_id: 3, &block)

Start a trainer battle

Parameters:

  • trainer_id (Integer)

    ID of the trainer in Studio

  • second_trainer_id (Integer)

    ID of the second trainer in Studio

  • bgm (String, Array) (defaults to: DEFAULT_TRAINER_BGM)

    BGM to play for battle

  • disable (String) (defaults to: 'A')

    Name of the local switch to disable (if defeat)

  • enable (String) (defaults to: 'B')

    Name of the local switch to enable (if victory)

  • troop_id (Integer) (defaults to: 3)

    ID of the troop to use : 3 = trainer, 4 = Gym Leader, 5 = Elite, 6 = Champion



641
642
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 641

def start_double_trainer_battle(trainer_id, second_trainer_id, bgm: DEFAULT_TRAINER_BGM, disable: 'A', enable: 'B', troop_id: 3, &block)
end

#start_double_trainer_battle_with_friend(trainer_id, second_trainer_id, friend_trainer_id, bgm: DEFAULT_TRAINER_BGM, disable: 'A', enable: 'B', troop_id: 3, &block)

Start a trainer battle

Parameters:

  • trainer_id (Integer)

    ID of the trainer in Studio

  • second_trainer_id (Integer)

    ID of the second trainer in Studio

  • friend_trainer_id (Integer)

    ID of the friend trainer in Studio

  • bgm (String, Array) (defaults to: DEFAULT_TRAINER_BGM)

    BGM to play for battle

  • disable (String) (defaults to: 'A')

    Name of the local switch to disable (if defeat)

  • enable (String) (defaults to: 'B')

    Name of the local switch to enable (if victory)

  • troop_id (Integer) (defaults to: 3)

    ID of the troop to use : 3 = trainer, 4 = Gym Leader, 5 = Elite, 6 = Champion



651
652
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 651

def start_double_trainer_battle_with_friend(trainer_id, second_trainer_id, friend_trainer_id, bgm: DEFAULT_TRAINER_BGM, disable: 'A', enable: 'B', troop_id: 3, &block)
end

#start_pc Also known as: demarrer_pc

Start the storage PC



310
311
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 310

def start_pc
end

#start_trade(server)

Start an online Trade

Parameters:

  • server (Boolean)

    if the player is the server



200
201
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 200

def start_trade(server)
end

#start_trainer_battle(trainer_id, bgm: DEFAULT_TRAINER_BGM, disable: 'A', enable: 'B', troop_id: 3)

Start a trainer battle

Examples:

Start a simple trainer battle

start_trainer_battle(5) # 5 is the trainer 5 in Studio

Start a trainer battle agains a gym leader

start_trainer_battle(5, bgm: '28 Pokemon Gym', troop_id: 4)

Parameters:

  • trainer_id (Integer)

    ID of the trainer in Studio

  • bgm (String, Array) (defaults to: DEFAULT_TRAINER_BGM)

    BGM to play for battle

  • disable (String) (defaults to: 'A')

    Name of the local switch to disable (if defeat)

  • enable (String) (defaults to: 'B')

    Name of the local switch to enable (if victory)

  • troop_id (Integer) (defaults to: 3)

    ID of the troop to use : 3 = trainer, 4 = Gym Leader, 5 = Elite, 6 = Champion



632
633
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 632

def start_trainer_battle(trainer_id, bgm: DEFAULT_TRAINER_BGM, disable: 'A', enable: 'B', troop_id: 3)
end

#steal_pokemon(indexes, id_storage = nil, no_save = false)

Save some Pokemon of the team somewhere and remove them from the party

Parameters:

  • id_storage (String) (defaults to: nil)

    the specific name of the storage, if nil sent to $storage.other_party

  • indexes (Array, Range)

    list of index in the team

  • no_save (Boolean) (defaults to: false)

    if the Pokémon are not saved.

Author:

  • Nuri Yuri



190
191
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 190

def steal_pokemon(indexes, id_storage = nil, no_save = false)
end

#stop_path

Shortcut for get_character(@event_id).stop_path



443
444
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 443

def stop_path
end

#store_pokemon(pokemon_or_id, level = 5, shiny = false) ⇒ PFM::Pokemon? Also known as: stocker_pokemon

Store a Pokemon in the PC

Parameters:

  • pokemon_or_id (Integer, Symbol, PFM::Pokemon)

    the ID of the pokemon in the database or a Pokemon

  • level (Integer) (defaults to: 5)

    the level of the Pokemon (if ID given)

  • shiny (Boolean, Integer) (defaults to: false)

    true means the Pokemon will be shiny, 0 means it’ll have no chance to be shiny, other number are the chance (1 / n) the pokemon can be shiny.

Returns:

  • (PFM::Pokemon, nil)

    if nil, the Pokemon couldn’t be stored in the PC. Otherwise it’s the Pokemon that was added.

Author:

  • Nuri Yuri



107
108
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 107

def store_pokemon(pokemon_or_id, level = 5, shiny = false)
end

#switch_player(from_player_id, to_player_id, switch_bag: true, switch_party: true, switch_trainer: true, switch_appearance: true, switch_money: true, switch_pokedex: true)

Switch from one player to another, in term of party, trainer, money, pokedex and appearance (all optional)

Parameters:

  • from_player_id (String)

    the specific name of the storage to save to.

  • to_player_id (String)

    the specific name of the storage to load from.

Author:

  • Beef’



836
837
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 836

def switch_player(from_player_id, to_player_id, switch_bag: true, switch_party: true, switch_trainer: true, switch_appearance: true, switch_money: true, switch_pokedex: true)
end

#switch_player_safe(to_player_id, switch_bag: true, switch_party: true, switch_trainer: true, switch_appearance: true, switch_money: true, switch_pokedex: true)

Switch from one player to another, in term of party, trainer, money, pokedex and appearance (all optional) The Yuki::Var::Current_Player_ID must be defined beforehand

Parameters:

  • to_player_id (String)

    the specific name of the storage to load from.

Author:

  • Beef’



842
843
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 842

def switch_player_safe(to_player_id, switch_bag: true, switch_party: true, switch_trainer: true, switch_appearance: true, switch_money: true, switch_pokedex: true)
end

#take_screenshot(filename = 'map_screenshot%d.png', scale = 1)

Take a screenshot of the map and save it as a png

Parameters:

  • filename (String) (defaults to: 'map_screenshot%d.png')
  • scale (Integer) (defaults to: 1)

    the scale of the final screenshot (between 1 and 3, this helps to multiply 320*240 by a factor)



523
524
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 523

def take_screenshot(filename = 'map_screenshot%d.png', scale = 1)
end

#timed_event_remaining_time(event_id = @event_id, map_id = @map_id) ⇒ Integer

Get the remaining time until the trigger (in minutes)

Parameters:

  • event_id (Integer) (defaults to: @event_id)

    event id that should be activated

  • map_id (Integer) (defaults to: @map_id)

    map where the event should be located

Returns:

  • (Integer)


273
274
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 273

def timed_event_remaining_time(event_id = @event_id, map_id = @map_id)
end

#trainer_eye_sequence(phrase, eye_bgm: DEFAULT_EYE_BGM, exclamation_se: DEFAULT_EXCLAMATION_SE)

Sequence to call before start trainer battle

Examples:

Simple eye sequence

trainer_eye_sequence('Hello!')

Eye sequence with another eye_bgm

trainer_eye_sequence('Hello!', eye_bgm: 'audio/bgm/pkmrs-enc7')

Parameters:

  • phrase (String)

    the full speech of the trainer

  • eye_bgm (String, Array, Integer) (defaults to: DEFAULT_EYE_BGM)

    String => filepath, Array => filepath + volume + pitch, Integer => music from trainer resources

  • exclamation_se (String, Array) (defaults to: DEFAULT_EXCLAMATION_SE)

    SE to play when the trainer detect the player



661
662
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 661

def trainer_eye_sequence(phrase, eye_bgm: DEFAULT_EYE_BGM, exclamation_se: DEFAULT_EXCLAMATION_SE)
end

#trigger_event_in(amount_of_minutes, local_switch_letter, event_id = @event_id, map_id = @map_id)

Store a timed event (will enable the desired local switch when the timer reached the amount of minutes)

Examples:

Setting an event in 24h for the current event (local switch D)

trigger_event_in(24 * 60, 'D')

Parameters:

  • amount_of_minutes (Integer)

    number of minute from now to enable the switch

  • local_switch_letter (String)

    letter of the local switch to enable in order to trigger the event

  • event_id (Integer) (defaults to: @event_id)

    event id that should be activated

  • map_id (Integer) (defaults to: @map_id)

    map where the event should be located



267
268
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 267

def trigger_event_in(amount_of_minutes, local_switch_letter, event_id = @event_id, map_id = @map_id)
end

#wait_character_move_completion(event_id = @event_id) Also known as: attendre_fin_deplacement_cet_event, wait_event, attendre_event

Wait for the end of the movement of this particular character

Parameters:

  • event_id (Integer) (defaults to: @event_id)

    <default : calling event’s> the id of the event to watch



59
60
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 59

def wait_character_move_completion(event_id = @event_id)
end

#wait_charset_animation(event_id = @event_id)

Wait for the end of the charset animation of this particular event

Parameters:

  • event_id (Integer) (defaults to: @event_id)

    <default : calling event’s> the id of the event to watch



461
462
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 461

def wait_charset_animation(event_id = @event_id)
end

#wait_for_player Also known as: attendre_joueur

Shortcut for wait_character_move_completion(0) Wait for the end of the player movement



470
471
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 470

def wait_for_player
end

#waiting_animate_charset_event?Boolean

Note:

This function automatically update the states it use if it returns false

Test if the Interpreter is currently waiting for an event

Returns:

  • (Boolean)


466
467
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 466

def waiting_animate_charset_event?
end

#withdraw_pokemon(id, counter = 1) Also known as: retirer_pokemon

withdraw a Pokemon from the Party

Parameters:

  • id (Integer, Symbol)

    the id of the Pokemon you want to withdraw

  • counter (Integer) (defaults to: 1)

    the number of Pokemon with this id to withdraw

Author:

  • Nuri Yuri



121
122
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 121

def withdraw_pokemon(id, counter = 1)
end

#withdraw_pokemon_at(index) Also known as: retirer_pokemon_index

withdraw a Pokemon from the party at a specific position in the Party

Parameters:

  • index (Integer)

    the position (0~5) in the party.



126
127
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 126

def withdraw_pokemon_at(index)
end

#yes_no_choice(message, yes = nil, no = nil) ⇒ Boolean

Show a yes no choice

Examples:

Simple yes/no choice (in a condition)

yes_no_choice('Do you want to continue?')

Boy/Girl choice (in a condition, validation will mean boy)

yes_no_choice('Are you a boy?[WAIT 60] \nOr are you a girl?', 'Boy', 'Girl')

Parameters:

  • message (String)

    message shown by the event

  • yes (String) (defaults to: nil)

    string used as yes

  • no (String) (defaults to: nil)

    string used as no

Returns:

  • (Boolean)

    if the yes option was choosen



587
588
# File 'docs/00700_PSDK_Event_Interpreter.rb', line 587

def yes_no_choice(message, yes = nil, no = nil)
end