Scene Control


Battle Processing
troop_id = variable
e = true/false (if escape enabled)
l = true/false (if continue when lose)

BattleManager.setup(troop_id, e, l)
BattleManager.event_proc = Proc.new {|n| 
@branch[@indent] = n }
$game_player.make_encounter_count
SceneManager.call(Scene_Battle)
Fiber.yield

# Example Script Call below:
troop_id = 1
e = true
l = true

BattleManager.setup(troop_id, e, l)
BattleManager.event_proc = Proc.new {|n| 
@branch[@indent] = n }
$game_player.make_encounter_count
SceneManager.call(Scene_Battle)
Fiber.yield

# OR

BattleManager.setup(1, true, true)
BattleManager.event_proc = Proc.new {|n| 
@branch[@indent] = n }
$game_player.make_encounter_count
SceneManager.call(Scene_Battle)
Fiber.yield


Shop Processing
goods = [[type, id, price_override_flag(, price)]]
SceneManager.call(Scene_Shop)
SceneManager.scene.prepare(goods, true)

# Example Script Call:
goods = [[0,1,1,25],[0,2,0]]
SceneManager.call(Scene_Shop)
SceneManager.scene.prepare(goods, true)

# You can also use a loop to add the elements to the array:
goods = []
for id in 1..20
  goods.push([0, id, 0])
end


Name Input Processing
SceneManager.call(Scene_Name)
SceneManager.scene.prepare(actor_id, chars)
Fiber.yield
# Actor ID = Actor ID, Chars = How many characters long the name can be.


Open Save/Load/Exit/Game Over/Scenes
SceneManager.call(Scene_Save)
SceneManager.call(Scene_Load)
SceneManager.exit
SceneManager.call(Scene_Gameover)

SceneManager.call(scene)
# scene = Scene to load. (example - SceneManager.call(Scene_Skill) )
#         Scene_Menu, Scene_Item, Scene_Skill, Scene_Status, Scene_Title
#         Scene_Save, Scene_Load, Scene_Name, Scene_Debug, etc.


Map



Change Map Display Name
$game_map.name_display = true/false


Change Tileset
$game_map.change_tileset(n)


Change Battleback
$game_map.change_battleback("battleback1", "battleback2")


Change Parallax Back
$game_map.change_parallax("graphicname", Loop Horizontal, Loop Vertical, HScroll, VScroll)
# Loop Horizontal and Loop Vertical = true/false
# HScroll, VScroll = numbers
# Example: $game_map.change_parallax("BlueSky", true, true, 0, 0)


Check Location
# X and Y's
# ----------------------------------------------
$game_player.x
$game_player.y

$game_map.events[n].x
$game_map.events[n].y
# n  = Event ID

# Check Terrain Tag
# ----------------------------------------------
$game_map.terrain_tag(x, y)
$game_player.terrain_tag
$game_map.events[event_id].terrain_tag
 
# Check Region ID
# ----------------------------------------------
$game_map.region_id(x, y)
$game_player.region_id == n
$game_map.events[event_id].region_id == n

# Check Map Name and Map ID
# ----------------------------------------------
$game_map.name
$game_map.map_id

# Check if Event is Near Player
# ----------------------------------------------
$game_map.events[n].near_the_player?

# True/False. Distance for detection is 20 squares.
# n  = Event ID


System Settings


Change Actor/Event Graphic
# Event Change Graphic
# ----------------------------------------------
$game_map.events[id].set_graphic("character_name", character_index)
# id is the id of the event you want to change.
# "character_name" is the name of the graphic file you want to change to (make sure to keep the quotation marks).
# character_index is the index on the character sheet (it starts counting at 0). 

# Actor Change Graphic
# ----------------------------------------------
hero = $game_actors[ID]
hero.set_graphic("characterset_filename", character_index, "Faceset_filename", faceset_index)
$game_player.refresh
# ID = Actor Index
# character_index = Starts from 0 (Top Left), 1, 2, ...
# faceset_index = Starts from 0 (Top Left), 1, 2, ...

# Example:
hero = $game_actors[1]
hero.set_graphic("Actor1", 1, "Actor4", 1)
$game_player.refresh