Class: Interpreter

Inherits:
Interpreter_RMXP
  • Object
show all
Includes:
Util::SystemMessage
Defined in:
docs/2_PSDK_Event_Interpreter.rb,
docs/4_Systems_900_Games.rb,
docs/4_Systems_998_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
SYSTEM_MESSAGE_HEADER =

Header of the system messages

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

Duration of the exclamation particle

54
DEFAULT_CONTEST_BGM =

Default BGM used for contests

['oras_pokemon_contest', 100, 100]
ACTION_STATES =

List of action state suffixes

['_cycle_roll', '_cycle_roll_to_wheel', '_cycle_stop', '_cycle_wheel', '_deep_swamp_sinking', '_fish', '_ladder', '_misc2', '_pokecenter', '_run', '_shake', '_snow', '_snow_deep', '_snow_deep_misc', '_snow_misc', '_surf', '_surf_fish', '_surf_hm', '_surf_vs', '_swamp', '_swamp_deep', '_swamp_run', '_walk']

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

Instance Method Summary collapse

Methods included from Util::SystemMessage

load_message, parse_opts, show_message, show_message_and_wait

Instance Method Details

#add_egg(id, egg_how_obtained = :received) ⇒ 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

  • egg_how_obtained (Symbol) (defaults to: :received) —

    :reveived => When you received the egg (ex: Daycare), :found => When you found the egg (ex: On the map)

Returns:

Author:

  • Nuri Yuri



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

def add_egg(id, egg_how_obtained = :received)
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



539
540
# File 'docs/2_PSDK_Event_Interpreter.rb', line 539

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



738
739
# File 'docs/2_PSDK_Event_Interpreter.rb', line 738

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



731
732
# File 'docs/2_PSDK_Event_Interpreter.rb', line 731

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



768
769
# File 'docs/2_PSDK_Event_Interpreter.rb', line 768

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)



420
421
# File 'docs/2_PSDK_Event_Interpreter.rb', line 420

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



113
114
# File 'docs/2_PSDK_Event_Interpreter.rb', line 113

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



778
779
# File 'docs/2_PSDK_Event_Interpreter.rb', line 778

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



174
175
# File 'docs/2_PSDK_Event_Interpreter.rb', line 174

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



130
131
# File 'docs/2_PSDK_Event_Interpreter.rb', line 130

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)


456
457
# File 'docs/2_PSDK_Event_Interpreter.rb', line 456

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

#apply_message_font(font_id)

Apply a custom font to the message window

Parameters:

  • font_id (Integer) —

    font ID defined in Studio (texts_config.json)



947
948
# File 'docs/2_PSDK_Event_Interpreter.rb', line 947

def apply_message_font(font_id)
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



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

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



402
403
# File 'docs/2_PSDK_Event_Interpreter.rb', line 402

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



270
271
# File 'docs/2_PSDK_Event_Interpreter.rb', line 270

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



371
372
# File 'docs/2_PSDK_Event_Interpreter.rb', line 371

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



476
477
# File 'docs/2_PSDK_Event_Interpreter.rb', line 476

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



365
366
# File 'docs/2_PSDK_Event_Interpreter.rb', line 365

def choice(variable_id, cancel_type, *choices)
end

#clear_saved_fog

Clear the saved fog



83
84
# File 'docs/2_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'



805
806
# File 'docs/2_PSDK_Event_Interpreter.rb', line 805

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'



845
846
# File 'docs/2_PSDK_Event_Interpreter.rb', line 845

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'



830
831
# File 'docs/2_PSDK_Event_Interpreter.rb', line 830

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

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

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

  • form (Integer) (defaults to: 0) —

    the id of the form of the Pokemon



158
159
# File 'docs/2_PSDK_Event_Interpreter.rb', line 158

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

#current_overlay_preset ⇒ PFM::MapOverlay::PresetBase? Also known as: map_overlay

Get the current overlay preset

Returns:



934
935
# File 'docs/2_PSDK_Event_Interpreter.rb', line 934

def current_overlay_preset
end

#current_time ⇒ Integer

Return the current time in minute

Returns:

  • (Integer)


903
904
# File 'docs/2_PSDK_Event_Interpreter.rb', line 903

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/2_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/2_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/2_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/2_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/2_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/2_PSDK_Event_Interpreter.rb', line 41

def detect_player_rect(nx, ny)
end

#dynamic_light ⇒ NuriYuri::DynamicLight Also known as: dyn_light

Return the NuriYuri::DynamicLight module



304
305
# File 'docs/2_PSDK_Event_Interpreter.rb', line 304

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



333
334
# File 'docs/2_PSDK_Event_Interpreter.rb', line 333

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



343
344
# File 'docs/2_PSDK_Event_Interpreter.rb', line 343

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'



850
851
# File 'docs/2_PSDK_Event_Interpreter.rb', line 850

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'



795
796
# File 'docs/2_PSDK_Event_Interpreter.rb', line 795

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'



835
836
# File 'docs/2_PSDK_Event_Interpreter.rb', line 835

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



860
861
# File 'docs/2_PSDK_Event_Interpreter.rb', line 860

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'



820
821
# File 'docs/2_PSDK_Event_Interpreter.rb', line 820

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'



810
811
# File 'docs/2_PSDK_Event_Interpreter.rb', line 810

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)


358
359
# File 'docs/2_PSDK_Event_Interpreter.rb', line 358

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



448
449
# File 'docs/2_PSDK_Event_Interpreter.rb', line 448

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

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

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)
  • running (Boolean) (defaults to: false) —

    <default: false> if true, the character will run during the pathfinding



439
440
# File 'docs/2_PSDK_Event_Interpreter.rb', line 439

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

#force_save Also known as: forcer_sauvegarde

Save the game without asking



375
376
# File 'docs/2_PSDK_Event_Interpreter.rb', line 375

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



352
353
# File 'docs/2_PSDK_Event_Interpreter.rb', line 352

def front_event_calling(common_event)
end

#ge(id = @event_id) ⇒ Game_Event

Return the $game_map.events

Returns:



296
297
# File 'docs/2_PSDK_Event_Interpreter.rb', line 296

def ge(id = @event_id)
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



393
394
# File 'docs/2_PSDK_Event_Interpreter.rb', line 393

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



504
505
# File 'docs/2_PSDK_Event_Interpreter.rb', line 504

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



508
509
# File 'docs/2_PSDK_Event_Interpreter.rb', line 508

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



550
551
# File 'docs/2_PSDK_Event_Interpreter.rb', line 550

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



513
514
# File 'docs/2_PSDK_Event_Interpreter.rb', line 513

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



517
518
# File 'docs/2_PSDK_Event_Interpreter.rb', line 517

def give_level_all(amount)
end

#gm ⇒ Game_Map

Return the $game_map

Returns:



288
289
# File 'docs/2_PSDK_Event_Interpreter.rb', line 288

def gm
end

#gp ⇒ Game_Player

Return the $game_player

Returns:



292
293
# File 'docs/2_PSDK_Event_Interpreter.rb', line 292

def gp
end

#gs ⇒ Game_Switches

Return the $game_switches

Returns:

  • (Game_Switches)


280
281
# File 'docs/2_PSDK_Event_Interpreter.rb', line 280

def gs
end

#gt ⇒ Game_Temp

Return the $game_temp

Returns:

  • (Game_Temp)


284
285
# File 'docs/2_PSDK_Event_Interpreter.rb', line 284

def gt
end

#gv ⇒ Game_Variables

Return the $game_variables

Returns:

  • (Game_Variables)


276
277
# File 'docs/2_PSDK_Event_Interpreter.rb', line 276

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



481
482
# File 'docs/2_PSDK_Event_Interpreter.rb', line 481

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

#hm_bar_animation_on_map(reason)

Triggers the HM Bar Animation

Parameters:

  • reason (Symbol) —

    the db_symbol of the HM used



690
691
# File 'docs/2_PSDK_Event_Interpreter.rb', line 690

def hm_bar_animation_on_map(reason)
end

#honey_tree_event(id)

Function calling the honey tree event

Parameters:

  • id (Integer) —

    ID of the honey tree



96
97
# File 'docs/4_Systems_998_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:



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

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:



244
245
# File 'docs/2_PSDK_Event_Interpreter.rb', line 244

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:



236
237
# File 'docs/2_PSDK_Event_Interpreter.rb', line 236

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:



257
258
# File 'docs/2_PSDK_Event_Interpreter.rb', line 257

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)



580
581
# File 'docs/2_PSDK_Event_Interpreter.rb', line 580

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



494
495
# File 'docs/2_PSDK_Event_Interpreter.rb', line 494

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



499
500
# File 'docs/2_PSDK_Event_Interpreter.rb', line 499

def mirror_picture(id, bool = true)
end

#move_camera_to_event(event_id, duration, block_interpreter = true, distortion: :UNICITY_DISTORTION)

Smoothly move the map camera to a specific event over a given duration (in seconds)

Parameters:

  • event_id (Integer) —

    ID of the target event

  • duration (Float) —

    duration of the movement in seconds

  • block_interpreter (Boolean) (defaults to: true) —

    whether to block the interpreter during the animation

  • distortion (Symbol) (defaults to: :UNICITY_DISTORTION) —

    distortion type



96
97
# File 'docs/2_PSDK_Event_Interpreter.rb', line 96

def move_camera_to_event(event_id, duration, block_interpreter = true, distortion: :UNICITY_DISTORTION)
end

#move_camera_to_tiles(x, y, duration, block_interpreter = true, distortion: :UNICITY_DISTORTION)

Smoothly move the map camera to specific tile coordinates over a given duration (in seconds)

Parameters:

  • x (Integer) —

    x-coordinate of the target tile

  • y (Integer) —

    y-coordinate of the target tile

  • duration (Float) —

    duration of the movement in seconds

  • block_interpreter (Boolean) (defaults to: true) —

    whether to block the interpreter during the animation

  • distortion (Symbol) (defaults to: :UNICITY_DISTORTION) —

    distortion type



104
105
# File 'docs/2_PSDK_Event_Interpreter.rb', line 104

def move_camera_to_tiles(x, y, duration, block_interpreter = true, distortion: :UNICITY_DISTORTION)
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



264
265
# File 'docs/2_PSDK_Event_Interpreter.rb', line 264

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

#name_player(default_name, character_filename, max_char = 12, message: [43, 0], set_appearance: true, &block)

Note:

Example: name_player("Yuri", "player_m_walk") or name_player("Yuri", "player_m_walk", set_appearance: false)

Shows a character, a default name, and asks the player for their name

Parameters:

  • default_name (String) —

    the default name pre-filled in the name input screen

  • character_filename (String) —

    the character displayed in the window. Is looking in graphics/characters already.

  • message (Array) (defaults to: [43, 0]) —

    the file ID and index of the line you want to display.

  • max_char (Integer) (defaults to: 12) —

    the maximum number of characters allowed.

  • set_appearance (Boolean) (defaults to: true) —

    if you want to set the player's gender & appearance to the filename.

Author:

  • Invatorzen



876
877
# File 'docs/2_PSDK_Event_Interpreter.rb', line 876

def name_player(default_name, character_filename, max_char = 12, message: [43, 0], set_appearance: true, &block)
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



686
687
# File 'docs/2_PSDK_Event_Interpreter.rb', line 686

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)



723
724
# File 'docs/2_PSDK_Event_Interpreter.rb', line 723

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

#party ⇒ PFM::GameState

Return the party object (game state)

Returns:



300
301
# File 'docs/2_PSDK_Event_Interpreter.rb', line 300

def party
end

#pfm_text ⇒ PFM::Text

Return the PFM::Text module

Returns:



424
425
# File 'docs/2_PSDK_Event_Interpreter.rb', line 424

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



545
546
# File 'docs/2_PSDK_Event_Interpreter.rb', line 545

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/2_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/2_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/2_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



230
231
# File 'docs/2_PSDK_Event_Interpreter.rb', line 230

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



429
430
# File 'docs/2_PSDK_Event_Interpreter.rb', line 429

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)



758
759
# File 'docs/2_PSDK_Event_Interpreter.rb', line 758

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:



618
619
# File 'docs/2_PSDK_Event_Interpreter.rb', line 618

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



515
516
# File 'docs/4_Systems_900_Games.rb', line 515

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

#quest_book Also known as: livre_quetes, quest_ui

Show the quest book



406
407
# File 'docs/2_PSDK_Event_Interpreter.rb', line 406

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.



614
615
# File 'docs/2_PSDK_Event_Interpreter.rb', line 614

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



745
746
# File 'docs/2_PSDK_Event_Interpreter.rb', line 745

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



786
787
# File 'docs/2_PSDK_Event_Interpreter.rb', line 786

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



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

def rename_pokemon(index_or_pokemon, num_char = 12)
end

#reset_message_font

Reset the message window font to the default



950
951
# File 'docs/2_PSDK_Event_Interpreter.rb', line 950

def reset_message_font
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'



855
856
# File 'docs/2_PSDK_Event_Interpreter.rb', line 855

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'



800
801
# File 'docs/2_PSDK_Event_Interpreter.rb', line 800

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'



840
841
# File 'docs/2_PSDK_Event_Interpreter.rb', line 840

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



865
866
# File 'docs/2_PSDK_Event_Interpreter.rb', line 865

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'



825
826
# File 'docs/2_PSDK_Event_Interpreter.rb', line 825

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'



815
816
# File 'docs/2_PSDK_Event_Interpreter.rb', line 815

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



213
214
# File 'docs/2_PSDK_Event_Interpreter.rb', line 213

def retrieve_stolen_pokemon(id_storage = nil)
end

#save_this_fog ⇒ Array

Save the current fog

Returns:

  • (Array) —

    the fog info



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

def save_this_fog
end

#set_actor_back(actor_id, filename)

Sets a specific actors battle sprite to a specific one

Parameters:

  • actor_id (Integer) —

    the ID of the actor

  • filename (String) —

    the filename of the image in graphics/battlers



527
528
# File 'docs/2_PSDK_Event_Interpreter.rb', line 527

def set_actor_back(actor_id, filename)
end

#set_player_back(filename)

Sets the players battle sprite to a specific one

Parameters:

  • filename (String) —

    the filename of the image in graphics/battlers



880
881
# File 'docs/2_PSDK_Event_Interpreter.rb', line 880

def set_player_back(filename)
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



384
385
# File 'docs/2_PSDK_Event_Interpreter.rb', line 384

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



225
226
# File 'docs/2_PSDK_Event_Interpreter.rb', line 225

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



150
151
# File 'docs/2_PSDK_Event_Interpreter.rb', line 150

def skill_learn(pokemon, id_skill)
end

#start_contest(creature_position, coordinator1_id, coordinator2_id, coordinator3_id, condition: :cool, rank: :normal, bgm: DEFAULT_CONTEST_BGM)

Start a contest

Parameters:

  • creature_position (Integer) —

    position of the creature in the party (0-5) that will be the player's contestant

  • coordinator1_id (Integer) —

    ID of the first coordinator in Studio

  • coordinator2_id (Integer) —

    ID of the second coordinator in Studio

  • coordinator3_id (Integer) —

    ID of the third coordinator in Studio

  • rank (Symbol) (defaults to: :normal) —

    rank of the contest (:normal, :super, :hyper, :master)

  • condition (Symbol) (defaults to: :cool) —

    condition of the contest (:cool, :beautiful, :cute, :clever, :tough)

  • bgm (String, Array) (defaults to: DEFAULT_CONTEST_BGM) —

    BGM to play for contest



700
701
# File 'docs/2_PSDK_Event_Interpreter.rb', line 700

def start_contest(creature_position, coordinator1_id, coordinator2_id, coordinator3_id, condition: :cool, rank: :normal, bgm: DEFAULT_CONTEST_BGM)
end

#start_double_trainer_battle(trainer_id, second_trainer_id, bgm: Configs.sounds.base_trainer_battle_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 (RPG::AudioFile, String, Array) (defaults to: Configs.sounds.base_trainer_battle_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



639
640
# File 'docs/2_PSDK_Event_Interpreter.rb', line 639

def start_double_trainer_battle(trainer_id, second_trainer_id, bgm: Configs.sounds.base_trainer_battle_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: Configs.sounds.base_trainer_battle_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 (RPG::AudioFile, String, Array) (defaults to: Configs.sounds.base_trainer_battle_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



649
650
# File 'docs/2_PSDK_Event_Interpreter.rb', line 649

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

#start_overlay(preset)

Start an overlay preset

Examples:

S.MI.start_overlay(:fog) (in console)

start_overlay(:fog) (in an event)

Parameters:

  • preset (Symbol) —

    Symbol of an overlay preset



925
926
# File 'docs/2_PSDK_Event_Interpreter.rb', line 925

def start_overlay(preset)
end

#start_pc Also known as: demarrer_pc

Start the storage PC



308
309
# File 'docs/2_PSDK_Event_Interpreter.rb', line 308

def start_pc
end

#start_trade(server)

Start an online Trade

Parameters:

  • server (Boolean) —

    if the player is the server



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

def start_trade(server)
end

#start_trainer_battle(trainer_id, bgm: Configs.sounds.base_trainer_battle_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 (RPG::AudioFile, String, Array) (defaults to: Configs.sounds.base_trainer_battle_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



630
631
# File 'docs/2_PSDK_Event_Interpreter.rb', line 630

def start_trainer_battle(trainer_id, bgm: Configs.sounds.base_trainer_battle_bgm, disable: 'A', enable: 'B', troop_id: 3)
end

#start_triple_trainer_battle(trainer_id, second_trainer_id, third_trainer_id, bgm: Configs.sounds.base_trainer_battle_bgm, disable: 'A', enable: 'B', troop_id: 3, &block)

Start a triple trainer battle

Parameters:

  • trainer_id (Integer) —

    ID of the trainer in Ruby Host

  • second_trainer_id (Integer) —

    ID of the second trainer in Ruby Host

  • third_trainer_id (Integer) —

    ID of the third trainer in Ruby Host

  • bgm (RPG::AudioFile, String, Array) (defaults to: Configs.sounds.base_trainer_battle_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



659
660
# File 'docs/2_PSDK_Event_Interpreter.rb', line 659

def start_triple_trainer_battle(trainer_id, second_trainer_id, third_trainer_id, bgm: Configs.sounds.base_trainer_battle_bgm, disable: 'A', enable: 'B', troop_id: 3, &block)
end

#start_triple_trainer_battle_with_friend(trainer_id, second_trainer_id, third_trainer_id, friend_trainer_id, second_friend_trainer_id, bgm: Configs.sounds.base_trainer_battle_bgm, disable: 'A', enable: 'B', troop_id: 3, &block)

Start a triple trainer battle

Parameters:

  • trainer_id (Integer) —

    ID of the trainer in Ruby Host

  • second_trainer_id (Integer) —

    ID of the second trainer in Ruby Host

  • third_trainer_id (Integer) —

    ID of the third trainer in Ruby Host

  • friend_trainer_id (Integer) —

    ID of the friend trainer in Ruby Host

  • second_friend_trainer_id (Integer) —

    ID of the second friend trainer in Ruby Host

  • bgm (RPG::AudioFile, String, Array) (defaults to: Configs.sounds.base_trainer_battle_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



671
672
# File 'docs/2_PSDK_Event_Interpreter.rb', line 671

def start_triple_trainer_battle_with_friend(trainer_id, second_trainer_id, third_trainer_id, friend_trainer_id, second_friend_trainer_id, bgm: Configs.sounds.base_trainer_battle_bgm, disable: 'A', enable: 'B', troop_id: 3, &block)
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 Creature are not saved.

Author:

  • Nuri Yuri



208
209
# File 'docs/2_PSDK_Event_Interpreter.rb', line 208

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

#stop_overlay

Clear overlay

Examples:

S.MI.stop_overlay (in console)

stop_overlay (in event)



930
931
# File 'docs/2_PSDK_Event_Interpreter.rb', line 930

def stop_overlay
end

#stop_path

Shortcut for get_character(@event_id).stop_path



442
443
# File 'docs/2_PSDK_Event_Interpreter.rb', line 442

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



123
124
# File 'docs/2_PSDK_Event_Interpreter.rb', line 123

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'



886
887
# File 'docs/2_PSDK_Event_Interpreter.rb', line 886

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'



892
893
# File 'docs/2_PSDK_Event_Interpreter.rb', line 892

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)



522
523
# File 'docs/2_PSDK_Event_Interpreter.rb', line 522

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)


918
919
# File 'docs/2_PSDK_Event_Interpreter.rb', line 918

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

#trainer_eye_sequence(phrase, eye_bgm: Configs.sounds.default_eye_bgm, exclamation_se: Configs.sounds.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: Configs.sounds.default_eye_bgm) —

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

  • exclamation_se (String, Array) (defaults to: Configs.sounds.default_exclamation_se) —

    SE to play when the trainer detect the player



681
682
# File 'docs/2_PSDK_Event_Interpreter.rb', line 681

def trainer_eye_sequence(phrase, eye_bgm: Configs.sounds.default_eye_bgm, exclamation_se: Configs.sounds.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



912
913
# File 'docs/2_PSDK_Event_Interpreter.rb', line 912

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

#update_overlay_position(new_position)

Note:

(if not directly instanciating the UVResolver, use :game_player for player's coordinates, array of two numbers for custom coordinates)

Update the UV Resolver if there is a current preset with a position

Examples:

S.MI.update_overlay_position([0, 8]) (in console)

update_overlay_position(:game_player) (in event)

Parameters:

  • new_position (UVResolver, Array<Integer>, Symbol) —

    New position for the overlay preset



942
943
# File 'docs/2_PSDK_Event_Interpreter.rb', line 942

def update_overlay_position(new_position)
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/2_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



460
461
# File 'docs/2_PSDK_Event_Interpreter.rb', line 460

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



469
470
# File 'docs/2_PSDK_Event_Interpreter.rb', line 469

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)


465
466
# File 'docs/2_PSDK_Event_Interpreter.rb', line 465

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



137
138
# File 'docs/2_PSDK_Event_Interpreter.rb', line 137

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.



142
143
# File 'docs/2_PSDK_Event_Interpreter.rb', line 142

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



591
592
# File 'docs/2_PSDK_Event_Interpreter.rb', line 591

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