Home > RGSS Script Reference > Interpreter
Interpreter
Inherits from:
None
Description:
This class holds methods that execute the event commands you enter into the editor. Every running event represents an instance of this class.
class Interpreter
# ------------------------------------
def initialize(depth = 0, main = false)
@depth = depth
@main = main
if depth > 100
print("Event call stack overflow.")
exit
end
clear
end
# ------------------------------------
def clear
@map_id = 0
@event_id = 0
@message_waiting = false
@move_route_waiting = false
@button_input_variable_id = 0
@wait_count = 0
@child_interpreter = nil
@branch = {}
end
# ------------------------------------
def setup(list, event_id)
clear
@map_id = $game_map.map_id
@event_id = event_id
@list = list
@index = 0
@branch.clear
end
# ------------------------------------
def running?
return @list != nil
end
# ------------------------------------
def setup_starting_event
if $game_map.need_refresh
$game_map.refresh
end
if $game_temp.common_event_id > 0
setup($data_common_events[$game_temp.common_event_id].list, 0)
$game_temp.common_event_id = 0
return
end
for event in $game_map.events.values
if event.starting
if event.trigger < 3
event.clear_starting
event.lock
end
setup(event.list, event.id)
return
end
end
for common_event in $data_common_events.compact
if common_event.trigger == 1 and
$game_switches[common_event.switch_id] == true
setup(common_event.list, 0)
return
end
end
end
# ------------------------------------
def update
@loop_count = 0
loop do
@loop_count += 1
if @loop_count > 100
Graphics.update
@loop_count = 0
end
if $game_map.map_id != @map_id
@event_id = 0
end
if @child_interpreter != nil
@child_interpreter.update
unless @child_interpreter.running?
@child_interpreter = nil
end
if @child_interpreter != nil
return
end
end
if @message_waiting
return
end
if @move_route_waiting
if $game_player.move_route_forcing
return
end
for event in $game_map.events.values
if event.move_route_forcing
return
end
end
@move_route_waiting = false
end
if @button_input_variable_id > 0
input_button
return
end
if @wait_count > 0
@wait_count -= 1
return
end
if $game_temp.forcing_battler != nil
return
end
if $game_temp.battle_calling or
$game_temp.shop_calling or
$game_temp.name_calling or
$game_temp.menu_calling or
$game_temp.save_calling or
$game_temp.gameover
return
end
if @list == nil
if @main
setup_starting_event
end
if @list == nil
return
end
end
if execute_command == false
return
end
@index += 1
end
end
# ------------------------------------
def input_button
n = 0
for i in 1..18
if Input.trigger?(i)
n = i
end
end
if n > 0
$game_variables[@button_input_variable_id] = n
$game_map.need_refresh = true
@button_input_variable_id = 0
end
end
# ------------------------------------
def setup_choices(parameters)
$game_temp.choice_max = parameters[0].size
for text in parameters[0]
$game_temp.message_text += text + "\n"
end
$game_temp.choice_cancel_type = parameters[1]
current_indent = @list[@index].indent
$game_temp.choice_proc = Proc.new { |n| @branch[current_indent] = n }
end
# ------------------------------------
def iterate_actor(parameter)
if parameter == 0
for actor in $game_party.actors
yield actor
end
else
actor = $game_actors[parameter]
yield actor if actor != nil
end
end
# ------------------------------------
def iterate_enemy(parameter)
if parameter == -1
for enemy in $game_troop.enemies
yield enemy
end
else
enemy = $game_troop.enemies[parameter]
yield enemy if enemy != nil
end
end
# ------------------------------------
def iterate_battler(parameter1, parameter2)
if parameter1 == 0
iterate_enemy(parameter2) do |enemy|
yield enemy
end
else
if parameter2 == -1
for actor in $game_party.actors
yield actor
end
else
actor = $game_party.actors[parameter2]
yield actor if actor != nil
end
end
end
end
# ------------------------------------
def execute_command
if @index >= @list.size - 1
command_end
return true
end
@parameters = @list[@index].parameters
case @list[@index].code
when 101
return command_101
when 102
return command_102
when 402
return command_402
when 403
return command_403
when 103
return command_103
when 104
return command_104
when 105
return command_105
when 106
return command_106
when 111
return command_111
when 411
return command_411
when 112
return command_112
when 413
return command_413
when 113
return command_113
when 115
return command_115
when 116
return command_116
when 117
return command_117
when 118
return command_118
when 119
return command_119
when 121
return command_121
when 122
return command_122
when 123
return command_123
when 124
return command_124
when 125
return command_125
when 126
return command_126
when 127
return command_127
when 128
return command_128
when 129
return command_129
when 131
return command_131
when 132
return command_132
when 133
return command_133
when 134
return command_134
when 135
return command_135
when 136
return command_136
when 201
return command_201
when 202
return command_202
when 203
return command_203
when 204
return command_204
when 205
return command_205
when 206
return command_206
when 207
return command_207
when 208
return command_208
when 209
return command_209
when 210
return command_210
when 221
return command_221
when 222
return command_222
when 223
return command_223
when 224
return command_224
when 225
return command_225
when 231
return command_231
when 232
return command_232
when 233
return command_233
when 234
return command_234
when 235
return command_235
when 236
return command_236
when 241
return command_241
when 242
return command_242
when 245
return command_245
when 246
return command_246
when 247
return command_247
when 248
return command_248
when 249
return command_249
when 250
return command_250
when 251
return command_251
when 301
return command_301
when 601
return command_601
when 602
return command_602
when 603
return command_603
when 302
return command_302
when 303
return command_303
when 311
return command_311
when 312
return command_312
when 313
return command_313
when 314
return command_314
when 315
return command_315
when 316
return command_316
when 317
return command_317
when 318
return command_318
when 319
return command_319
when 320
return command_320
when 321
return command_321
when 322
return command_322
when 331
return command_331
when 332
return command_332
when 333
return command_333
when 334
return command_334
when 335
return command_335
when 336
return command_336
when 337
return command_337
when 338
return command_338
when 339
return command_339
when 340
return command_340
when 351
return command_351
when 352
return command_352
when 353
return command_353
when 354
return command_354
when 355
return command_355
else
return true
end
end
# ------------------------------------
def command_end
@list = nil
if @main and @event_id > 0
$game_map.events[@event_id].unlock
end
end
# ------------------------------------
def command_skip
indent = @list[@index].indent
loop do
if @list[@index+1].indent == indent
return true
end
@index += 1
end
end
# ------------------------------------
def get_character(parameter)
case parameter
when -1
return $game_player
when 0
return $game_map.events[@event_id]
else
return $game_map.events[parameter]
end
end
# ------------------------------------
def operate_value(operation, operand_type, operand)
if operand_type == 0
value = operand
else
value = $game_variables[operand]
end
if operation == 1
value = -value
end
return value
end
end
# ------------------------------------
def command_101
if $game_temp.message_text != nil
return false
end
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
$game_temp.message_text = @list[@index].parameters[0] + "\n"
line_count = 1
loop do
if @list[@index+1].code == 401
$game_temp.message_text += @list[@index+1].parameters[0] + "\n"
line_count += 1
else
if @list[@index+1].code == 102
if @list[@index+1].parameters[0].size <= 4 - line_count
@index += 1
$game_temp.choice_start = line_count
setup_choices(@list[@index].parameters)
end
elsif @list[@index+1].code == 103
if line_count < 4
@index += 1
$game_temp.num_input_start = line_count
$game_temp.num_input_variable_id = @list[@index].parameters[0]
$game_temp.num_input_digits_max = @list[@index].parameters[1]
end
end
return true
end
@index += 1
end
end
# ------------------------------------
def command_102
if $game_temp.message_text != nil
return false
end
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
$game_temp.message_text = ""
$game_temp.choice_start = 0
setup_choices(@parameters)
return true
end
# ------------------------------------
def command_402
if @branch[@list[@index].indent] == @parameters[0]
@branch.delete(@list[@index].indent)
return true
end
return command_skip
end
# ------------------------------------
def command_403
if @branch[@list[@index].indent] == 4
@branch.delete(@list[@index].indent)
return true
end
return command_skip
end
# ------------------------------------
def command_103
if $game_temp.message_text != nil
return false
end
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
$game_temp.message_text = ""
$game_temp.num_input_start = 0
$game_temp.num_input_variable_id = @parameters[0]
$game_temp.num_input_digits_max = @parameters[1]
return true
end
# ------------------------------------
def command_104
if $game_temp.message_window_showing
return false
end
$game_system.message_position = @parameters[0]
$game_system.message_frame = @parameters[1]
return true
end
# ------------------------------------
def command_105
@button_input_variable_id = @parameters[0]
@index += 1
return false
end
# ------------------------------------
def command_106
@wait_count = @parameters[0] * 2
return true
end
# ------------------------------------
def command_111
result = false
case @parameters[0]
when 0
result = ($game_switches[@parameters[1]] == (@parameters[2] == 0))
when 1
value1 = $game_variables[@parameters[1]]
if @parameters[2] == 0
value2 = @parameters[3]
else
value2 = $game_variables[@parameters[3]]
end
case @parameters[4]
when 0
result = (value1 == value2)
when 1
result = (value1 >= value2)
when 2
result = (value1 <= value2)
when 3
result = (value1 > value2)
when 4
result = (value1 < value2)
when 5
result = (value1 != value2)
end
when 2
if @event_id > 0
key = [$game_map.map_id, @event_id, @parameters[1]]
if @parameters[2] == 0
result = ($game_self_switches[key] == true)
else
result = ($game_self_switches[key] != true)
end
end
when 3
if $game_system.timer_working
sec = $game_system.timer / Graphics.frame_rate
if @parameters[2] == 0
result = (sec >= @parameters[1])
else
result = (sec <= @parameters[1])
end
end
when 4
actor = $game_actors[@parameters[1]]
if actor != nil
case @parameters[2]
when 0
result = ($game_party.actors.include?(actor))
when 1
result = (actor.name == @parameters[3])
when 2
result = (actor.skill_learn?(@parameters[3]))
when 3
result = (actor.weapon_id == @parameters[3])
when 4
result = (actor.armor1_id == @parameters[3] or
actor.armor2_id == @parameters[3] or
actor.armor3_id == @parameters[3])
when 5
result = (actor.state?(@parameters[3]))
end
end
when 5
enemy = $game_troop.enemies[@parameters[1]]
if enemy != nil
case @parameters[2]
when 0
result = (enemy.exist?)
when 1
result = (enemy.state?(@parameters[3]))
end
end
when 6
character = get_character(@parameters[1])
if character != nil
result = (character.direction == @parameters[2])
end
when 7
if @parameters[2] == 0
result = ($game_party.gold >= @parameters[1])
else
result = ($game_party.gold <= @parameters[1])
end
when 8
result = ($game_party.item_number(@parameters[1]) > 0)
when 9
result = ($game_party.weapon_number(@parameters[1]) > 0)
when 10
result = ($game_party.armor_number(@parameters[1]) > 0)
when 11
result = (Input.press?(@parameters[1]))
when 12
result = eval(@parameters[1])
end
@branch[@list[@index].indent] = result
if @branch[@list[@index].indent] == true
@branch.delete(@list[@index].indent)
return true
end
return command_skip
end
# ------------------------------------
def command_411
if @branch[@list[@index].indent] == false
@branch.delete(@list[@index].indent)
return true
end
return command_skip
end
# ------------------------------------
def command_112
return true
end
# ------------------------------------
def command_413
indent = @list[@index].indent
loop do
@index -= 1
if @list[@index].indent == indent
return true
end
end
end
# ------------------------------------
def command_113
indent = @list[@index].indent
temp_index = @index
loop do
temp_index += 1
if temp_index >= @list.size-1
return true
end
if @list[temp_index].code == 413 and @list[temp_index].indent < indent
@index = temp_index
return true
end
end
end
# ------------------------------------
def command_115
command_end
return true
end
# ------------------------------------
def command_116
if @event_id > 0
$game_map.events[@event_id].erase
end
@index += 1
return false
end
# ------------------------------------
def command_117
common_event = $data_common_events[@parameters[0]]
@child_interpreter = Interpreter.new(@depth + 1)
@child_interpreter.setup(common_event.list, @event_id)
return true
end
# ------------------------------------
def command_118
return true
end
# ------------------------------------
def command_119
label_name = @parameters[0]
temp_index = 0
loop do
if temp_index >= @list.size-1
return true
end
if @list[temp_index].code == 118 and
@list[temp_index].parameters[0] == label_name
@index = temp_index
return true
end
temp_index += 1
end
end
end
# ------------------------------------
def command_121
for i in @parameters[0] .. @parameters[1]
$game_switches[i] = (@parameters[2] == 0)
end
$game_map.need_refresh = true
return true
end
# ------------------------------------
def command_122
value = 0
case @parameters[3]
when 0
value = @parameters[4]
when 1
value = $game_variables[@parameters[4]]
when 2
value = @parameters[4] + rand(@parameters[5] - @parameters[4] + 1)
when 3
value = $game_party.item_number(@parameters[4])
when 4
actor = $game_actors[@parameters[4]]
case @parameters[5]
when 0
value = actor.level
when 1
value = actor.exp
when 2
value = actor.hp
when 3
value = actor.sp
when 4
value = actor.maxhp
when 5
value = actor.maxsp
when 6
value = actor.str
when 7
value = actor.dex
when 8
value = actor.agi
when 9
value = actor.int
when 10
value = actor.atk
when 11
value = actor.pdef
when 12
value = actor.mdef
when 13
value = actor.eva
end
when 5
enemy = $game_troop.enemies[@parameters[4]]
case @parameters[5]
when 0
value = enemy.hp
when 1
value = enemy.sp
when 2
value = enemy.maxhp
when 3
value = enemy.maxsp
when 4
value = enemy.str
when 5
value = enemy.dex
when 6
value = enemy.agi
when 7
value = enemy.int
when 8
value = enemy.atk
when 9
value = enemy.pdef
when 10
value = enemy.mdef
when 11
value = enemy.eva
end
when 6
character = get_character(@parameters[4])
case @parameters[5]
when 0
value = character.x
when 1
value = character.y
when 2
value = character.direction
when 3
value = character.screen_x
when 4
value = character.screen_y
when 5
value = character.terrain_tag
end
when 7
case @parameters[4]
when 0
value = $game_map.map_id
when 1
value = $game_party.actors.size
when 2
value = $game_party.gold
when 3
value = $game_party.steps
when 4
value = Graphics.frame_count / Graphics.frame_rate
when 5
value = $game_system.timer / Graphics.frame_rate
when 6
value = $game_system.save_count
end
end
for i in @parameters[0] .. @parameters[1]
case @parameters[2]
when 0
$game_variables[i] = value
when 1
$game_variables[i] += value
when 2
$game_variables[i] -= value
when 3
$game_variables[i] *= value
when 4
if value != 0
$game_variables[i] /= value
end
when 5
if value != 0
$game_variables[i] %= value
end
end
if $game_variables[i] > 99999999
$game_variables[i] = 99999999
end
if $game_variables[i] < -99999999
$game_variables[i] = -99999999
end
end
$game_map.need_refresh = true
return true
end
# ------------------------------------
def command_123
if @event_id > 0
key = [$game_map.map_id, @event_id, @parameters[0]]
$game_self_switches[key] = (@parameters[1] == 0)
end
$game_map.need_refresh = true
return true
end
# ------------------------------------
def command_124
if @parameters[0] == 0
$game_system.timer = @parameters[1] * Graphics.frame_rate
$game_system.timer_working = true
end
if @parameters[0] == 1
$game_system.timer_working = false
end
return true
end
# ------------------------------------
def command_125
value = operate_value(@parameters[0], @parameters[1], @parameters[2])
$game_party.gain_gold(value)
return true
end
# ------------------------------------
def command_126
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_item(@parameters[0], value)
return true
end
# ------------------------------------
def command_127
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_weapon(@parameters[0], value)
return true
end
# ------------------------------------
def command_128
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_armor(@parameters[0], value)
return true
end
# ------------------------------------
def command_129
if @parameters[1] == 0
if @parameters[2] == 1
$game_actors[@parameters[0]].setup(@parameters[0])
end
$game_party.add_actor(@parameters[0])
else
$game_party.remove_actor(@parameters[0])
end
return true
end
# ------------------------------------
def command_131
$game_system.windowskin_name = @parameters[0]
return true
end
# ------------------------------------
def command_132
$game_system.battle_bgm = @parameters[0]
return true
end
# ------------------------------------
def command_133
$game_system.battle_end_me = @parameters[0]
return true
end
# ------------------------------------
def command_134
$game_system.save_disabled = (@parameters[0] == 0)
return true
end
# ------------------------------------
def command_135
$game_system.menu_disabled = (@parameters[0] == 0)
return true
end
# ------------------------------------
def command_136
$game_system.encounter_disabled = (@parameters[0] == 0)
$game_player.make_encounter_count
return true
end
end
# ------------------------------------
def command_201
if $game_temp.player_transferring or
$game_temp.message_window_showing or
$game_temp.transition_processing
return false
end
$game_temp.player_transferring = true
if @parameters[0] == 0
$game_temp.player_new_map_id = @parameters[1]
$game_temp.player_new_x = @parameters[2]
$game_temp.player_new_y = @parameters[3]
$game_temp.player_new_direction = @parameters[4]
else
$game_temp.player_new_map_id = $game_variables[@parameters[1]]
$game_temp.player_new_x = $game_variables[@parameters[2]]
$game_temp.player_new_y = $game_variables[@parameters[3]]
$game_temp.player_new_direction = @parameters[4]
end
@index += 1
if @parameters[5] == 0
Graphics.freeze
$game_temp.transition_processing = true
$game_temp.transition_name = ""
end
return false
end
# ------------------------------------
def command_202
character = get_character(@parameters[0])
if character == nil
return true
end
if @parameters[1] == 0
character.moveto(@parameters[2], @parameters[3])
elsif @parameters[1] == 1
character.moveto($game_variables[@parameters[2]],
$game_variables[@parameters[3]])
else
old_x = character.x
old_y = character.y
character2 = get_character(@parameters[2])
character.moveto(character2.x, character2.y)
character2.moveto(old_x, old_y)
end
case @parameters[4]
when 8
character.turn_up
when 6
character.turn_right
when 2
character.turn_down
when 4
character.turn_left
end
return true
end
# ------------------------------------
def command_203
if $game_map.scrolling?
return false
end
$game_map.start_scroll(@parameters[0], @parameters[1], @parameters[2])
return true
end
# ------------------------------------
def command_204
case @parameters[0]
when 0
$game_map.panorama_name = @parameters[1]
$game_map.panorama_hue = @parameters[2]
when 1
$game_map.fog_name = @parameters[1]
$game_map.fog_hue = @parameters[2]
$game_map.fog_opacity = @parameters[3]
$game_map.fog_blend_type = @parameters[4]
$game_map.fog_zoom = @parameters[5]
$game_map.fog_sx = @parameters[6]
$game_map.fog_sy = @parameters[7]
when 2
$game_map.battleback_name = @parameters[1]
$game_temp.battleback_name = @parameters[1]
end
return true
end
# ------------------------------------
def command_205
$game_map.start_fog_tone_change(@parameters[0], @parameters[1] * 2)
return true
end
# ------------------------------------
def command_206
$game_map.start_fog_opacity_change(@parameters[0], @parameters[1] * 2)
return true
end
# ------------------------------------
def command_207
character = get_character(@parameters[0])
if character == nil
return true
end
character.animation_id = @parameters[1]
return true
end
# ------------------------------------
def command_208
$game_player.transparent = (@parameters[0] == 0)
return true
end
# ------------------------------------
def command_209
character = get_character(@parameters[0])
if character == nil
return true
end
character.force_move_route(@parameters[1])
return true
end
# ------------------------------------
def command_210
unless $game_temp.in_battle
@move_route_waiting = true
end
return true
end
# ------------------------------------
def command_221
if $game_temp.message_window_showing
return false
end
Graphics.freeze
return true
end
# ------------------------------------
def command_222
if $game_temp.transition_processing
return false
end
$game_temp.transition_processing = true
$game_temp.transition_name = @parameters[0]
@index += 1
return false
end
# ------------------------------------
def command_223
$game_screen.start_tone_change(@parameters[0], @parameters[1] * 2)
return true
end
# ------------------------------------
def command_224
$game_screen.start_flash(@parameters[0], @parameters[1] * 2)
return true
end
# ------------------------------------
def command_225
$game_screen.start_shake(@parameters[0], @parameters[1],
@parameters[2] * 2)
return true
end
# ------------------------------------
def command_231
number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)
if @parameters[3] == 0
x = @parameters[4]
y = @parameters[5]
else
x = $game_variables[@parameters[4]]
y = $game_variables[@parameters[5]]
end
$game_screen.pictures[number].show(@parameters[1], @parameters[2],
x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])
return true
end
# ------------------------------------
def command_232
number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)
if @parameters[3] == 0
x = @parameters[4]
y = @parameters[5]
else
x = $game_variables[@parameters[4]]
y = $game_variables[@parameters[5]]
end
$game_screen.pictures[number].move(@parameters[1] * 2, @parameters[2],
x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])
return true
end
# ------------------------------------
def command_233
number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)
$game_screen.pictures[number].rotate(@parameters[1])
return true
end
# ------------------------------------
def command_234
number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)
$game_screen.pictures[number].start_tone_change(@parameters[1],
@parameters[2] * 2)
return true
end
# ------------------------------------
def command_235
number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)
$game_screen.pictures[number].erase
return true
end
# ------------------------------------
def command_236
$game_screen.weather(@parameters[0], @parameters[1], @parameters[2])
return true
end
# ------------------------------------
def command_241
$game_system.bgm_play(@parameters[0])
return true
end
# ------------------------------------
def command_242
$game_system.bgm_fade(@parameters[0])
return true
end
# ------------------------------------
def command_245
$game_system.bgs_play(@parameters[0])
return true
end
# ------------------------------------
def command_246
$game_system.bgs_fade(@parameters[0])
return true
end
# ------------------------------------
def command_247
# BGM / BGS ???
$game_system.bgm_memorize
$game_system.bgs_memorize
return true
end
# ------------------------------------
def command_248
$game_system.bgm_restore
$game_system.bgs_restore
return true
end
# ------------------------------------
def command_249
$game_system.me_play(@parameters[0])
return true
end
# ------------------------------------
def command_250
$game_system.se_play(@parameters[0])
return true
end
# ------------------------------------
def command_251
Audio.se_stop
return true
end
end
# ------------------------------------
def command_301
$game_temp.battle_abort = true
$game_temp.battle_calling = true
$game_temp.battle_troop_id = @parameters[0]
$game_temp.battle_can_escape = @parameters[1]
$game_temp.battle_can_lose = @parameters[2]
current_indent = @list[@index].indent
$game_temp.battle_proc = Proc.new { |n| @branch[current_indent] = n }
@index += 1
return false
end
# ------------------------------------
def command_601
if @branch[@list[@index].indent] == 0
@branch.delete(@list[@index].indent)
return true
end
return command_skip
end
# ------------------------------------
def command_602
if @branch[@list[@index].indent] == 1
@branch.delete(@list[@index].indent)
return true
end
return command_skip
end
# ------------------------------------
def command_603
if @branch[@list[@index].indent] == 1
@branch.delete(@list[@index].indent)
return true
end
return command_skip
end
# ------------------------------------
def command_302
$game_temp.battle_abort = true
$game_temp.shop_calling = true
$game_temp.shop_goods = [@parameters]
loop do
@index += 1
if @list[@index].code == 605
$game_temp.shop_goods.push(@list[@index].parameters)
else
return false
end
end
end
# ------------------------------------
def command_303
$game_temp.battle_abort = true
$game_temp.name_calling = true
$game_temp.name_actor_id = @parameters[0]
$game_temp.name_max_char = @parameters[1]
@index += 1
return false
end
# ------------------------------------
def command_311
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
iterate_actor(@parameters[0]) do |actor|
if actor.hp > 0
actor.hp += value
if @parameters[4] == false and actor.hp == 0
actor.hp = 1
end
end
end
$game_temp.gameover = $game_party.all_dead?
return true
end
# ------------------------------------
def command_312
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
iterate_actor(@parameters[0]) do |actor|
actor.sp += value
end
return true
end
# ------------------------------------
def command_313
iterate_actor(@parameters[0]) do |actor|
if @parameters[1] == 0
actor.add_state(@parameters[2])
else
actor.remove_state(@parameters[2])
end
end
return true
end
# ------------------------------------
def command_314
iterate_actor(@parameters[0]) do |actor|
actor.recover_all
end
return true
end
# ------------------------------------
def command_315
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
iterate_actor(@parameters[0]) do |actor|
actor.exp += value
end
return true
end
# ------------------------------------
def command_316
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
iterate_actor(@parameters[0]) do |actor|
actor.level += value
end
return true
end
# ------------------------------------
def command_317
value = operate_value(@parameters[2], @parameters[3], @parameters[4])
actor = $game_actors[@parameters[0]]
case @parameters[1]
when 0
actor.maxhp += value
when 1
actor.maxsp += value
when 2
actor.str += value
when 3
actor.dex += value
when 4
actor.agi += value
when 5
actor.int += value
end
return true
end
# ------------------------------------
def command_318
actor = $game_actors[@parameters[0]]
if @parameters[1] == 0
actor.learn_skill(@parameters[2])
else
actor.forget_skill(@parameters[2])
end
return true
end
# ------------------------------------
def command_319
$game_actors[@parameters[0]].equip(@parameters[1], @parameters[2])
return true
end
# ------------------------------------
def command_320
$game_actors[@parameters[0]].name = @parameters[1]
return true
end
# ------------------------------------
def command_321
$game_actors[@parameters[0]].class_id = @parameters[1]
return true
end
# ------------------------------------
def command_322
$game_actors[@parameters[0]].set_graphic(@parameters[1],
@parameters[2], @parameters[3], @parameters[4])
$game_player.refresh
return true
end
end
# ------------------------------------
def command_331
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
iterate_enemy(@parameters[0]) do |enemy|
if enemy.hp > 0
enemy.hp += value
if @parameters[4] == false and enemy.hp == 0
enemy.hp = 1
end
end
end
return true
end
# ------------------------------------
def command_332
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
iterate_enemy(@parameters[0]) do |enemy|
enemy.sp += value
end
return true
end
# ------------------------------------
def command_333
iterate_enemy(@parameters[0]) do |enemy|
if $data_states[@parameters[2]].zero_hp
enemy.immortal = false
end
if @parameters[1] == 0
enemy.add_state(@parameters[2])
else
enemy.remove_state(@parameters[2])
end
end
return true
end
# ------------------------------------
def command_334
iterate_enemy(@parameters[0]) do |enemy|
enemy.recover_all
end
return true
end
# ------------------------------------
def command_335
enemy = $game_troop.enemies[@parameters[0]]
enemy.hidden = false
return true
end
# ------------------------------------
def command_336
enemy = $game_troop.enemies[@parameters[0]]
enemy.transform(@parameters[1])
return true
end
# ------------------------------------
def command_337
iterate_battler(@parameters[0], @parameters[1]) do |battler|
if battler.exist?
battler.animation_id = @parameters[2]
end
end
return true
end
# ------------------------------------
def command_338
value = operate_value(0, @parameters[2], @parameters[3])
iterate_battler(@parameters[0], @parameters[1]) do |battler|
if battler.exist?
battler.hp -= value
if $game_temp.in_battle
battler.damage = value
battler.damage_pop = true
end
end
end
return true
end
# ------------------------------------
def command_339
unless $game_temp.in_battle
return true
end
iterate_battler(@parameters[0], @parameters[1]) do |battler|
if battler.exist?
battler.current_action.kind = @parameters[2]
if battler.current_action.kind == 0
battler.current_action.basic = @parameters[3]
else
battler.current_action.skill_id = @parameters[3]
end
if @parameters[4] == -2
if battler.is_a?(Game_Enemy)
battler.current_action.decide_last_target_for_enemy
else
battler.current_action.decide_last_target_for_actor
end
elsif @parameters[4] == -1
if battler.is_a?(Game_Enemy)
battler.current_action.decide_random_target_for_enemy
else
battler.current_action.decide_random_target_for_actor
end
elsif @parameters[4] >= 0
battler.current_action.target_index = @parameters[4]
end
if battler.current_action.valid? and @parameters[5] == 1
$game_temp.forcing_battler = battler
@index += 1
return false
end
end
end
return true
end
# ------------------------------------
def command_340
$game_temp.battle_abort = true
return false
end
# ------------------------------------
def command_351
$game_temp.battle_abort = true
$game_temp.menu_calling = true
@index += 1
return false
end
# ------------------------------------
def command_352
$game_temp.battle_abort = true
$game_temp.save_calling = true
@index += 1
return false
end
# ------------------------------------
def command_353
$game_temp.gameover = true
return false
end
# ------------------------------------
def command_354
$game_temp.to_title = true
return false
end
# ------------------------------------
def command_355
script = @list[@index].parameters[0] + "\n"
loop do
if @list[@index+1].code == 655
script += @list[@index+1].parameters[0] + "\n"
else
break
end
@index += 1
end
result = eval(script)
if result == false
return false
end
return true
end
end
|
Map_ID:
The map ID of the event when it starts. Note that event executions can
continue even if the current map changes. This value won't be updated if this happens.
Event_ID:
The event ID of the event.
Message_Waiting:
This flag is set if the game is waiting for the player to push a button to
advance the message window.
Move_Route_Waiting:
This flag is set if the event is waiting because a "Proceed with Movement"
command has stopped all events from executing until a "Move Event" command has finished.
Button_Input_Variable_ID:
The variable ID in which to store the code for the key being pressed. Used with the "Key Input Processing" event command.
Wait_Count:
The number of frames to wait due to a "Wait" event command.
Child_Interpreter: If this event has called another event, then this variable holds the Interpreter object associated with it.
Branch: A hash table. The keys are indent levels and the values are either booleans or integers that determine which branch the event should take when presented with an event command that can cause branching.
List: The list of event commands in the event.
Index:
A pointer to the next event command to execute. Each event command you enter in the editor increases the possible value of this variable by 1, except for commands the have case handling, such as Conditional Branch and Enemy Encounter, which add more than one index.
Loop_Count: The loop counter for updating the graphics. This counter is incremented once per frame, and that graphics are updated when the counter reaches 100.
Parameters:
An array of parameters being passed to an event command. The number and type of parameters differ for each event command.
Main: This flag is set if this interpreter is the main interpreter. That is, this interpreter was not created as the result of another event calling this event.
Initialize
Arguments:
Depth: The depth of the call stack of this interpreter. Assumed to be 0 if not specified.
Main: A flag telling whether this interpreter is the main interpreter. That is, the interpreter was not created as the result of another event calling this event. Assumed to be false if not specified.
Local Variables:
None
How it Works: Sets the values of @depth and @main instance variables. Also, if the call stack is over 100 elements high, the game will suffer a stack overflow and end.
Clear
Arguments:
None
Local Variables:
None
How it Works: This method clears the instance variables associated with an interpreter.
Setup
Arguments:
List: The list of event commands.
Event_ID: The event ID of the current event.
Local Variables:
None
How it Works: This method sets up the event by first clearing the existing data, then setting the map ID, event ID, and event command list. It then sets the event pointer to the beginning of the command list and clears the branch hash table.
Running?
Arguments:
None
Local Variables:
None
How it Works: Returns true if there is at least one event command in the event command list. Otherwise,
it returns false.
Setup_Starting_Event
Arguments:
None
Local Variables:
None
How it Works: This method starts a non-parallel event that has been triggered. The method first refreshes the map if it needs to be refreshed. Since the same method is used to start both common events and map events, it needs to check which type of event needs to be started. It first checks to see if $game_temp.common_event_id is greater than 0 (meaning a common event is waiting to start). If it is, then the setup method is called and no further processing is done. If no common event is starting, then the for loop iterates through each map event and checks to see if its @starting flag is set and it isn't a parallel process event. If it is, then the event's @starting flag is cleared and the event's facing is locked. For information about how the @starting flag works, please see the Game_Event class description. Finally, it checks for common events with the Auto Start property (trigger == 1). If the switch associated with the Auto Start common event is ON, the event is set up.
Update
Arguments:
None
Local Variables:
None
How it Works: The frame update method for this class. The method first sets the value of @loop_count to zero. The main loop of this method iterates until broken by one of the conditions described below. To prevent freezing, each time @loop_count reaches 100, the graphics are updated. The next check sets the value of @event_id to 0 if the current map isn't the same as the map on which the event started ("orphaned interpreter"). The next if statement checks to see if the event has spawned a child interpreter. If it has, and that event has 1 or more event commands in its command list, the method terminates, allowing the child interpreter to take over. If the @message_waiting flag is set, the method terminates. The next two statements check to see if either the player or an event is being forced to move by a "Move Event" command. If any are, the event is terminated. Next, the input_button method is called if the value of @button_input_variable_id has been set by a "Key Input Processing" event command. Next, if the event is waiting due to a "Wait" command, the number of frames to wait is decremented. If battler is being forced, then the method terminates. If a battle, shop, menu, name input screen, save menu, or game over screen is being called, the method terminates, since any of these will change the value of $scene and temporarily suspend event processing. If the list is nil and this is the main interpreter, then the method checks for events to start. If there are no events to start, then the method terminates. If a common can't be executed for some reason, the method terminates. If it makes it to the end of the loop, the event command pointer is advanced by one.
Input_Button
Arguments:
None
Local Variables:
None
How it Works: This method, used in the Key Input Processing event command, checks to see if a button is being pushed. The method iterates through each button code and stores the result in n if the button is being pushed. If n is greater than 0, the button code is stored in $game_variables[@button_input_variable_id] and the map is refreshed.
Setup_Choices
Arguments:
Parameters: An array containing the parameters for the choices to be setup. parameters[0] is itself an array containing the text of the choices. parameters[1] holds a value that determines the cancellation handler for the choices.
Local Variables: None
How it Works: This method sets up the choices for a Show Choices command. It first sets $game_temp.choice_max to the number of choices in parameters[0], then loads the message text for each choice into $game_temp.message_text. It then loads the choice cancel type into $game_temp.cancel_type. Finally, it loads the branch data for the choices.
Iterate_Actor
Arguments:
Parameter: A value containing actor ID of the actor on which to execute the effect (0 = Entire Party)
Local Variables: None
How it Works: This method is called by event commands that can either affect the entire party or just one hero, such as "Change Hero HP" and "Complete Healing". It first checks to see if parameter is 0. If it is, then for each actor in the party, the method yeilds the actor. The yield statement executes the code block passed to it with the paramater being yeilded (in this case, actor). What code is executed depends on the calling event command method. Otherwise, the method yields the actor ID contained in parameter.
Iterate_Enemy
Arguments:
Parameter: A value containing the relative position of the enemy in the enemy party on which to execute the effect (-1 = All Enemies)
Local Variables:
None
How it Works: This method is called by event commands that can either affect one enemy or all enemies, such as "Change Enemy HP" and "Completely Heal Enemy". It first checks to see if parameter is -1. If it is, then for each enemy in the monster, the method yeilds the monster. Otherwise, the method yields the monster index contained in parameter.
Iterate_Battler
Arguments:
Parameter1: Tells the method whether to execute the effect on a party member or a monster (0 = Monster, 1 = Party Member).
Parameter2: The relative position within the party or enemy group of the party member or monster on which to execute the effect (-1 = All Party Members or All Enemies)
Local Variables: None
How it Works: This method is called by event commands that can either all enemies, all party members, one party member, or one enemy such as "Show Battle Animation" and "Deal Damage". The method first checks to see if the first parameter is 0 (monster). If it is, then it just calls iterate_enemy to take care of the processing. If the first parameter is 1 (actor), then it yields every actor in the party, otherwise, it yields the actor ID in parameter2.
Execute_Command
Arguments:
None
Local Variables:
None
How it Works: This method is the hub of activity in this class. It checks to see what command is next in the list to execute and calls that command's method. The comparison of @index to @list.size makes sure that the pointer isn't pointing to the end of the list. If it is, then command_end is called, which terminates the event. Otherwise, the parameters for the next event command to execute are loaded into @parameters and the appropriate method is called based on the command code of that command.
Command_End
Arguments:
None
Local Variables:
None
How it Works: This method terminates the event. It first sets the @list to nil, meaning the event is not running. If this interpreter is the main interpreter and @event_id is greater than 0 (that is, the event didn't cause a map change and this event is not a common event), then the event's graphic is unlocked.
Command_Skip
Arguments:
None
Local Variables:
None
How it Works: This method causes the event execution pointer to jump over a branch of event commands that shouldn't be executed because the conditions for their execution weren't met, such as in a conditional branch. The method first acquires the "indent" level of the pointer, which is the number of nested branches. The main loop in this method iterates through moves the pointer down the list one command and checks the indent of that command. If they're equal, this method returns. Otherwise, it does it again.
Get_Character
Arguments:
Parameter: Tells the method which character object to return.
Local Variables:
None
How it Works: This method returns a character based on the parameter passed to it. If the parameter is -1, then it returns the player object. If it's 0, it returns the character object associated with the currently executing event. If it's 1 or more, it returns the character object associated with that event ID on the map.
Operate_Value
Arguments:
Operation: Many event commands allow for both adding or subtracting from such
quantity (such as Item Management, Change HP, etc.). This value tells the
method whether the quantity should be left alone or be turned into a negative
number.
Operand_Type: Tells the method whether the value of
operand
is the actual value of the operand or a reference to a variable.
Operand: A number that is interpreted as either the actual operand or a
variable reference to the operand, depending on the value of
operand_type
.
Local Variables:
None
How it Works: This method exists because many of the event commands have a similar format: they either take a direct amount, or allow the user to get the amount from a variable, and allow for both adding or subtracting from a quantity. The method first checks operand_type. If the operand type is 0, then it the value is set directly to the value of operand. If the operand type is 1, then the value is set to the value stored in the variable ID stored in operand. If the value of operation is 1, then value returned is multiplied by -1 because the calling event command method is decreasing rather than increasing a quantity. value is then returned to the calling method.
About This Section
This section describes the methods used to execute each event command. In these descriptions, the method name is followed by the name of the event command in brackets. The text in brackets is not part of the actual method name and included here only for convenience. To call the method in your scripts, use only "command_xxx". Also, rather than passing formal arguments to these methods, the engine loads the parameters into the @parameters instance variable. The parameters are represented as an array. Therefore, for this section, the "arguments" section of each method explanation has been replaced with "parameters". The number before each parameter description refers to the array index of that parameter in @parameters.
|
Command_101 [Message]
Parameters:
0: The first line of the message text.
Local Variables:
Line_Count: The number of lines in the message.
How it Works: This method shows a message. If for some reason, this method has been called when there is no message to show, the method returns false. If a message is waiting, then the @message_waiting instance variable is set and the method begins assembling the message text. The $game_temp.message_text = @list[@index].parameters[0] + "\n" acquires the first line of the message from the parameter passed to the method and appends a newline character. The loop body assembles the rest of the contents of the message window. The first check is for an event command with a "code" of 401 (message line). This means that the message has another line. This line is appended to $game_temp.message_text and the line count is incremented. The check for an event command with code 102 (Show Choices) is performed so that if the number of choices plus the current line count is four or less, the choices will be shown in the same message window. The elsif statement that checks for a code of 103 (Input Number) makes it so that if there is available space in the message window, the number input prompt will appear in the same message window as the message text. If none of those conditions are true, then the method terminates.
Command_102 [Show Choices]
Parameters:
0: An array containing the text of the choices.
1: The method by which choice cancellation will be handled.
Local Variables:
None
How it Works: This method shows choices in their own message window. If $game_temp.message_text has nothing in it for some reason, the method does nothing. Otherwise, it sets up the choices with the parameters passed to it.
Command_402 [Check Choice Branch]
Parameters:
0: The choice number to check.
Local Variables:
None
How it Works: After a Show Choices command is executed, this method is called once for each choices that could be chosen. When the choices is chosen, the value of @branch[@list[@index].indent] is loaded with the number of the choice chosen (0 = First Choice, 1 = Second Choice, 2 = Third Choice, 3 = Fourth Choice, 4 = Cancel). The method compares the actual choice chosen with the choice being checked. If they match, then the method returns true, and the branch associated with that choice is chosen. If not, then command_skip is returned, which skips over the branch associated with this choice.
Command_403 [Check Choice Cancellation]
Parameters:
None
Local Variables:
None
How it Works: Checks to see if a Show Choices command was cancelled. The method compares the choice chosen with 4 (cancel chosen). If the choice chosen was 4, then the method returns true and executes the cancellation branch. If not, then command_skip is returned, which skips over the cancellation branch.
Command_103 [Input Number]
Parameters:
0: The ID of the variable in which to store the number.
1: The maximum number of digits allowed.
Local Variables:
None
How it Works: Handles the numerical input window. If $game_temp.message_text has nothing in it for some reason, the method does nothing. Otherwise, the numerical input window is set up.
Command_104 [Message Display Options]
Parameters:
0: The display position of the window (0 = Top, 1 = Middle, 2 = Bottom).
1: Whether the window is transparent (0 = Opaque, 1 = Transparent).
Local Variables:
None
How it Works: If a message window is showing, the method returns false. If one isn't, then the values of $game_system.message_position and $game_system.message_frame are set.
Command_105 [Key Input Processing]
Parameters:
0: The variable ID in which to store the key code.
Local Variables:
None
How it Works: Sets the value of @button_input_variable_id to the variable declared in the "Key Input Processing" event command. The Input_Button method handles the acquisition of the key into the variable.
Command_106 [Wait]
Parameters:
0: The number of frames to wait.
Local Variables:
None
How it Works: Sets the wait count to twice the number of frames set in the "Wait" command.
Command_111 [Conditional Branch]
Parameters:
0: The condition to evaluate.
1: Has various meanings, depending on which condition is being evaluated.
2: Has various meanings, depending on which condition is being evaluated.
3: Has various meanings, depending on which condition is being evaluated.
4: The comparison to be made for variables.
Local Variables:
Result: The value returned to the caller.
Value1: The first value to compare in a variable compraison.
Value2: The second value to compare in a variable compraison.
How it Works: Checks to see if the condition passed to this method is true or false. If the condition is true, then a handler associated with the condition is executed. If the condition is false, the user can choose to either have the command do nothing, or execute a special handler. I won't go through each condition compared, but the general methodology here is to set the value of result to an expression comparing the value passed to this method to the value of some object. At the end of this method, the value of @branch[@list[@index].indent] is set to the value of result, to indicate whether or not the branch should be taken. If the result is false, then the method returns command_skip, indicating that the handler associated with the condition should not be taken. This value is also used in checking to see whether an "else case handler" should be executed (see below for details).
Command_411 [Else Case Handling]
Parameters:
None
Local Variables:
None
How it Works: Checks to see if a special handler should be executed because the condition for a Conditional Branch was not met. If the branch should be taken the value of @branch[@list[@index].indent] will be set to false. If the current value of @branch[@list[@index].indent] is false, the method returns true, meaning the branch should be taken. Otherwise, it returns command_skip, which means that the branch should not be taken.
Command_112 [Loop]
Parameters:
None
Local Variables:
None
How it Works: This method does nothing. The "Loop" event command is in the list merely as a placeholder for when the "End Loop" command method is called.
Command_413 [End of Loop Data]
Parameters:
None
Local Variables:
None
How it Works: Decrements the value of @index until the indent value of the command being pointed at has the same indent value of the "End of Loop Data" command.
Command_113 [End Loop]
Parameters:
None
Local Variables:
None
How it Works: Searches the command list for the end of the loop. For this method, the temporary command pointer temp_index is created and set to the @index. The first part of the loop body checks to see if the temporary command pointer has reached the end of the event command list without finding the appropriate label. If it has, the method terminates. For each event command in the list, it checks to see if the event command's "code" is 413 (End of Loop Data). If a match is found, the real command pointer @index is set to the current location of temp_index.
Command_115 [End Event Processing]
Parameters:
None
Local Variables:
None
How it Works: Calls Command_End to terminate event processing.
Command_116 [Erase Event]
Parameters:
None
Local Variables:
None
How it Works: If the event ID of the event passed to this method is greater than 0, then the Game_Event#Erase method is called on that event.
Command_117 [Call Common Event]
Parameters:
0: The common event to call.
Local Variables:
None
How it Works: This method calls a common event. A child interpreter with a depth one greater than the current interpreter's depth is spawned and that event is set up, which transfers control to the child interpreter.
Command_118 [Label]
Parameters:
0: The name of the label.
Local Variables:
None
How it Works: This method does nothing. The "Label" event command is in the list merely as a placeholder for when the "Junp to Label" command method is called.
Command_119 [Jump to Label]
Parameters:
0: The name of the label to which to jump.
Local Variables:
temp_index: The temporary event command pointer that searches for the label passed to the method.
How it Works: Searches the command list for the label name passed to this method and sets the event command pointer to the location of that label. For this method, the temporary command pointer temp_index is created and set to the beginning of the list of event commands. The first part of the loop body checks to see if the temporary command pointer has reached the end of the event command list without finding the appropriate label. If it has, the method terminates. For each event command in the list, it checks to see if the event command's "code" is 118 (label) and its parameter is the name of the label being searched for. If a match is found, the real command pointer @index is set to the current location of temp_index.
Command_121 [Switch Operation]
Parameters:
0: The lower bound of the switch range for this operation
1: The upper bound of the switch range for this operation
2: Whether to turn the switches ON or OFF.
Local Variables:
None
How it Works: Sets game switches. For each switch in the range between paramters[0] and paramters[1], the value of the switch is set to the ON or OFF parameter passed to this method. Note that if you select the "single switch" option in the "Change Switch" dialog, the first two parameters will be set to the same value, so no unique processing is required for this case.
Command_122 [Variable Operation]
Parameters:
0: The lower bound of the variable range for this operation
1: The upper bound of the variable range for this operation
2: The operation to perform on the variable(s) (0 = Set, 1 = Add, 2 = Subtract,
3 = Multiply, 4 = Divide, 5 = Modulous).
3: The type of operand.
4: Either the operand itself or an operand subtype, depending on the main
operand type.
5: If there is an operand subtype, then this parameter is the operand.
Local Variables:
Value: The operand for the variable operation.
How it Works: Changes the value of a variable according to the parameters passed to this method. The first part of this method is a huge case statement that sets the value of value to whatever the user specified as the target. The for i in @parameters[0] .. @parameters[1] loop performs the actual changes to the variable according to the value of for i in @parameters[2]. The final part of the method is a bounding check. If the variable is above 99999999, the variable is set to 99999999. If the variable is below -99999999, the variable is set to -99999999. The reason that $game_map.need_refresh is set is so that any event preconditions that were met as a result of the variable change will be reflected on the map immediately.
Command_123 [Local Switch Operation]
Parameters:
0: The local switch to change.
1: Whether to turn the local switch OFF or ON.
Local Variables:
Key: The hash table key of the local switch to be changed.
How it Works: Sets switches local to this event. If the event ID is greater than 0 (the event is valid), then the local switch referenced by key is changed to the value passed to this method.
Command_124 [Timer Operation]
Parameters:
0: Whether to start or stop the timer (0 = Start, 1 = Stop).
1: The number of seconds for whcih to set the timer. Not used if the timer is
being stopped.
Local Variables:
None
How it Works: Sets or stops the timer. The value of paramters[0] determines the value of $game_system.timer_working. The Game_System#Update method handles the countdown of the timer if the timer is being set. If the timer is being set, it is set to the number of seconds stored in paramters[1] multiplied by the current frame rate.
Command_125 [Change Money]
Parameters:
0: Whether to add or remove money (0 = Add, 1 = Remove).
1: Whether the amount is set directly or contained in a variable (0 = Fixed
amount, 1 = Stored in Variable).
2: The amount of money to gain or lose. If the value is fixed, then this
parameter contains the fixed amount. If it's stored in a variable, this
parameter contains the ID of that variable.
Local Variables:
None
How it Works: Adds or removes money from the party. The call to operate_value figures out whether the value is stored in a variable or not and returns the amount of money to add (a negative number means items will be removed). The Game_Party#Gain_Gold method takes care of adding or removing the money.
Command_126 [Item Management]
Parameters:
0: Which item to gain or lose.
1: Whether to add or remove items (0 = Add, 1 = Remove).
2: Whether the amount of items is set directly or contained in a variable (0 =
Fixed amount, 1 = Stored in Variable).
3: The amount of that item to gain or lose. If the value is fixed, then this
parameter contains the fixed amount. If it's stored in a variable, this
parameter contains the ID of that variable.
Local Variables:
None
How it Works: Adds or removes items from the party's stock. The call to operate_value figures out whether the value is stored in a variable or not and returns the number of items to add (a negative number means items will be removed). The Game_Party#Gain_Item method takes care of adding or removing the items in the party's stock.
Command_127 [Weapon Management]
Parameters:
0: Which item to gain or lose.
1: Whether to add or remove items (0 = Add, 1 = Remove).
2: Whether the amount of items is set directly or contained in a variable (0 =
Fixed amount, 1 = Stored in Variable).
3: The amount of that item to gain or lose. If the value is fixed, then this
parameter contains the fixed amount. If it's stored in a variable, this
parameter contains the ID of that variable.
Local Variables:
None
How it Works: Adds or removes weapons from the party's stock. The call to operate_value figures out whether the value is stored in a variable or not and returns the number of weapons to add (a negative number means items will be removed). The Game_Party#Gain_Weapon method takes care of adding or removing the items in the party's stock.
Command_128 [Defense Item Management]
Parameters:
0: Which item to gain or lose.
1: Whether to add or remove items (0 = Add, 1 = Remove).
2: Whether the amount of items is set directly or contained in a variable (0 =
Fixed amount, 1 = Stored in Variable).
3: The amount of that item to gain or lose. If the value is fixed, then this
parameter contains the fixed amount. If it's stored in a variable, this
parameter contains the ID of that variable.
Local Variables:
None
How it Works: Adds or removes defense items from the party's stock. The call to operate_value figures out whether the value is stored in a variable or not and returns the number of defense items to add (a negative number means items will be removed). The Game_Party#Gain_Armor method takes care of adding or removing the items in the party's stock.
Command_129 [Change Party Members]
Parameters:
0: Which actor to add or remove.
1: Whether to add or remove an actor (0 = Add, 1 = Remove)
2: Whether or not to add the actor in its initial state (0 = No, 1 = Yes).
Local Variables:
None
How it Works: Adds and removes party members. If a party member is being added and paramters[2] is 1 (Add in initial state), then the Game_Actor#Setup method takes care of initializing the actor's state. Whether the actor is initialized or not, the Game_Party#Add_Actor method actually adds the actor (including checking for the party being full). If an actor is being removed, then Game_Party#Remove_Actor removes the actor if the actor is present.
Command_131 [Change Window Skin]
Parameters:
0: The filename of the new window skin.
Local Variables:
None
How it Works: Changes the value of $game_system.windowskin_name to the file name passed to this
method.
Command_132 [Change Battle BGM]
Parameters:
0: The filename of the new battle BGM.
Local Variables:
None
How it Works: Changes the value of $game_system.battle_bgm to the BGM passed to this method.
Command_133 [Change Battle Victory ME]
Parameters:
0: The filename of the new battle victory ME.
Local Variables:
None
How it Works: Changes the value of $game_system.battle_end_me to the ME passed to this method.
Command_134 [Allow/Disallow Saving]
Parameters:
0: Whether to allow or disallow saving (0 = Disallow, 1 = Allow).
Local Variables:
None
How it Works: Sets the $game_system.save_disabled flag to the value passed to this method.
Command_135 [Allow/Disallow Main Menu]
Parameters:
0: Whether to allow or disallow opening the main menu (0 = Disallow, 1 = Allow).
Local Variables:
None
How it Works: Sets the $game_system.menu_disabled flag to the value passed to this method.
Command_136 [Allow/Disallow Random Encounters]
Parameters:
0: Whether to allow or disallow random encounters (0 = Disallow, 1 = Allow).
Local Variables:
None
How it Works: Sets the $game_system.encounter_disabled flag to the value passed to this method. The call to Game_Player#make_encounter_count is called so that if random encounters were re-enabled, the number of steps before encountering a monster will be set.
Command_201 [Teleport]
Parameters:
0: Whether a specific location is being specified or the location is stored in
variables (0 = Specific Location, 1 = Stored in Variables)
1: The map ID of the new location. If the teleport destination is a specific
location, then this value contains the map ID. If the teleport destination is
stored in variables, then this value contains the variable ID in which the map
ID is stored.
2: The X coordinate of the new location. If the teleport destination is a
specific location, then this value contains the X coordinate. If the teleport
destination is stored in variables, then this value contains the variable ID in
which the X coordinate is stored.
3: The Y coordinate of the new location. If the teleport destination is a
specific location, then this value contains the Y coordinate. If the teleport
destination is stored in variables, then this value contains the variable ID in
which the Y coordinate is stored.
4: The direction the player will face after teleporting (0 = Retain Facing, 2 =
Down, 4 = Left, 6 = Right, 8 = Up)
5: Whether or not the screen should fade for the teleport (0 = Yes, 1 = No).
Local Variables:
None
How it Works: This method teleports the player to a new location. If the player is already teleporting, a message window is showing, or a transition is being processed, this command is ignored. The first thing the method does is set the $game_temp.player_transferring flag, so that other events won't interfere while the teleport is taking place. The if statement determines whether the new location has been entered directly, or is being assembled from variables. The values of the new map ID, X coordinate, Y coordinate, and facing direction are set. If the fade flag is set, the graphics freeze and a special transition with no name (fade) is processed.
Command_202 [Change Event Location]
Parameters:
0: The event ID of the event that will change locations (0 = This event).
1: Whether or not the new coordinates of the event are specified directly or
stored in variables (0 = Specified Directly, 1 = Stored in Variables, 2 = Trade places with another event)
2: The X coordinate of the new location. If the teleport destination is a
specific location, then this value contains the X coordinate. If the teleport
destination is stored in variables, then this value contains the variable ID in
which the X coordinate is stored.
3: The Y coordinate of the new location. If the teleport destination is a
specific location, then this value contains the Y coordinate. If the teleport
destination is stored in variables, then this value contains the variable ID in
which the Y coordinate is stored.
4: The direction the event will face after teleporting (0 = Retain Facing, 2 =
Down, 4 = Left, 6 = Right, 8 = Up)
Local Variables:
Character2: The event with which to trade places.
Old_X: The old X coordinate of the first event when trading places.
Old_Y: The old Y coordinate of the first event when trading places.
How it Works: This method moves an event on the map to a new location. The call to Get_Character determines whether this event or another event is to be moved. If the character is nil (invalid), then the method returns without doing anything. The next part of the method determines whether the new X and Y coordinates are specific coordinates or stored in variables. In either case, the Game_Character#Moveto method is called with the character, X coordinate, and Y coordinate. If the user has chosen to exchange the locations of two events, then the first event's X and Y coordinates are acquired, the character with which to trade is acquired, and the Game_Character#Moveto method is called on both events to trade their locations. The final case statement sets the facing of the event at its new location.
Command_203 [Pan Screen]
Parameters:
0: The direction to scroll the map (2 = Down, 4 = Left, 6 = Right, 8 = Up)
1: The number of tiles to scroll the map.
2: The speed at which to scroll the map. This value can range from 1 to 6.
Local Variables:
None
How it Works: Starts a screen scroll effect by loading the $game_map object with the scroll direction, scroll speed, and number of tiles to scroll. The method Game_Map#Update performs the frame-by-frame updating of the scrolling
Command_204 [Change Map Settings]
Parameters:
0: Which map setting to change (0 = Panorama, 1 = Fog, 2 = Battle Background)
1: The filename of the new image (in all three cases)
2: The hue modification of the image (for panoramas and fogs only).
3: The fog's opacity value (0 = Completely Transparent, 255 = Completely Opaque)
4: The fog's blend type (0 = Normal, 1 = Additive, 2 = Negative)
5: The fog's magnification, expressed as a percentage.
6: The fog's starting X coordinate.
7: The fog's starting Y coordinate.
Local Variables:
None
How it Works: This method changes either the panorama, fog, or battle background for the current map. The main case statement chooses between these three alternatives. If the setting to change is the panorama (case 0), then the method assigns the new filename and hue modification. If the setting to change is the fog (case 1), then the method assigns the new filename, hue modification, opacity, blend type, magnification, SX, and SY of the fog. If the setting to change is the battle background (case 2), then the method assigns the new filename of the battle background and the "temporary" battle background. This is so that if the party is currently in battle, the battle background will change immediately.
Command_205 [Tint Fog]
Parameters:
0: The new fog tone.
1: The transition time to change from the old color to the new one, in frames.
Local Variables:
None
How it Works: Starts a fog tinting effect by loading the $game_map object with the new fog tone value and the duration of the transition to the new tone. The method Game_Map#Update does the frame-by-frame tinting of the fog.
Command_206 [Change Fog Opacity]
Parameters:
0: The new fog opacity (0 = Completely Transparent, 255 = Completely Opaque).
1: The transition time to change from the old opacity to the new one, in frames.
Local Variables:
None
How it Works: Starts a fog opacity change by loading the $game_map object with the opacity value and the duration of the transition. The method Game_Map#Update actually handles the frame-by-frame transition to the new fog opacity.
Command_207 [Show Battle Animation - Map Version]
Parameters:
0: The event on which to show the animation.
1: The animation ID of the animation to show.
Local Variables:
None
How it Works: Shows a battle animation on an event. The character = get_character(@parameters[0]) statement determines whether the animation should be shown on the player, this event, or another event on the map. If the character is nil (that is, it doesn't exist), then the method does nothing. Otherwise, the character's @animation_id is set to the animation ID of the animation to show.
Command_208 [Change Hero Transparency]
Parameters:
0: The new hero transparency setting (0 = Transparent 1 = Opaque).
Local Variables:
None
How it Works: Sets the $game_player.transparent value to the value passed to this method.
Command_209 [Move Event]
Parameters:
0: The event to move.
1: An array containing the set of moves to execute.
Local Variables:
None
How it Works: Loads a character's forced movement buffer. The character = get_character(@parameters[0]) statement determines whether the Move Event applies to the player, this event, or another event on the map. If the character is nil, then the method does nothing. Otherwise, the call to Game_Character#force_move_route loads the route passed to this method into the character's forced movement buffer.
Command_210 [Proceed with Movement]
Parameters:
None
Local Variables:
None
How it Works: As long as $game_temp.in_battle is false (the hero is on the map rather than in battle), the event's @move_route_waiting flag is set, which means the event won't move until all forced movements resulting from "Move Event" are complete.
Command_221 [Prepare Transition]
Parameters:
None
Local Variables:
None
How it Works: Freezes the graphics in preparation for executing a transition. The check of $game_temp.message_window_showing checks if a message window is showing. If one is showing, then the method returns false. Otherwise, the Graphics#Freeze method is called, which means the graphics won't update until the graphics are unfrozen.
Command_222 [Execute Transition]
Parameters:
0: The filename of the transition to execute.
Local Variables:
None
How it Works: Executes a transition. The check of $game_temp.transition_processing is to see if the engine is already executing a transition. If it is, then the method returns false without doing anything. If no transition is being processed, then the method sets the value of $game_temp.transition_processing to true and the value of $game_temp.transition_name to the file name of the transition to process. The actual handling of transitions is done by a higher-level graphics class and isn't editable by the user.
Command_223 [Tint Screen]
Parameters:
0: The new screen tone.
1: The transition time from the old screen tone to the new one, in frames.
Local Variables:
None
How it Works: Starts a screen tone change by loading the $game_screen object with the appropriate tone and duration values. The method Game_Screen#Update actually handles the frame-by-frame transition to the new tone.
Command_224 [Flash Screen]
Parameters:
0: The flash color.
1: The amount of frames the flash lasts.
Local Variables:
None
How it Works: Starts a screen flash by loading the $game_screen object with the appropriate color and duration values. The method Game_Screen#Update actually handles the frame-by-frame updating of the flash effect.
Command_225 [Shake Screen]
Parameters:
0: The shake power, a value from 1 to 9.
1: The shake speed, a value from 1 to 9.
2: The duration of the shaking, in frames.
Local Variables:
None
How it Works: Starts a screen shake effect by loading the $game_screen object with the appropriate power, speed, and duration values. The method Game_Screen#Update actually handles the frame-by-frame updating of the graphics resulting from the shaking.
Command_231 [Show Picture]
Parameters:
0: The picture number to show.
1: The filename of the picture.
2: The point relative to which the picture will be shown (0 = Upper-Left, 1 =
Center).
3: Whether the display coordinates are specified directly or stored in
variables (0 = Specified Directly, 1 = Stored in Variables)
4: The X coordinate of the picture. If the X coordinate is a specific value,
then this paramater contains the value of the X coordinate. If the X
coordinate is stored in variables, then this value contains the variable ID in
which the X coordinate is stored.
5: The Y coordinate of the picture. If the Y coordinate is a specific value,
then this paramater contains the value of the Y coordinate. If the Y
coordinate is stored in variables, then this value contains the variable ID in
which the Y coordinate is stored.
6: The X-axis magnification of the picture, expressed as a percentage.
7: The Y-axis magnification of the picture, expressed as a percentage.
8: The picture's opacity (0 = Completely Transparent, 255 = Completely Opaque)
9: The picture's blend type (0 = Normal, 1 = Additive, 2 = Negative).
Local Variables:
None
How it Works: Shows a picture onscreen. The number is determined by either getting the number directly from what is passed to the method (if the party isn't in battle), or taking that number and adding 50 (if the party is in battle. The first thing the method does is acquire the X and Y coordinate of the picture, either directly (if parameters[3] is 0) or from variables (if parameters[3] is 1). The method then calls the Game_Picture#Show on that picture in order to show the picture, with the other parameters passed to this method, such as blend type, magnification, and opacity).
Command_232 [Move Picture]
Parameters:
0: The picture number to move.
1: The transition time for the move picture operation, in frames.
2: The point relative to which the picture will be shown (0 = Upper-Left, 1 =
Center).
3: Whether the display coordinates are specified directly or stored in
variables (0 = Specified Directly, 1 = Stored in Variables)
4: The X coordinate of the new location. If the new X coordinate is a specific
value, then this paramater contains the value of the new X coordinate. If the
new X coordinate is stored in variables, then this value contains the variable
ID in which the new X coordinate is stored.
5: The Y coordinate of the new location. If the new Y coordinate is a specific
value, then this paramater contains the value of the new Y coordinate. If the
new Y coordinate is stored in variables, then this value contains the variable
ID in which the new Y coordinate is stored.
6: The X-axis magnification of the picture after movement, expressed as a
percentage.
7: The Y-axis magnification of the picture after movement, expressed as a
percentage.
8: The picture's opacity after movement (0 = Completely Transparent, 255 =
Completely Opaque)
9: The picture's blend type after movement (0 = Normal, 1 = Additive, 2 =
Negative).
Local Variables:
None
How it Works: Moves a picture to a new location on the screen. The number is determined by either getting the number directly from what is passed to the method (if the party isn't in battle), or taking that number and adding 50 (if the party is in battle. The first thing the method does is acquire the X and Y coordinate of the picture, either directly (if parameters[3] is 0) or from variables (if parameters[3] is 1). The method then calls the Game_Picture#Move on that picture in order to move the picture to its new location, with the other parameters passed to this method, such as transition time, blend type, magnification, and opacity).
Command_233 [Rotate Picture]
Parameters:
0: The picture number to rotate.
1: The rotation speed of the picture in half-degrees per frame, a value from
-90 to 90. A positive vaue indications rotation to the right. A negative
value indicates rotation to the left.
Local Variables:
None
How it Works: Changes the rotation speed of a picture. The number is determined by either getting the number directly from what is passed to the method (if the party isn't in battle), or taking that number and adding 50 (if the party is in battle. The method then calls the Game_Picture#Rotate on that picture to change the rotation speed of the picture.
Command_234 [Tint Picture]
Parameters:
0: The picture number to tint.
1: The new picture tone.
2: The transition time from the old tone to the new one, in frames.
Local Variables:
None
How it Works: Tints a picture. The number is determined by either getting the number directly from what is passed to the method (if the party isn't in battle), or taking that number and adding 50 (if the party is in battle. The method then calls the Game_Picture#Start_Tone_Change method on that picture with the paramaters passed to this method.
Command_235 [Erase Picture]
Parameters:
0: The picture number to erase.
Local Variables:
None
How it Works: Erases a picture. The number is determined by either getting the number directly from what is passed to the method (if the party isn't in battle), or taking that number and adding 50 (if the party is in battle. The method then calls the Game_Picture#Erase on that picture.
Command_236 [Weather Effects]
Parameters:
0: The type of weather (0 = None, 1 = Rain, 2 = Storm, 3 = Snow)
1: The weather intensity. Can range from 1 to 9.
2: The transition duration from the old weather to the new weather, in frames.
Local Variables:
None
How it Works: Loads a new weather effect into the $game_screen object. The method Game_Screen#Update actually handles the frame-by-frame transition to the new weather effect and the graphical updating of the effect once the transition is complete.
Command_241 [Play BGM]
Parameters:
0: The filename of the BGM to play.
Local Variables:
None
How it Works: Calls the Game_System#bgm_play method to start playing the BGM passed to this method.
Command_242 [Fade Out BGM]
Parameters:
0: The BGM's fade time, in seconds.
Local Variables:
None
How it Works: Calls the Game_System#bgm_fade method to fade out the BGM passed to this method
Command_245 [Play BGS]
Parameters:
0: The filename of the BGS to play.
Local Variables:
None
How it Works: Calls the Game_System#bgs_play method to start playing the BGS passed to this method.
Command_246 [Fade Out BGS]
Parameters:
0: The BGS's fade time, in seconds.
Local Variables:
None
How it Works: Calls the Game_System#bgs_fade method to fade out the BGS passed to this method.
Command_247 [Memorize BGM/BGS]
Parameters:
None
Local Variables:
None
How it Works: Calls the Game_System#bgm_memorize and Game_System#bgs_memorize methods to memorize the currently-playing BGM and BGS.
Command_248 [Play Memorized BGM/BGS]
Parameters:
None
Local Variables:
None
How it Works: Calls the Game_System#bgm_restore and Game_System#bgs_restore methods to play the memorized BGM and BGS.
Command_249 [Play ME]
Parameters:
0: The filename of the ME to play.
Local Variables:
None
How it Works: Calls the Game_System#me_play method to start playing the ME passed to this method.
Command_250 [Play SE]
Parameters:
0: The filename of the SE to play.
Local Variables:
None
How it Works: Calls the Game_System#se_play method to start playing the sound effect passed to this method.
Command_251 [Stop SE]
Parameters:
None
Local Variables:
None
How it Works: Calls the Audio#se_stop method to stop all currently-playing sound effects.
Command_301 [Enemy Encounter]
Parameters:
0: The ID of the enemy group to battle.
1: A flag telling whether or not the party can escape from the battle.
2: A flag telling whether or not the the game ends if the party is defeated.
Local Variables:
None
How it Works: This method starts an enemy encounter. The first thing the method does is abort any existing battle in progress. The change to $game_temp.battle_calling changes the scene over from map to battle. The method then loads the values of $game_temp.battle_troop_id with the ID of the monster group to be fought, and the values of $game_temp.can_escape and $game_temp.can_lose to let then engine know if the party can flee from this encounter and if the engine should go directly to Game Over upon the party losing the battle, or some other processing should be completed.
Command_601 [Check Victory Handler]
Parameters:
None
Local Variables:
None
How it Works: Checks to see if a special handler should be executed due to a battle victory. When a battle called by an event concludes, a code is returned that describes the battle's outcome (0 = Victory, 1 = Escape, 2 = Defeat). The value of this code is compared with @branch[@list[@index].indent]. If the value is 0 (Victory), then the method returns true and the victory handler is executed. Otherwise, command_skip is returned, which causes the victory handler to be skipped.
Command_602 [Check Escape Handler]
Parameters:
None
Local Variables:
None
How it Works: Checks to see if a special handler should be executed due to a battle victory. When a battle called by an event concludes, a code is returned that describes the battle's outcome (0 = Victory, 1 = Escape, 2 = Defeat). The value of this code is compared with @branch[@list[@index].indent]. If the value is 1 (Escape), then the method returns true and the escape handler is executed. Otherwise, command_skip is returned, which causes the escape handler to be skipped.
Command_603 [Check Defeat Handler]
Parameters:
None
Local Variables:
None
How it Works: Checks to see if a special handler should be executed due to a battle victory. When a battle called by an event concludes, a code is returned that describes the battle's outcome (0 = Victory, 1 = Escape, 2 = Defeat). The value of this code is compared with @branch[@list[@index].indent]. If the value is 2 (Defeat), then the method returns true and the defeat handler is executed. Otherwise, command_skip is returned, which causes the defeat handler to be skipped.
Command_302 [Open Shop Window]
Parameters:
0: The item ID of the first product being sold at the shop.
Local Variables:
None
How it Works: This method opens the shop window. The first thing the method does is abort any existing battle in progress. The change to $game_temp.shop_calling changes the scene from the map to the shop window. The parameter passed to this method is the first item being sold at the shop, so this item is added to $game_temp.shop_goods. The main loop in this method checks to see if subsequent event commands have a "code" of 605 (Shop Product). As long as it finds this code, the name of the product found on that line is added to $game_temp.shop_goods.
Command_303 [Enter Hero Name]
Parameters:
0: The actor ID of the actor to name.
1: The maximum number of characters allowed in the name.
Local Variables:
None
How it Works: This method opens the enter hero name window. The first thing the method does is abort any existing battle in progress. The change to $game_temp.name_calling changes the scene from the map to the name input window. The values of $game_temp.actor_id and $game_temp.max_char are changed to reflect the actor being named and the maximum number of characters allowed in the name.
Command_311 [Change Hero HP]
Parameters:
0: The actor ID of the actor whose HP will be changed (0 = Entire Party).
1: Whether HP is being added or subtracted (0 = Added, 1 = Subtracted).
2: Whether the amount of HP is being directly specified or stored in variables
(0 = Direclty Specified, 1 = Stored in Variables)
3: The amount of HP. If the amount is being directly specified, then this
parameter contains the actual amount of HP. If the amount is stored in a
variable, then this parameter contains the variable ID that contains the amount.
4: A flag that tells whether a loss of HP can kill the actor. If this flag is
not set, then the actor's HP will become 1 if the damage would reduce its HP to 0 or below.
Local Variables:
Value: The amount of HP to be added or subtracted.
How it Works: This method changes the HP of one actor or every actor in the party, depending on the user's wishes. The call to operate_value resolves whether the amount of HP is stored in a variable or entered directly, and whether it should be multiplied by -1 because HP is being subtracted rather than added. Once that is determined, for each actor the iterate_actor method yields, an amount of HP equal to value is added to the actor's total, provided the actor is alive. If this causes the actor's HP to become 0 and the "HP Reduction can Kill Target" flag is not set, the actor's HP is set to 1 instead. The final statement in this method checks to see if the HP reduction caused a game over because it killed the last living party member(s).
Command_312 [Change Hero SP]
Parameters:
0: The actor ID of the actor whose SP will be changed (0 = Entire Party).
1: Whether SP is being added or subtracted (0 = Added, 1 = Subtracted).
2: Whether the amount of SP is being directly specified or stored in variables
(0 = Direclty Specified, 1 = Stored in Variables)
3: The amount of SP. If the amount is being directly specified, then this
parameter contains the actual amount of SP. If the amount is stored in a
variable, then this parameter contains the variable ID that contains the amount.
Local Variables:
Value: The amount of SP to be added or subtracted.
How it Works: This method changes the SP of one actor or every actor in the party, depending on the user's wishes. The call to operate_value resolves whether the amount of SP is stored in a variable or entered directly, and whether it should be multiplied by -1 because SP is being subtracted rather than added. Once that is determined, for each actor the iterate_actor method yields, an amount of SP equal to value is added to the actor's total.
Command_313 [Change Hero Status]
Parameters:
0: The actor ID of the actor whose status will be changed (0 = Entire Party).
1: Whether a status ailment is being added or removed (0 = Added, 1 = Removed).
2: The status ailment to add or remove.
Local Variables:
None
How it Works: This method changes the status of one actor or every actor in the party, depending on the user's wishes. For each actor the iterate_actor method yields, the status ailment passed to this method is either added or removed, depending on the value of parameters[1].
Command_314 [Complete Healing]
Parameters:
0: The actor ID of the actor to heal (0 = Entire Party).
Local Variables:
None
How it Works: Completely restores the HP and SP and removes all status effects of one actor or the entire party, depending on the user's wishes. For each actor the iterate_actor method yields, the Game_Battler#Recover_All method is called for that actor.
Command_315 [Change Experience Points]
Parameters:
0: The actor ID of the actor whose experience points will be changed (0 =
Entire Party).
1: Whether experience is being added or subtracted (0 = Added, 1 = Subtracted).
2: Whether the amount of experience is being directly specified or stored in
variables (0 = Direclty Specified, 1 = Stored in Variables)
3: The amount of experience. If the amount is being directly specified, then
this parameter contains the actual amount of experience. If the amount is
stored in a variable, then this parameter contains the variable ID that
contains the amount of experience.
Local Variables:
Value: The amount of experience points to be added or subtracted.
How it Works: Adds or removes experience points for one actor or the entire party, depending on the user's wishes. The call to operate_value resolves whether the amount of experience is stored in a variable or entered directly, and whether it should be multiplied by -1 because experience points are being removed rather than added. For each actor the iterate_actor method yields, that actor's experience points are increased by the amount passed to this method.
Command_316 [Change Level]
Parameters:
0: The actor ID of the actor whose level will be changed (0 = Entire Party).
1: Whether levels are being added or subtracted (0 = Added, 1 = Subtracted).
2: Whether the number of levels is being directly specified or stored in
variables (0 = Direclty Specified, 1 = Stored in Variables)
3: The number of levels. If the number of levels is being directly specified,
then this parameter contains the actual number of levels. If the number is
stored in a variable, then this parameter contains the variable ID that
contains the number of levels.
Local Variables:
Value: The number of levels to be added or subtracted.
How it Works: Adds or subtracts levels for one actor or the entire party, depending on the user's wishes. The call to operate_value resolves whether the number of levels is stored in a variable or entered directly, and whether it should be multiplied by -1 because levels are being subtracted rather than added. For each actor the iterate_actor method yields, that actor's level is increased by the number passed to this method.
Command_317 [Change Hero Base Statistics]
Parameters:
0: The actor ID of the actor whose base statistics will be changed.
1: The statstic to change (0 = Max HP, 1 = Max SP, 2 = Strength, 3 = Dexterity,
4 = Agility, 5 = Intelligence)
2: Whether points are being added or subtracted (0 = Added, 1 = Subtracted).
3: Whether the number of points is being directly specified or stored in
variables (0 = Direclty Specified, 1 = Stored in Variables)
4: The number of points. If the number of points is being directly specified,
then this parameter contains the actual number of points. If the number is
stored in a variable, then this parameter contains the variable ID that
contains the number of points.
Local Variables:
Value: The number of points to be added or subtracted from the actor's base statistics.
How it Works: Adds or subtracts points for one actor's base statistics. The call to operate_value resolves whether the number of points is stored in a variable or entered directly, and whether it should be multiplied by -1 because points are being subtracted rather than added. The case statement checks which base statistic should be changed. The value is then changed based on the actor yielded by iterate_actor.
Command_318 [Change Skills]
Parameters:
0: The actor ID of the actor who will learn or forget a skill.
1: Whether the skill will be learned or forgetten (0 = Learn, 1 = Forget).
2: The skill ID of the skill to be learned or forgotten.
Local Variables:
None
How it Works: Adds or removes a skill for one actor. The Game_Actor#Learn_Skill and Game_Actor#Forget_Skill methods actually add or delete the skill from the actor's skill list.
Command_319 [Change Equipped Items]
Parameters:
0: The actor ID of the actor whose equipped items will be changed.
1: The equipment slot to change (0 = Weapon, 1 = Shield, 2 = Helmet, 3 = Armor,
4 = Accessory).
2: The item ID of the item to equip.
Local Variables:
None
How it Works: Equips the item passed to this method to the equipment slot passed to this method. The Game_Actor#Equip method handles the logistics of equipping the item.
Command_320 [Change Hero Name]
Parameters:
0: The actor ID of the actor whose name will be changed.
1: The actor's new name.
Local Variables:
None
How it Works: Directly sets the actor's name to the new name passed to this method.
Command_321 [Change Hero Class]
Parameters:
0: The actor ID of the actor whose class will be changed.
1: The ID of the actor's new class.
Local Variables:
None
How it Works: Directly sets the actor's class to the new class passed to this method.
Command_322 [Change Hero Graphics]
Parameters:
0: The actor ID of the actor whose graphics will be changed.
1: The filename of the actor's new map sprite.
2: The hue modification of the actor's new map sprite
3: The filename of the actor's new battle image.
4: The hue modification of the actor's new battle image.
Local Variables:
None
How it Works: Directly sets the actor's graphics to the new graphics passed to this method, then refreshes the player sprite on the map, so that if the party leader's graphics were changed, the change will be reflected on the map.
Command_331 [Change Enemy HP]
Parameters:
0: The relative position of the enemy whose HP will be changed (-1 = All
Enemies).
1: Whether HP is being added or subtracted (0 = Added, 1 = Subtracted).
2: Whether the amount of HP is being directly specified or stored in variables
(0 = Direclty Specified, 1 = Stored in Variables)
3: The amount of HP. If the amount is being directly specified, then this
parameter contains the actual amount of HP. If the amount is stored in a
variable, then this parameter contains the variable ID that contains the amount.
4: A flag that tells whether a loss of HP can kill the enemy. If this flag is
not set, then the enemy's HP will become 1 if the damage would reduce its HP to
0 or below.
Local Variables:
Value: The amount of HP to be added or subtracted.
How it Works: This method changes the HP of one enemy or the entire monster party, depending on the user's wishes. The call to operate_value resolves whether the amount of HP is stored in a variable or entered directly, and whether it should be multiplied by -1 because HP is being subtracted rather than added. Once that is determined, for each monster the iterate_enemy method yields, an amount of HP equal to value is added to the monster's total, provided the monster is alive. If this causes the monster's HP to become 0 and the "HP Reduction can Kill Target" flag is not set, the monster's HP is set to 1 instead.
Command_332 [Change Enemy SP]
Parameters:
0: The relative position of the enemy whose SP will be changed (-1 = All
Enemies).
1: Whether SP is being added or subtracted (0 = Added, 1 = Subtracted).
2: Whether the amount of SP is being directly specified or stored in variables
(0 = Direclty Specified, 1 = Stored in Variables)
3: The amount of SP. If the amount is being directly specified, then this
parameter contains the actual amount of SP. If the amount is stored in a
variable, then this parameter contains the variable ID that contains the amount.
Local Variables:
Value: The amount of SP to be added or subtracted.
How it Works: This method changes the SP of one monster or the entire monster party, depending on the user's wishes. The call to operate_value resolves whether the amount of SP is stored in a variable or entered directly, and whether it should be multiplied by -1 because SP is being subtracted rather than added. Once that is determined, for each monster the iterate_enemy method yields, an amount of SP equal to value is added to the monster's total.
Command_333 [Change Enemy Status]
Parameters:
0: The relative position of the enemy whose status will be changed (-1 = All
Enemies).
1: Whether a status ailment is being added or removed (0 = Added, 1 = Removed).
2: The status ailment to add or remove.
Local Variables:
None
How it Works: This method changes the status of one monster or the entire monster group, depending on the user's wishes. For each monster the iterate_enemy method yields, the status ailment passed to this method is either added or removed, depending on the value of parameters[1]. If this status effect has the "Zero HP" property, this overrides the monster's @immortal flag, causing it to die, even if it's set to be immortal.
Command_334 [Completely Heal Monster]
Parameters:
0: The relative position of the enemy to heal (-1 = All Enemies).
Local Variables:
None
How it Works: Completely restores the HP and SP and removes all status effects of one monster or the entire monster party, depending on the user's wishes. For each monster the iterate_enemy method yields, the Game_Battler#Recover_All method is called for that monster.
Command_335 [Show Hidden Monster]
Parameters:
0: The relative position of the enemy to show.
Local Variables:
None
How it Works: Sets the @hidden flag of the mosnter at the relative position in the monster party passed to this method to false.
Command_336 [Transform Monster]
Parameters:
0: The relative position of the enemy to transform.
1: The monster ID of the monster into which this monster will transform.
Local Variables:
None
How it Works: Calls the Game_Battler#Transform method for the monster at the relative position in the party passed to this method.
Command_337 [Show Battle Animation - Battle Version]
Parameters:
0: Tells whether the target is an actor or enemy (0 = Actor, 1 = Enemy).
1: The relative position within the party or enemy group of the actor or enemy
on which to show the animation (-1 = Entire Party or All Enemies)
2: The ID of the animation to show.
Local Variables:
None
How it Works: Shows a battle animation on one actor, one enemy, the entire party, or the entire enemy party, depending on the user's wishes. For each monster the iterate_battler method yields, that battler's @animation_id instance variable is set to the ID of the animation to show. The Scene_Battle#Update method actually handles showing the battle animation.
Command_338 [Deal Damage]
Parameters:
0: Tells whether the target is an actor or enemy (0 = Actor, 1 = Enemy).
1: The relative position within the party or enemy group of the actor or enemy
to damage (-1 = Entire Party or All Enemies)
2: Whether the amount of damage to be dealt is being directly specified or
stored in a variable (0 = Directly Specified, 1 = Stored in a Variable)
3: The amount of damage. If the damage value is being directly specified, then
this parameter will contain the amount of damage. If the amount of stored in a
variable, then this value will contain the variable ID in which the amount of
damage is contained.
Local Variables:
None
How it Works: This method deals damage to one actor, one enemy, the entire party, or the entire enemy party, depending on the user's wishes. It differs from "Change Hero HP" and "Change Monster HP" in that the damage dealt is shown visually if a battle is in progress, and the damage can always kill the target. This method will also not damage hidden monsters. The call to operate_value resolves whether the amount of damage is stored in a variable or entered directly, and whether it should be multiplied by -1 because this is a recovery effect rather than a damage effect. Once that is determined, for each battler the iterate_battler method yields, an amount of damage equal to value is dealt to the battler, provided the battler is alive and not hidden.
Command_339 [Force Action]
Parameters:
0: Tells whether the target is an actor or enemy (0 = Actor, 1 = Enemy).
1: The relative position within the party or enemy group of the actor or enemy
whose action is being forced.
2: The type of action to force (0 = Basic, 1 = Skill).
3: If the action being forced is a basic action, then this parameter contains
the code for the basic action type (0 = Attack, 1 = Defend, 2 = Escape, 3 = No
Action). If the action being forced is a skill, this parameter contains the
skill ID of the skill being forced.
4: The target of the forced action (-2 = Last Target, -1 = Random Target, 0 or
more = specific target).
5: Whether the action should replace the target's next action or be executed
immediately (0 = Replace Next Action, 1 = Immediate Execution)
Local Variables:
None
How it Works: Forces an actor or a monster to use a basic action or a skill. This event command is meaningless unless there is a battle going on, so the method just returns without doing anything if there is no battle in progress. The call to iterate_battler determines which battler is being forced to act. If the battler exists, then the next task is to determine what action the battler is taking. The battler's @current_action object's "kind" of action is set to the value passed to this method (0 = Basic, 1= Skill). If the kind of action is a basic action, then the battler's @current_action.basic variable is set to the type of basic action being taken (0 = Attack, 1 = Defend, 2 = Escape, 3 = Nothing). If the kind of action is a skill, then the battler's @current_action.skill variable is set to the skill ID of the skill being forced. The target for the action is then decided. If the target code passed to this method is -2, then the battler's last target is used. If the code is -1, then a random target is chosen. If the code is 0 or greater, then the target is the relative position of the actor on monster on the opposing side. The if battler.current_action.valid? and @parameters[5] == 1 clause checks to see if the action is both valid and needs to be executed now. If both are true, then $game_temp.forcing_battler is set to the battler object in order to let the battle engine know that the normal flow of battle has been interrupted by a forced action.
Command_340 [End Battle]
Parameters:
None
Local Variables:
None
How it Works: The first statement aborts any battle in progress. The Scene_Battle#Update method actually ends the battle once this variable is set.
Command_351 [Open Main Menu]
Parameters:
None
Local Variables:
None
How it Works: This method calls the main menu. The first statement aborts any battle in progress. Then the value of $game_temp.menu_calling is set to true. The Scene_Map#Update method actually calls the menu once this variable is set.
Command_352 [Open Save Menu]
Parameters:
None
Local Variables:
None
How it Works: This method calls the save menu. The first statement aborts any battle in progress. Then the value of $game_temp.save_calling is set to true. The Scene_Map#Update method actually calls the save menu once this variable is set.
Command_353 [Game Over]
Parameters:
None
Local Variables:
None
How it Works: Sets the value of $game_temp.gameover to true. The Scene_Map#Update method actually sets the value of $Scene to reflect this change.
Command_354 [Return to Title Screen]
Parameters:
None
Local Variables:
None
How it Works: Sets the value of $game_temp.to_title to true. The Scene_Map#Update method actually sets the value of
$Scene to reflect this change.
Command_355 [Script]
Parameters:
0: The text of the first line of the script.
Local Variables:
Script: The script to evaluate, parsed line-by-line.
How it Works: This method executes an inline script within the event command list. The first statement in the method acquires the first line of the script, which is stored inparameters[0]. The loop acquires any subsequent lines of script by checking to see if the next event command in the script has a "code" of 655 (Script Line). Each line found is appended to the end of the Script variable. The Eval(script) statement executes the script. The check to see what this returns is for error-handling purposes.
|
|