Movement


Transfer Player
$game_temp.fade_type = fade
$game_player.reserve_transfer(map_id, x, y, direction)
# Fade/Fade Style =  [0; Default, Black], [1] White, [2] None
# For direction: [0; Default, Retain], [2] Down, [4] Left, [8] Up, [6] Right


Set Vehicle Location
# ----------------------------------------------
# To set Vehicle Location
# ----------------------------------------------
$game_map.vehicles[n].set_location(map_id, x, y)
# n = [0] boat, [1] ship, [2] airship

# ----------------------------------------------
# To Refer Game Vehicles 
# ----------------------------------------------
$game_map.vehicles[n]
$game_map.vehicles[n].x
$game_map.vehicles[n].y
# n = [0] boat, [1] ship, [2] airship

# To find a Vehicle's Map ID, you would need to add a accessor reader. 
# Add the following code in Script Editor:
class Game_Vehicle < Game_Character
  attr_reader   :map_id
end

# or Edit Game_Vehicle and add attr_reader   :map_id


Set Event and Player Location
# Move Event ID to new X and new Y Position
# ----------------------------------------------
$game_map.events[id].moveto(new_x, new_y)

# Move Player to new X and new Y Position
# ----------------------------------------------
$game_player.moveto(x, y)


Scroll Map
Fiber.yield while $game_map.scrolling? # Add this if just the script call below doesn't work.
$game_map.start_scroll(direction, distance, speed)
# Direction = [2]Down [4]Left [6]Right [8]Up
# Distance = How many tiles you want it to scroll
# Speed = [1]8x Slower [2]4x Slower [3]2x Slower [4]Normal [5]2x Faster [6]4x Faster


Set Move Route
move_route = RPG::MoveRoute.new
move_route.repeat = false           # This means the event will repeat the action
move_route.skippable = true         # This means the event will skip the move route if it's not possible
m = RPG::MoveCommand.new
m.code = 45                         # The List of M Code can be found over Game_Character Default Script, 
                                    # this current m.code is call script
m.parameters = ["script call here"] # This is if you use #45 in M.code
				    # To show animation in move route just type animation_id = n, for balloons it's balloon_id = n
move_route.list.insert(0,m.clone)

$game_player.force_move_route(move_route)         # For Player
$game_map.events[ID].force_move_route(move_route) # For Events

# ----------------------------------------------
# Other Move Route Options
# ----------------------------------------------

# Single Action
newCommand.code       = moveCode       # See List in Game_Character Default Script 
newCommand.parameters = [""]           # This refers to Jump, Wait, Switch On, Switch Off, Change Speed, 
                                       # Change Frequency, Change Graphic, Change Opacity, Play SE and Script.
newRoute.list.insert(0,newCommand.clone)

# Multiple Actions (Example)
# newCommand.code       = 1
# newRoute.list.insert(0,newCommand.clone)
# newCommand.code       = 3
# newRoute.list.insert(0,newCommand.clone)
# newCommand.code       = 1
# newRoute.list.insert(0,newCommand.clone)

# For Turning
$game_map.events[eventid].set_direction(n) # For Events
$game_player.set_direction(n)              # For Players
#Direction n = [2]Down [4]Left [6]Right [8]Up

# Changing Event 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).


Get On/Off Vehicle
$game_player.get_on_off_vehicle =  true/false


Timing



Wait
Wait(n)

# From a move route or something like that, you'd need the following:
SceneManager.scene.wait(x)

#The following should work as well from anywhere.
x.times { Fiber.yield }


Picture and Weather



Show Picture
screen.pictures[index].show(file_name, position, x, y, x zoom, y zoom, opacity, blend type)
# position = [0] Top Left, [1] = Center
# blend type = [0] Normal, [1] Add, [2] Sub


Move Picture
screen.pictures[n].move(position, x, y, x zoom, y zoom, opacity, blend type, wait)
# position = [0] Top Left, [1] = Center
# blend type = [0] Normal, [1] Add, [2] Sub


Rotate Picture
screen.pictures[n].rotate(n)


Tint Picture
screen.pictures[n].start_tone_change(Tone.new(0, 0, 0, 0), wait)


Erase Picture
screen = $game_party.in_battle ? $game_troop.screen : $game_map.screen # The first line is not required 
screen.pictures[n].erase                                               # if you're using this in an event on the map.


Set Weather Effects
$game_map.screen.change_weather(type, power, duration)


# type = :none, :rain, :storm, or :snow
# power = Intensity of weather. If weather type is none (:none), set power (target value of intensity)
# to 0 to represent gradual stopping of rain, but only in this case.
# time = Specified time to fade weather in or out.


Character



Change Transparency
$game_player.transparent = true/false


Change Player Followers
$game_player.followers.visible = true/false
$game_player.refresh


Gather Followers
$game_player.followers.gather


Show Animation
$game_player.animation_id = n              # For Player 
$game_map.events[eventid].animation_id = n # For Events


Show Balloon Icon
$game_player.balloon_id = n               # For Player 
$game_map.events[eventid].balloon_id = n  # For Events
# Top Row is 1 (Exclamation by Default).


Erase Event
$game_map.events[event_id].erase


Screen Effects



Fade Out Screen
Fiber.yield while $game_message.visible
screen.start_fadeout(30)
wait(30)
# Note: 30 can be change to any number


Fade In Screen
Fiber.yield while $game_message.visible
screen.start_fadein(30)
wait(30)
# Note: 30 can be change to any number


Tint Screen
tone = Tone.new(R,G,B,Opacity)
$game_map.screen.start_tone_change(tone, duration)
wait(n)                                       # Add these too to allow 'wait till the screen changes tint.
n.to_i.times { Fiber.yield }                  # Number of frames to wait (1000 is equal to 1 second)


Flash Screen
color = Color.new(R,G,B,Opacity)
screen.start_flash(color, t)
wait(t)
# t = time
# Example below:
color = Color.new(255,255,25,100)
screen.start_flash(color, 6)
wait(6)


Shake Screen
$game_map.screen.start_shake(power, speed, duration)

# power            - Intensity of shaking.
# speed            - Speed of shaking.
# duration         - Specified time for shaking to occur.


Musics and Sounds



Play BGM/ME/BGS/SE
RPG::BGM.new("BGM Name", volume, pitch).play
RPG::ME.new("ME Name", volume, pitch).play
RPG::BGS.new("BGS Name", volume, pitch).play
RPG::SE.new("SE Name", volume, pitch).play

# Alternative Script Calls
# ----------------------------------------------
Audio.bgm_play(fName, volume, pitch, pos) 
Audio.bgs_play(fName, volume, pitch, pos) 
Audio.me_play(fName, volume, pitch) 
Audio.se_play(fName, volume, pitch) 
# fName      - Name of file containing desired sound file. Also automatically searches
#              files included in RGSS-RTP. File extensions may be omitted.
# volume     - [100; Default - Max:100, Min:0] Volume of sound. OPTIONAL
# pitch      - [100; Default - Max:500, Min:1] Pitch of sound. OPTIONAL
# pos        - Position of sound file. OPTIONAL

# Play Map BGM (Does not Save Position)
# ----------------------------------------------
$game_map.autoplay

# Play Battle Music
# ----------------------------------------------
BattleManager.play_battle_bgm

# Play Battle Victory Music
# ----------------------------------------------
BattleManager.play_battle_end_me


Save BGM/Replay BGM/Fade Out BGM/Stop BGM
# Save BGM
# ----------------------------------------------
$game_system.save_bgm

# Save BGM and BGS
# ----------------------------------------------
BattleManager.save_bgm_and_bgs

# Replay BGM
# ----------------------------------------------
$game_system.replay_bgm

# Replay BGM and BGS
# ----------------------------------------------
BattleManager.replay_bgm_and_bgs

# Fade BGM/BGS/ME
# ----------------------------------------------
RPG::BGM.fade(seconds * 1000)
RPG::BGS.fade(seconds * 1000)
RPG::ME.fade(seconds * 1000)

# Alternative Script Calls
# ----------------------------------------------
# Fade BGM
# ----------------------------------------------
RPG::BGM.fade(time)
# Or ...
Audio.bgm_fade(time)

# Fade BGS
# ----------------------------------------------
RPG::BGS.fade(time)
# Or ...
Audio.bgs_fade(time)

# Fade ME
# ----------------------------------------------
RPG::ME.fade(time)
# Or ...
Audio.me_fade(time)

# time = Number of milliseconds (1000 is equal to 1 second)

# Stop BGM
# ----------------------------------------------
RPG::BGM.stop
RPG::BGS.stop
RPG::ME.stop

# Alternative Script Calls
# ----------------------------------------------
# Halt BGM (Immediate)
# ----------------------------------------------
RPG::BGM.stop
# Or ...
Audio.bgm_stop 

# Halt BGS (Immediate)
# ----------------------------------------------
RPG::BGS.stop
# Or ...
Audio.bgs_stop 

# Halt ME (Immediate)
# ----------------------------------------------
RPG::ME.stop
# Or ...
Audio.me_stop 

# Halt SE (Immediate)
# ----------------------------------------------
RPG::SE.stop
# Or ...
Audio.se_stop