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
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
ACTION_STATES =
['_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



166
167
# File 'docs/2_PSDK_Event_Interpreter.rb', line 166

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



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

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



695
696
# File 'docs/2_PSDK_Event_Interpreter.rb', line 695

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



688
689
# File 'docs/2_PSDK_Event_Interpreter.rb', line 688

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



725
726
# File 'docs/2_PSDK_Event_Interpreter.rb', line 725

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)



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

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



735
736
# File 'docs/2_PSDK_Event_Interpreter.rb', line 735

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



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

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


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

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



184
185
# File 'docs/2_PSDK_Event_Interpreter.rb', line 184

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



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

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



254
255
# File 'docs/2_PSDK_Event_Interpreter.rb', line 254

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



355
356
# File 'docs/2_PSDK_Event_Interpreter.rb', line 355

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



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

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



349
350
# File 'docs/2_PSDK_Event_Interpreter.rb', line 349

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’



761
762
# File 'docs/2_PSDK_Event_Interpreter.rb', line 761

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’



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

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’



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

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



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

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

#current_timeInteger

Return the current time in minute

Returns:

  • (Integer)


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

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_lightNuriYuri::DynamicLight Also known as: dyn_light

Return the NuriYuri::DynamicLight module



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

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



317
318
# File 'docs/2_PSDK_Event_Interpreter.rb', line 317

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



327
328
# File 'docs/2_PSDK_Event_Interpreter.rb', line 327

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’



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

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’



751
752
# File 'docs/2_PSDK_Event_Interpreter.rb', line 751

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’



791
792
# File 'docs/2_PSDK_Event_Interpreter.rb', line 791

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



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

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’



776
777
# File 'docs/2_PSDK_Event_Interpreter.rb', line 776

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’



766
767
# File 'docs/2_PSDK_Event_Interpreter.rb', line 766

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)


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

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



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

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)


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

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



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

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



336
337
# File 'docs/2_PSDK_Event_Interpreter.rb', line 336

def front_event_calling(common_event)
end

#ge(id = @event_id) ⇒ Game_Event

Return the $game_map.events

Returns:



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

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



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

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



487
488
# File 'docs/2_PSDK_Event_Interpreter.rb', line 487

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



491
492
# File 'docs/2_PSDK_Event_Interpreter.rb', line 491

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



533
534
# File 'docs/2_PSDK_Event_Interpreter.rb', line 533

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



496
497
# File 'docs/2_PSDK_Event_Interpreter.rb', line 496

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



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

def give_level_all(amount)
end

#gmGame_Map

Return the $game_map

Returns:



272
273
# File 'docs/2_PSDK_Event_Interpreter.rb', line 272

def gm
end

#gpGame_Player

Return the $game_player

Returns:



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

def gp
end

#gsGame_Switches

Return the $game_switches

Returns:

  • (Game_Switches)


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

def gs
end

#gtGame_Temp

Return the $game_temp

Returns:

  • (Game_Temp)


268
269
# File 'docs/2_PSDK_Event_Interpreter.rb', line 268

def gt
end

#gvGame_Variables

Return the $game_variables

Returns:

  • (Game_Variables)


260
261
# File 'docs/2_PSDK_Event_Interpreter.rb', line 260

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



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

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



657
658
# File 'docs/2_PSDK_Event_Interpreter.rb', line 657

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:



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

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:



228
229
# File 'docs/2_PSDK_Event_Interpreter.rb', line 228

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:



220
221
# File 'docs/2_PSDK_Event_Interpreter.rb', line 220

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:



241
242
# File 'docs/2_PSDK_Event_Interpreter.rb', line 241

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)



563
564
# File 'docs/2_PSDK_Event_Interpreter.rb', line 563

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



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

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



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

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



248
249
# File 'docs/2_PSDK_Event_Interpreter.rb', line 248

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



832
833
# File 'docs/2_PSDK_Event_Interpreter.rb', line 832

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



653
654
# File 'docs/2_PSDK_Event_Interpreter.rb', line 653

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)



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

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

#partyPFM::GameState

Return the party object (game state)

Returns:



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

def party
end

#pfm_textPFM::Text

Return the PFM::Text module

Returns:



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

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



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

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



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

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



413
414
# File 'docs/2_PSDK_Event_Interpreter.rb', line 413

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)



715
716
# File 'docs/2_PSDK_Event_Interpreter.rb', line 715

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:



607
608
# File 'docs/2_PSDK_Event_Interpreter.rb', line 607

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/4_Systems_900_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



390
391
# File 'docs/2_PSDK_Event_Interpreter.rb', line 390

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.



603
604
# File 'docs/2_PSDK_Event_Interpreter.rb', line 603

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



702
703
# File 'docs/2_PSDK_Event_Interpreter.rb', line 702

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



743
744
# File 'docs/2_PSDK_Event_Interpreter.rb', line 743

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



148
149
# File 'docs/2_PSDK_Event_Interpreter.rb', line 148

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’



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

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’



756
757
# File 'docs/2_PSDK_Event_Interpreter.rb', line 756

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’



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

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



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

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’



781
782
# File 'docs/2_PSDK_Event_Interpreter.rb', line 781

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’



771
772
# File 'docs/2_PSDK_Event_Interpreter.rb', line 771

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



197
198
# File 'docs/2_PSDK_Event_Interpreter.rb', line 197

def retrieve_stolen_pokemon(id_storage = nil)
end

#save_this_fogArray

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



510
511
# File 'docs/2_PSDK_Event_Interpreter.rb', line 510

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



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

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



368
369
# File 'docs/2_PSDK_Event_Interpreter.rb', line 368

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



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

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



628
629
# File 'docs/2_PSDK_Event_Interpreter.rb', line 628

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



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

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



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

def start_pc
end

#start_trade(server)

Start an online Trade

Parameters:

  • server (Boolean)

    if the player is the server



202
203
# File 'docs/2_PSDK_Event_Interpreter.rb', line 202

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



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

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 Creature are not saved.

Author:

  • Nuri Yuri



192
193
# File 'docs/2_PSDK_Event_Interpreter.rb', line 192

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

#stop_path

Shortcut for get_character(@event_id).stop_path



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

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



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

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’



848
849
# File 'docs/2_PSDK_Event_Interpreter.rb', line 848

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)



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

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)


874
875
# File 'docs/2_PSDK_Event_Interpreter.rb', line 874

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



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

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



868
869
# File 'docs/2_PSDK_Event_Interpreter.rb', line 868

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



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

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



452
453
# File 'docs/2_PSDK_Event_Interpreter.rb', line 452

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)


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

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



574
575
# File 'docs/2_PSDK_Event_Interpreter.rb', line 574

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