Pre-title map(s)
Authors: Valdred
Version: 2.0
Type: Execute selected maps before the title screen
Key Term: Misc add-on
IntroductionMany people have requested a way to have one or more maps executed before the title screen so I decided to make this.
I guess it's mainly for cutscenes and stuff but it can be used for gameplay as well.
Features
- Fully featured maps before the title screen, made and set up just like other maps.
- Easy to use, I guess
ScreenshotsThe maps would look just like ordinary maps, no need for screenshots.
Script
#==============================================================================
# ** Maps before title
#------------------------------------------------------------------------------
# By Valdred
#------------------------------------------------------------------------------
# Having problems? Go to chaos-project.org or rmvxp.com
#==============================================================================
module Starting_Config #Set up players starting position BEFORE the title screen
Starting_map = 6 # id of starting map.
Starting_x = 7 # x-starting cordinate.
Starting_y = 7 # y-starting cordinate.
First_time_Only = true # Takes you to title if save file exist
end
#===============================================================================
# * Main Script
#===============================================================================
class Interpreter
def finish
$scene = Scene_Title.new
end
end
class Scene_Title
alias maps_before_title main
def main
# call battle test
if $BTEST
battle_test
return
end
if Starting_Config::First_time_Only
(0..3).each { |i|
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end}
end
if @continue_enabled
maps_before_title
elsif $maps_before_title_switch
maps_before_title
else
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# Make system object
$game_system = Game_System.new
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup(Starting_Config::Starting_map)
# Move player to initial position
$game_player.moveto(Starting_Config::Starting_x, Starting_Config::Starting_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Turns swith on
$maps_before_title_switch = true
# Sends you to the map
$scene = Scene_Map.new
end
end
end
Insert above main.
Instructions1. Put player starting position (you know, the square with an 's' inside) where you want the player to start
after the title screen.
2. Near the top of the script, you will find a configuration section.
Change '$starting_map' to the ID of the map you want the player to start at before the title. (the upper one of your maps got ID 1, the one bellow is ID 2 etc.) then change $starting_x and $starting_y
to the players starting position on the map. (to find out the cordinates of a spot, go to events-layer and click the spot. The cordinates will be in the bottom right of the editor)
3. When you want to proceed to the title screen. Use a 'script' event with this code:
CompatibilityWill probably not work with some scripts editing the title screen. That's all, I think.
Credits and Thanks
- Valdred for writing it
- Nathmatt for optimizing the code and adding a nice feature.
- Skaraflame and others for requesting it
Author's NotesIf you need help just tell, also if anyone feels like optimizing the script, just do it.
Awesome Script, now Masamune will make sense XD
Nice work, quick, simple and easy to use.
I just have one question... is "finnish" misspelled intentionally in both the script and instructions, or was that an accidental oversight? I noticed it actually defines "finnish" in the script. It might be better to clear this up now to avoid potential confusion.
This script is just what I needed, thanks + level up!
Just one flaw.. 'finnish' (I don't know what the finnish have to do with this) somehow doesn't send me to the menu, but to the first map. I'll be able to fix that if you don't, though.
I'm sure I made something like this (and probably some other persons also made it) in the script request section.
anyway. nice simple and short script:P
Just my bad spelling, sorry guys. I'll fix it. I'll fix the other bug too. It's just me being stupid :^_^':
EDIT: Fixed. Something that sucks with the current version is that no matter what you do, the starting map will be executed every time you open the game, most people will probably prefer if it's only executing first time. Next version, which will be coming up soon, will include an option to switch between "always" and "First time"
Quote from: Valdred on April 02, 2010, 02:34:26 pm
Just my bad spelling, sorry guys. I'll fix it. I'll fix the other bug too. It's just me being stupid :^_^':
EDIT: Fixed. Something that sucks with the current version is that no matter what you do, the starting map will be executed every time you open the game, most people will probably prefer if it's only executing first time. Next version, which will be coming up soon, will include an option to switch between "always" and "First time"
Well, I'd suggest just to have a paralell process that checks if the enter button / any other button is pressed, and if it is, it will execute "finish" and thus skip the intro.
For now, that's a good idea. But I still think I'll add the feature in the next version. (and also a skip feature, thanks for the idea :))
In my opinion. The less the user has to do, the better.
Quote from: Valdred on April 02, 2010, 03:09:30 pm
In my opinion. The less the user has to do, the better.
Absolutely!
was bored so here added the option for title to be called if there is a save file and where you call title through normal event call
if you alias Scene_Title there is no need to make a Scene_Title2
also if you have any questions on what i did feel free to pm me
module Valdred_Config
Starting_map = 1 # id of starting map.
Starting_x = 7 # x-starting cordinate.
Starting_y = 7 # y-starting cordinate.
Title = true # Takes you to title if save file exist
end
class Scene_Title
alias maps_before_title main
def main
# call battle test
if $BTEST
battle_test
return
end
if Valdred_Config::Title
(0..3).each { |i|
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end}
end
if @continue_enabled
maps_before_title
elsif $maps_before_title_switch
maps_before_title
else
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# Make system object
$game_system = Game_System.new
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup(Valdred_Config::Starting_map)
# Move player to initial position
$game_player.moveto(Valdred_Config::Starting_x, Valdred_Config::Starting_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Turns swith on
$maps_before_title_switch = true
# Sends you to the map
$scene = Scene_Map.new
end
end
end
This is great because I wanted to have a quick scene occur before the title and now I can.
After I put this in I made a map for a scene and it uses switches in it but everywhere a switch is used the game acts like the switch is always on.
If you turn on a switch, it will stay on until you turn it off. No matter what map they were used in.
No I know that I mean that the switches start out on on that map only; BEFORE I turn it on.
The switches is on by default? strange, but it can't be this script I think. This script doesn't do anything with $game_switches.
What other scripts are you using?
Not really my place to tell you, but the [XP] tag is on the wrong side of the subject title. That has to be right before it can be moved to the database.
Good job on the script, though. :naughty:
fixed
Hey It is Not Working!!! :\'( :\'( :\'( :\'( :\'( :\'(
EDIT: Please do not double-post within a 24 hour period, thank you. - Staff