Nicke 150 Posted January 3, 2012 (edited) Title Version: 1.1 Introduction My first script ported for Ace, hope you enjoy it! You can now easily setup your title scene with new commands, skip to map instantly etc and some other neat features is included as well. Features Easy to use and install. Simple to change the option of the command window as well as add new items to it. The ability to specify a range of switches to be turned on when new game is called. The option to skip to the map instantly. Run a common event when starting a new game. The option to have a icon displayed next to the title command. Fade in animation for the window and icons. And more! Screenshots How to Use Instructions how to use it can be find inside the script. To install this script, open up your script editor and copy/paste this script to an open slot below Materials but above Main. Remember to save. Main Script #============================================================================== # XaiL System - Title # Author: Nicke # Created: 02/01/2012 # Edited: 17/01/2012 # Version: 1.1b #============================================================================== # Instructions # ----------------------------------------------------------------------------- # To install this script, open up your script editor and copy/paste this script # to an open slot below â–¼ Materials but above â–¼ Main. Remember to save. # # No need for explaining, just a simple title scene with a few settings. # # *** Only for RPG Maker VX Ace. *** #============================================================================== ($imported ||= {})["XAIL-XS-TITLE"] = true module XAIL module TITLE #--------------------------------------------------------------------------# # * Settings #--------------------------------------------------------------------------# # title list, the icon_index (set to nil) and custom_scene is optional. # TITLE_LIST: # ID = ['Title', :symbol, :command, icon_index, custom_scene (not needed) ] TITLE_LIST = [] TITLE_LIST[0] = ['New Game', :new_game, :command_new_game, 301] TITLE_LIST[1] = ['Options', :options, :command_custom, 302, Scene_Title] TITLE_LIST[2] = ['Credits', :credits, :command_custom, 303, Scene_Title] TITLE_LIST[3] = ['Load', :continue, :command_continue, 304] TITLE_LIST[4] = ['Quit', :shutdown, :command_shutdown, 305] # If center window is true you cannot modify the x value. # TITLE_WINDOW [ Width, x, y, z, opacity, center window] TITLE_WINDOW = [160, 0, 150, 200, 255, true] # Title logo. Set nil to use default. # TITLE_LOGO = [ x, y, size, color, bold, shadow ] TITLE_LOGO = [0, 0, 48, Colors::LightGreen, true, false] # TITLE_ALIGNMENT = 0 (left), 1 (center), 2 (right) TITLE_ALIGNMENT = 1 # Default: 0. # The windowskin to use for the windows. # nil to disable. # SKIN = string SKIN = nil # Disable all of the icons if you don't need them. # ICON_ENABLE = true/false ICON_ENABLE = true # Transition, nil to use default. # TRANSITION [ SPEED, TRANSITION, OPACITY ] # TRANSITION = [40, "Graphics/Transitions/1", 50] TRANSITION = nil # Animate options. # Set ANIM_WINDOW_TIMER to nil to disable. ANIM_WINDOW_TIMER = 20 # Fade in time for window/icons. ANIM_SCENE_FADE = 1000 # Fade out time for scene. Default: 1000. ANIM_AUDIO_FADE = 1000 # Fade out time for audio. Default: 1000. # Switches enabled from start. # Set to nil to disable. # SWITCHES = [sWITCH_ID] SWITCHES = [1] # Run a common event on startup? # COMMON_EVENT = COMMON_EVENT_ID COMMON_EVENT = 1 # Skip title. (Only in test mode) SKIP = false end end # *** Don't edit below unless you know what you are doing. *** #============================================================================== # ** Window_TitleCommand #============================================================================== class Window_TitleCommand < Window_Command def window_width # // Method to return the width of TITLE_WINDOW. return XAIL::TITLE::TITLE_WINDOW[0] end def alignment # // Method to return the alignment. return XAIL::TITLE::TITLE_ALIGNMENT end def make_command_list # // Method to add the commands. for i in XAIL::TITLE::TITLE_LIST case i[1] when :continue # Load add_command(i[0], i[1], continue_enabled, i[4]) else add_command(i[0], i[1], true, i[4]) end end end end #==============================================================================# # ** Scene_Title #------------------------------------------------------------------------------ # New Scene :: Scene_Title #==============================================================================# class Scene_Title < Scene_Base alias xail_title_main main def main(*args, &block) # // Method main. command_new_game(true) if XAIL::TITLE::SKIP && $TEST && !$BTEST return if XAIL::TITLE::SKIP && $TEST && !$BTEST xail_title_main(*args, &block) end alias xail_title_start start def start(*args, &block) # // Method to start the scene. super xail_title_start(*args, &block) create_title_icon_window create_title_command_window end def terminate # // Method to terminate. super end def create_title_command_window # // Method to create the commands. @command_window = Window_TitleCommand.new @command_window.windowskin = Cache.system(XAIL::TITLE::SKIN) unless XAIL::TITLE::SKIN.nil? if XAIL::TITLE::TITLE_WINDOW[5] @command_window.x = (Graphics.width - @command_window.width) / 2 else @command_window.x = XAIL::TITLE::TITLE_WINDOW[1] end @command_window.y = XAIL::TITLE::TITLE_WINDOW[2] @command_window.z = XAIL::TITLE::TITLE_WINDOW[3] @command_window.opacity = XAIL::TITLE::TITLE_WINDOW[4] for i in XAIL::TITLE::TITLE_LIST @command_window.set_handler(i[1], method(i[2])) end pre_animate_in(@command_window) unless XAIL::TITLE::ANIM_WINDOW_TIMER.nil? end def create_title_icon_window # // Method to create the menu icon window. @command_icon = Window_Icon.new(0, 0, @command_window.width, XAIL::TITLE::TITLE_LIST.size) @command_icon.alignment = XAIL::TITLE::TITLE_ALIGNMENT @command_icon.enabled = XAIL::TITLE::ICON_ENABLE @command_icon.draw_cmd_icons(XAIL::TITLE::TITLE_LIST, 3) if XAIL::TITLE::TITLE_WINDOW[5] @command_icon.x = (Graphics.width - @command_window.width) / 2 else @command_icon.x = XAIL::TITLE::TITLE_WINDOW[1] end @command_icon.y = XAIL::TITLE::TITLE_WINDOW[2] @command_icon.z = 201 @command_icon.opacity = 255 pre_animate_in(@command_icon) unless XAIL::TITLE::ANIM_WINDOW_TIMER.nil? end def pre_animate_in(command) # // Method for pre_animate the window. command.opacity -= 255 command.contents_opacity -= 255 end def fade_animate(command, fade) # // Method for fading in/out. timer = XAIL::TITLE::ANIM_WINDOW_TIMER while timer > 0 Graphics.update case fade when :fade_in command.opacity += 255 / XAIL::TITLE::ANIM_WINDOW_TIMER unless command == @command_icon command.contents_opacity += 255 / XAIL::TITLE::ANIM_WINDOW_TIMER when :fade_out command.opacity -= 255 / XAIL::TITLE::ANIM_WINDOW_TIMER unless command == @command_icon command.contents_opacity -= 255 / XAIL::TITLE::ANIM_WINDOW_TIMER end command.update timer -= 1 end end def post_start # // Method for post_start. super unless XAIL::TITLE::ANIM_WINDOW_TIMER.nil? fade_animate(@command_window, :fade_in) fade_animate(@command_icon, :fade_in) end end def close_command_window # // Method for close_command_window. unless XAIL::TITLE::ANIM_WINDOW_TIMER.nil? fade_animate(@command_icon, :fade_out) fade_animate(@command_window, :fade_out) end end def fadeout_scene time = XAIL::TITLE::ANIM_AUDIO_FADE # // Method to fade out the scene. RPG::BGM.fade(time) RPG::BGS.fade(time) RPG::ME.fade(time) Graphics.fadeout(XAIL::TITLE::ANIM_SCENE_FADE * Graphics.frame_rate / 1000) RPG::BGM.stop RPG::BGS.stop RPG::ME.stop end def command_new_game(skip = false) # // Method to call new game. DataManager.setup_new_game if skip SceneManager.clear DataManager.load_database SceneManager.call(Scene_Map) end if !skip close_command_window fadeout_scene end $game_map.autoplay if !XAIL::TITLE::SWITCHES.nil? for i in XAIL::TITLE::SWITCHES $game_switches[i] = true end end if !XAIL::TITLE::COMMON_EVENT.nil? $game_temp.reserve_common_event(XAIL::TITLE::COMMON_EVENT) end SceneManager.goto(Scene_Map) if !skip end def command_continue # // Method to call load. close_command_window SceneManager.call(Scene_Load) end def command_shutdown # // Method to call shutdown. close_command_window fadeout_scene SceneManager.exit end def command_custom # // Method to call a custom command. SceneManager.goto(@command_window.current_ext) end alias xail_title_draw_game_title draw_game_title def draw_game_title(*args, &block) if !XAIL::TITLE::TITLE_LOGO.nil? rect = Rect.new(XAIL::TITLE::TITLE_LOGO[0], XAIL::TITLE::TITLE_LOGO[1], Graphics.width, Graphics.height / 2) @foreground_sprite.bitmap.font.size = XAIL::TITLE::TITLE_LOGO[2] @foreground_sprite.bitmap.font.color = XAIL::TITLE::TITLE_LOGO[3] @foreground_sprite.bitmap.font.bold = XAIL::TITLE::TITLE_LOGO[4] @foreground_sprite.bitmap.font.shadow = XAIL::TITLE::TITLE_LOGO[5] end xail_title_draw_game_title(*args, &block) end def perform_transition # // Method to perform a transition. if XAIL::TITLE::TRANSITION.nil? Graphics.transition(15) else Graphics.transition(XAIL::TITLE::TRANSITION[0],XAIL::TITLE::TRANSITION[1],XAIL::TITLE::TRANSITION[2]) end end end # END OF FILE #=*==========================================================================*=# # ** END OF FILE #=*==========================================================================*=# Core Script Get it here. Updates Latest: Another minor update fixing a small issues and implementing a newer version of the Core script. A minor update to allow changing the position of the logo text as well as changing your windowskin. The script now requires my core script too so make sure you have above this script. Version 1.1 is here! Added alot of new features as well as optimized the script. Released version 1.0a: Small update that fixes a few bugs. Added the ability to run a common event upon starting a new game. Credit Do credit me, Nicke, if you are planing on using this script. Thanks. Can be use in a commercial project. Edited January 17, 2012 by Niclas 1 Barthmaeus reacted to this Share this post Link to post Share on other sites
Nicke 150 Posted January 4, 2012 Small edit, you can now run a common event upon starting a new game. 1 Rosenblack reacted to this Share this post Link to post Share on other sites
Nicke 150 Posted January 6, 2012 Updated to version 1.0a. Share this post Link to post Share on other sites
Rosenblack 79 Posted January 6, 2012 (edited) nice, its updated. Edited January 6, 2012 by Rosenblack Share this post Link to post Share on other sites
Rukiri 28 Posted January 6, 2012 Advice, use the Credits command inside the Options command, but simple script man. Share this post Link to post Share on other sites
Nicke 150 Posted January 7, 2012 (edited) @Rosenblack: Yeah I've updated it again too @Rukiri: Why do you want Credits inside the option command? Thanks anyways. Okay guys, I've updated this again. This time you get alot of new neat features as well as made it easier adding commands etc. Edited January 7, 2012 by Niclas 1 Rosenblack reacted to this Share this post Link to post Share on other sites
Knightmare 170 Posted January 7, 2012 Do I get that scrumptious looking piece of cheese if I start a New Game? Oh and nice script too. Could be useful for a tutorial option, or a story option. Share this post Link to post Share on other sites
Nicke 150 Posted January 7, 2012 @Knightmare: Yeah you will be e-mailed a neat little cheese when you press new game. Nah but thanks for the feedback. 1 Rosenblack reacted to this Share this post Link to post Share on other sites
Rosenblack 79 Posted January 12, 2012 hey, can you add the custom windowskin option skin to this as well (sorry my request to this is later thatn my one to your menu system but my computer is broken) Share this post Link to post Share on other sites
Nicke 150 Posted January 12, 2012 @Rosenblack: Added. Share this post Link to post Share on other sites
Rosenblack 79 Posted January 12, 2012 Thanks Niclas, you are becoming one of my fav coders!!! Share this post Link to post Share on other sites
Rinku 3 Posted March 18, 2012 (edited) How compatible is this script with MOG Scene File A and Advanced Load Bar?? I ran all, but the background graphics didn't appear for the Scene File nor the Advanced Load Bar. (It also crashed afterwards, but that could be due to so many other scripts present). Just curious about the compatibility I asked. Edited March 18, 2012 by Rinku Share this post Link to post Share on other sites
Nicke 150 Posted March 30, 2012 @Rinku: If it indeed crashed as you said it might be a compability issue but you will know for sure if you try this script with those script you said in a new project (without any extra scripts added). Share this post Link to post Share on other sites
Kirin 37 Posted March 30, 2012 (edited) Getting this error when trying to open playtest: Using a bunch of other scripts though, most of them Yanfly's, might be the reason. Edit: Same error in a new project, so definitely an error in the script. Edited March 30, 2012 by Kirin Share this post Link to post Share on other sites
Pikakapi 4 Posted March 30, 2012 Did you include the XaiL Core Script, Kirin? Anyway, I was looking for this script. Great work Niclas. This could make more new chapters for the game. Share this post Link to post Share on other sites
Kirin 37 Posted March 30, 2012 (edited) Guh. Derp moment. Trying it now. Watch this post for updates. Edit: Thanks, it works now. Was having a major derp moment since I've used this script before a little while back, but forgot about the Core script. >_> Edited March 30, 2012 by Kirin Share this post Link to post Share on other sites
Ehren Rivers 14 Posted March 30, 2012 Hmm. I may be missing something, but 'Credits' and 'Options' just take me back to the title screen? There's nothing in the script instructions about changing these things, so I'm not really sure what to do. I'm relatively new to scripting, so it would be helpful if you could give me instructions on how to do these things. As for Credits, does this require a separate script or enough knowledge of scripting to create your own scene windows? Whatever help you can give is appreciated. Share this post Link to post Share on other sites
Kirin 37 Posted March 31, 2012 The Options and Credits options are technically custom commands, and they aren't included with the script. You'll need a separate script or be good at eventing to be able to implement those options. I've managed to implement Yanfly's System Options script on my project, for the Options command. Share this post Link to post Share on other sites
Ehren Rivers 14 Posted March 31, 2012 I've managed to implement Yanfly's System Options script on my project, for the Options command. Hmmm. Well, is there any way you could explain how to get that to work or PM me the bit of script you used? I'm currently using Yanfly's System Options too, actually. I suppose I'll have to look around for a credits script, or maybe even request one. Hmmm. This looks good though, I absolutely LOE the ability to add icons to my options! Share this post Link to post Share on other sites
Kirin 37 Posted March 31, 2012 (edited) It's really simple. First of all, you place this title script under Yanfly's System Options script. Then, find this line in the title script: TITLE_LIST[1] = ['Options', :options, :command_custom, 302, Scene_Title] Change Scene_Title to Scene_System. It should look like this now: TITLE_LIST[1] = ['Options', :options, :command_custom, 302, Scene_System] Then go down near the bottom of the title script and look for this block of code: def command_custom # // Method to call a custom command. SceneManager.goto(@command_window.current_ext) end Change SceneManager.goto to SceneManager.call. It should look like this now: def command_custom # // Method to call a custom command. SceneManager.call(@command_window.current_ext) end And we're done. Edited March 31, 2012 by Kirin Share this post Link to post Share on other sites
Ehren Rivers 14 Posted March 31, 2012 Ahhh, I see. That helps a lot, thank you! So Scene_System is the class for the YSO script, and Simple Title has to be "below" it in order to recognize that scene as existing? It works like a charm, I'very greatful for this. Share this post Link to post Share on other sites
Nicke 150 Posted March 31, 2012 @Kirin: You don't actually need to change SceneManager.goto to SceneManager.call. It will change the scene either way. SceneManager.call is just another command to stack up the scenes in an array. Share this post Link to post Share on other sites
Kirin 37 Posted March 31, 2012 Well, when I tried it without changing that, trying to exit the options screen shuts my game down completely. xD So I can enter the Options screen, but when I try to leave it, it just shuts down, no error message or anything. I had to ask for help in the IRC and it was IceDragon who told me the fix was to change goto to call. So yes, it changes the scene either way. I DO get to the Options screen. The problem is getting BACK to the Title Screen. xD Share this post Link to post Share on other sites
Nicke 150 Posted March 31, 2012 (edited) @Kirin: Then you could check the return_scene command in your option script. I noticed on your script too that there is a symbol (:to_title) for it to return to the title scene, you might wanna try and use that. But I guess, if it works with call you can probably use that instead. Edited March 31, 2012 by Niclas Share this post Link to post Share on other sites
Kirin 37 Posted March 31, 2012 What I wanted was to have the Options script be accessible both from the title screen and the menu when ingame. If I change the options script so it's Cancel button returns me to the Title screen, I can't use it in the menu, and if I leave it as return_scene it shutdowns the game when I try to cancel after accessing it from the Title menu. There is a To Title command in the Options script, but to make it work I'll have to disable Cancel when accessing the Options script from the Title and enable it when accessing it from the menu, which I don't know how to do since I can't script. So yeah, the simplest solution for me is to have it be a call rather than a goto. ^^" Share this post Link to post Share on other sites