Jump to content

Recommended Posts

Custom intro before title screen (everytime) V1.0

by Rbahamut


Introduction
This script will allow the user to setup an intro scene that will start each time the game is opened... can easily be skipped by the push of a button, whichever you prefer

Features
-Plug n Play
-Customizable ( if you know what to look for)
-Make a cutscene to introduce the game like... credit roll, or an action scene whatever


Screenshots- too much goin on for screenshots... please download the demo


How to Install
-place BOTH scripts under Materials, above Main Process in the correct order... the scripts are marked with (ABOVE) and (BELOW), so you really can't mess it up


Demo
V1.0 Without RTP http://www.mediafire...bok30hf379k497p


Scripts
ABOVE SCRIPT

 

#==============================================================================

# Rbahamut's Custom scene before title screen V1.0

#-----------------------------------------------------------------------------------------------------------------------------

# ABOVE SCRIPT

#------------------------------------------------------------------------------

# This module takes you to where the START POSITION MAP is...

# so wherever you want your scene to start you make it here

# this can be easily skipped by creating anywhere on the map,

# an event that runs in parallel process that has a conditional

# branch that will return to title screen when C button is pushed

# or whatever button you wanna use to skip to the title screen.

# * if you are using default key inputs C is bound to ENTER SPACE and Z

#==============================================================================

module SceneManager

#--------------------------------------------------------------------------

# * Execute

#--------------------------------------------------------------------------

def self.run

RPGDM.init

Audio.setup_midi if use_midi?

self.run_map

@scene.main while @scene

end

#--------------------------------------------------------------------------

# * Run Map

#--------------------------------------------------------------------------

def self.run_map

RPGDM.setup_new_game

$game_map.autoplay

SceneManager.goto(Scene_Map)

end

end

#==============================================================================

# ** DataManager

#------------------------------------------------------------------------------

# This module manages the database and game objects. Almost all of the

# global variables used by the game are initialized by this module.

#==============================================================================



module RPGDM

#--------------------------------------------------------------------------

# * Module Instance Variables

#--------------------------------------------------------------------------

@last_savefile_index = 0 # most recently accessed file

#--------------------------------------------------------------------------

# * Initialize Module

#--------------------------------------------------------------------------

def self.init

@last_savefile_index = 0

load_database

create_game_objects

setup_battle_test if $BTEST

end

#--------------------------------------------------------------------------

# * Load Database

#--------------------------------------------------------------------------

def self.load_database

if $BTEST

load_battle_test_database

else

load_normal_database

check_player_location

end

end

#--------------------------------------------------------------------------

# * Load Normal Database

#--------------------------------------------------------------------------

def self.load_normal_database

$data_actors = load_data("Data/Actors.rvdata2")

$data_classes = load_data("Data/Classes.rvdata2")

$data_skills = load_data("Data/Skills.rvdata2")

$data_items = load_data("Data/Items.rvdata2")

$data_weapons = load_data("Data/Weapons.rvdata2")

$data_armors = load_data("Data/Armors.rvdata2")

$data_enemies = load_data("Data/Enemies.rvdata2")

$data_troops = load_data("Data/Troops.rvdata2")

$data_states = load_data("Data/States.rvdata2")

$data_animations = load_data("Data/Animations.rvdata2")

$data_tilesets = load_data("Data/Tilesets.rvdata2")

$data_common_events = load_data("Data/CommonEvents.rvdata2")

$data_system = load_data("Data/System.rvdata2")

$data_mapinfos = load_data("Data/MapInfos.rvdata2")

end

#--------------------------------------------------------------------------

# * Load Battle Test Database

#--------------------------------------------------------------------------

def self.load_battle_test_database

$data_actors = load_data("Data/BT_Actors.rvdata2")

$data_classes = load_data("Data/BT_Classes.rvdata2")

$data_skills = load_data("Data/BT_Skills.rvdata2")

$data_items = load_data("Data/BT_Items.rvdata2")

$data_weapons = load_data("Data/BT_Weapons.rvdata2")

$data_armors = load_data("Data/BT_Armors.rvdata2")

$data_enemies = load_data("Data/BT_Enemies.rvdata2")

$data_troops = load_data("Data/BT_Troops.rvdata2")

$data_states = load_data("Data/BT_States.rvdata2")

$data_animations = load_data("Data/BT_Animations.rvdata2")

$data_tilesets = load_data("Data/BT_Tilesets.rvdata2")

$data_common_events = load_data("Data/BT_CommonEvents.rvdata2")

$data_system = load_data("Data/BT_System.rvdata2")

end

#--------------------------------------------------------------------------

# * Check Player Start Location Existence

#--------------------------------------------------------------------------

def self.check_player_location

if $data_system.start_map_id == 0

msgbox(Vocab::PlayerPosError)

exit

end

end

#--------------------------------------------------------------------------

# * Create Game Objects

#--------------------------------------------------------------------------

def self.create_game_objects

$game_temp = Game_Temp.new

$game_system = Game_System.new

$game_timer = Game_Timer.new

$game_message = Game_Message.new

$game_switches = Game_Switches.new

$game_variables = Game_Variables.new

$game_self_switches = Game_SelfSwitches.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

end

#--------------------------------------------------------------------------

# * Set Up New Game

#--------------------------------------------------------------------------

def self.setup_new_game

create_game_objects

$game_party.setup_starting_members

$game_map.setup($data_system.start_map_id)

$game_player.moveto($data_system.start_x, $data_system.start_y)

$game_player.refresh

Graphics.frame_count = 0

end

#--------------------------------------------------------------------------

# * Set Up Battle Test

#--------------------------------------------------------------------------

def self.setup_battle_test

$game_party.setup_battle_test

BattleManager.setup($data_system.test_troop_id)

BattleManager.play_battle_bgm

end

#--------------------------------------------------------------------------

# * Determine Existence of Save File

#--------------------------------------------------------------------------

def self.save_file_exists?

!Dir.glob('Save*.rvdata2').empty?

end

#--------------------------------------------------------------------------

# * Maximum Number of Save Files

#--------------------------------------------------------------------------

def self.savefile_max

return 16

end

#--------------------------------------------------------------------------

# * Create Filename

# index : File Index

#--------------------------------------------------------------------------

def self.make_filename(index)

sprintf("Save%02d.rvdata2", index + 1)

end

#--------------------------------------------------------------------------

# * Execute Save

#--------------------------------------------------------------------------

def self.save_game(index)

begin

save_game_without_rescue(index)

rescue

delete_save_file(index)

false

end

end

#--------------------------------------------------------------------------

# * Execute Load

#--------------------------------------------------------------------------

def self.load_game(index)

load_game_without_rescue(index) rescue false

end

#--------------------------------------------------------------------------

# * Load Save Header

#--------------------------------------------------------------------------

def self.load_header(index)

load_header_without_rescue(index) rescue nil

end

#--------------------------------------------------------------------------

# * Execute Save (No Exception Processing)

#--------------------------------------------------------------------------

def self.save_game_without_rescue(index)

File.open(make_filename(index), "wb") do |file|

$game_system.on_before_save

Marshal.dump(make_save_header, file)

Marshal.dump(make_save_contents, file)

@last_savefile_index = index

end

return true

end

#--------------------------------------------------------------------------

# * Execute Load (No Exception Processing)

#--------------------------------------------------------------------------

def self.load_game_without_rescue(index)

File.open(make_filename(index), "rb") do |file|

Marshal.load(file)

extract_save_contents(Marshal.load(file))

reload_map_if_updated

@last_savefile_index = index

end

return true

end

#--------------------------------------------------------------------------

# * Load Save Header (No Exception Processing)

#--------------------------------------------------------------------------

def self.load_header_without_rescue(index)

File.open(make_filename(index), "rb") do |file|

return Marshal.load(file)

end

return nil

end

#--------------------------------------------------------------------------

# * Delete Save File

#--------------------------------------------------------------------------

def self.delete_save_file(index)

File.delete(make_filename(index)) rescue nil

end

#--------------------------------------------------------------------------

# * Create Save Header

#--------------------------------------------------------------------------

def self.make_save_header

header = {}

header[:characters] = $game_party.characters_for_savefile

header[:playtime_s] = $game_system.playtime_s

header

end

#--------------------------------------------------------------------------

# * Create Save Contents

#--------------------------------------------------------------------------

def self.make_save_contents

contents = {}

contents[:system] = $game_system

contents[:timer] = $game_timer

contents[:message] = $game_message

contents[:switches] = $game_switches

contents[:variables] = $game_variables

contents[:self_switches] = $game_self_switches

contents[:actors] = $game_actors

contents[:party] = $game_party

contents[:troop] = $game_troop

contents[:map] = $game_map

contents[:player] = $game_player

contents

end

#--------------------------------------------------------------------------

# * Extract Save Contents

#--------------------------------------------------------------------------

def self.extract_save_contents(contents)

$game_system = contents[:system]

$game_timer = contents[:timer]

$game_message = contents[:message]

$game_switches = contents[:switches]

$game_variables = contents[:variables]

$game_self_switches = contents[:self_switches]

$game_actors = contents[:actors]

$game_party = contents[:party]

$game_troop = contents[:troop]

$game_map = contents[:map]

$game_player = contents[:player]

end

#--------------------------------------------------------------------------

# * Reload Map if Data Is Updated

#--------------------------------------------------------------------------

def self.reload_map_if_updated

if $game_system.version_id != $data_system.version_id

$game_map.setup($game_map.map_id)

$game_player.center($game_player.x, $game_player.y)

$game_player.make_encounter_count

end

end

#--------------------------------------------------------------------------

# * Get Update Date of Save File

#--------------------------------------------------------------------------

def self.savefile_time_stamp(index)

File.mtime(make_filename(index)) rescue Time.at(0)

end

#--------------------------------------------------------------------------

# * Get File Index with Latest Update Date

#--------------------------------------------------------------------------

def self.latest_savefile_index

savefile_max.times.max_by {|i| savefile_time_stamp(i) }

end

#--------------------------------------------------------------------------

# * Get Index of File Most Recently Accessed

#--------------------------------------------------------------------------

def self.last_savefile_index

@last_savefile_index

end

end

 


BELOW SCRIPT

 

#==============================================================================

# Rbahamut's Custom start after title screen V1.0

#-----------------------------------------------------------------------------------------------------------------------------

# BELOW SCRIPT

#------------------------------------------------------------------------------

# This script makes the title screen take you to the start of your game which is different from the

# players start position... you need to know the MAP ID and x, y coords to say where you want

# your actor/s to start when selecting NEW GAME from title screen, those places are marked with

# #COMMENT and located at end of script

#==============================================================================



class Scene_Title < Scene_Base

#--------------------------------------------------------------------------

# * Start Processing

#--------------------------------------------------------------------------

def start

super

SceneManager.clear

Graphics.freeze

create_background

create_foreground

create_command_window

play_title_music

end

#--------------------------------------------------------------------------

# * Get Transition Speed

#--------------------------------------------------------------------------

def transition_speed

return 20

end

#--------------------------------------------------------------------------

# * Termination Processing

#--------------------------------------------------------------------------

def terminate

super

SceneManager.snapshot_for_background

dispose_background

dispose_foreground

end

#--------------------------------------------------------------------------

# * Create Background

#--------------------------------------------------------------------------

def create_background

@sprite1 = Sprite.new

@sprite1.bitmap = Cache.title1($data_system.title1_name)

@sprite2 = Sprite.new

@sprite2.bitmap = Cache.title2($data_system.title2_name)

center_sprite(@sprite1)

center_sprite(@sprite2)

end

#--------------------------------------------------------------------------

# * Create Foreground

#--------------------------------------------------------------------------

def create_foreground

@foreground_sprite = Sprite.new

@foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)

@foreground_sprite.z = 100

draw_game_title if $data_system.opt_draw_title

end

#--------------------------------------------------------------------------

# * Draw Game Title

#--------------------------------------------------------------------------

def draw_game_title

@foreground_sprite.bitmap.font.size = 48

rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)

@foreground_sprite.bitmap.draw_text(rect, $data_system.game_title, 1)

end

#--------------------------------------------------------------------------

# * Free Background

#--------------------------------------------------------------------------

def dispose_background

@sprite1.bitmap.dispose

@sprite1.dispose

@sprite2.bitmap.dispose

@sprite2.dispose

end

#--------------------------------------------------------------------------

# * Free Foreground

#--------------------------------------------------------------------------

def dispose_foreground

@foreground_sprite.bitmap.dispose

@foreground_sprite.dispose

end

#--------------------------------------------------------------------------

# * Move Sprite to Screen Center

#--------------------------------------------------------------------------

def center_sprite(sprite)

sprite.ox = sprite.bitmap.width / 2

sprite.oy = sprite.bitmap.height / 2

sprite.x = Graphics.width / 2

sprite.y = Graphics.height / 2

end

#--------------------------------------------------------------------------

# * Create Command Window

#--------------------------------------------------------------------------

def create_command_window

@command_window = Window_TitleCommand.new

@command_window.set_handler(:new_game, method(:command_new_game))

@command_window.set_handler(:continue, method(:command_continue))

@command_window.set_handler(:shutdown, method(:command_shutdown))

end



#--------------------------------------------------------------------------

# * Close Command Window

#--------------------------------------------------------------------------

def close_command_window

@command_window.close

update until @command_window.close?

end

#--------------------------------------------------------------------------

# * [New Game] Command

#--------------------------------------------------------------------------

def command_new_game

DataManager.setup_new_game

close_command_window

fadeout_all

$game_map.autoplay

SceneManager.goto(Scene_Map)

end

#--------------------------------------------------------------------------

# * [Continue] Command

#--------------------------------------------------------------------------

def command_continue

close_command_window

SceneManager.call(Scene_Load)

end

#--------------------------------------------------------------------------

# * [shut Down] Command

#--------------------------------------------------------------------------

def command_shutdown

close_command_window

fadeout_all

SceneManager.exit

end

#--------------------------------------------------------------------------

# * Play Title Screen Music

#--------------------------------------------------------------------------

def play_title_music

$data_system.title_bgm.play

RPG::BGS.stop

RPG::ME.stop

end

end

#==============================================================================

# ** DataManager

#------------------------------------------------------------------------------

# This module manages the database and game objects. Almost all of the

# global variables used by the game are initialized by this module.

#==============================================================================



module DataManager

#--------------------------------------------------------------------------

# * Module Instance Variables

#--------------------------------------------------------------------------

@last_savefile_index = 0 # most recently accessed file

#--------------------------------------------------------------------------

# * Initialize Module

#--------------------------------------------------------------------------

def self.init

@last_savefile_index = 0

load_database

create_game_objects

setup_battle_test if $BTEST

end

#--------------------------------------------------------------------------

# * Set Up New Game

#--------------------------------------------------------------------------

def self.setup_new_game

create_game_objects

$game_party.setup_starting_members

$game_map.setup(3) # this is where u choose which map u want the new game to start on (map_id)

$game_player.moveto(22, 14) # This is where u put in the coords of the map u want the new game to start on (x, y)

$game_player.refresh

Graphics.frame_count = 0

end

end

 


FAQ

Q: Where do I input the player start event?
A: On the map that you want to use as your opening before title scene!

Q: Then where does my new game start?
A: On whatever map ID and coords you specified in the below script

Q: The opening scene is not skipping when pushing C on my keyboard?!?!?!
A: The C input in the game is keybound to Z, Spacebar, and Enter, its the default "confirm button"

Q: I am pressing the Z and enter and everything but my opening wont skip, what gives?
A: You gotta make sure the event, like in my demo, is on a paralell process, I have firsthand experience that the first time loading
the game that it may not skip but should after you get it the first time..

Credit and Thanks
To boredom and my lil bro for asking how this could be accomplished...

Author's Notes
Make sure to have your opening scene have the dialog end with "\^" so that you don't need to interact with the dialog boxes in order to proceed with the scene and have the scene eventually end and send you to the title screen in case bashing the skip button doesn't work or you start the game and hit the bathroom and wanna come back to it ready to go. Have fun lemme know if you have any problems!

Edited by rbahamut

Share this post


Link to post
Share on other sites

Uhh... I've found an incompatibility with this.

The bottom script is fine, but the top one makes incompatibility with Yanfly's Class System and Yanfly's Slippery Tiles.

Is there a way to patch 'em up...? They don't like each other, and they cause errors.

 

Yanfly's Class System causes a Can't Clone NilClass.

For the Slippery Tiles one, the error message is "undefined method `include?' for nil:NilClass.

 

Of course, I don't really mind if it can't be done, but I'd really like to use these things in my game!

Thanks if you can fix it. :3

Share this post


Link to post
Share on other sites

rbahamut question for you. It took some time for me to get this to work correctly and now it is mostly working except it wants to show the scrolling text at the beginning no matter what. If I press the key to skip it will wait til the scrolling script is done and then switch to the title screen. Any ideas?

Share this post


Link to post
Share on other sites

It should go to title no matter what is goin on... Make sure the skip event is runnin in parallel and the texts do not require the player to hit a button to continue. If all else fails try changing the button to skip. I havent run into this problem myself yet but also havent played in a while do to work and college... Still owe anderson a compatability patch. Lemme know if u fix it

Share this post


Link to post
Share on other sites

Anderson88, after many hours of tweaking and trying to figure out wtf is going wrong with the compatibility, I have determined that my script and yanflys are using the same methods... but I am not advanced enough using ruby code to figure out how the hell to fix it... i only seem to have made more errors it seems.. I will contact yanfly and see if it can be fixed or they just incompatible period.. sorry for the wait

Share this post


Link to post
Share on other sites

RBahamut checking in to see if you have figured out a compatability with Yanfly's system yet. Trying to make a Shining Force - esque game and his Equip Engine along with Kread's Actor Inventory seem to be the only way to accomplish the 4 items per actor in battle issue. Hope there can be something figured out.

Share this post


Link to post
Share on other sites

Hey adogbiscuit, ok here are the steps on how to use it,

 

Step 1: Create ur starting map that has the intro events etc, make sure to place the Player Start on that map.

 

Step 2: Place in the below script the map id (ex: 2) and coordinates (ex: 1, 5) of where you want to be teleported to after the intro is over and NEW GAME is selected from the title screen, if you CONTINUE from a save the player will be where ever you saved.

 

I do have a demo available above that you can download and see how i ran the events and which map is which to get a better feel. Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×