Author Topic: [XP] Title Skip if no Saves  (Read 11249 times)

Offline Nortos

  • Has earned a custom title
  • Chaos User
  • ******
  • Posts: 1303
  • LV: 20
  • Gender: Male
  • Celestial Bomb my Digital Ass
    • View Profile
[XP] Title Skip if no Saves
« on: January 20, 2008, 10:27:29 AM »
Title Skip if no Saves
Authors: Nortos
Version: 1
Type: Scene_Title
Key Term: Title / Save / Load / GameOver Add-on

Introduction
Ever wanted to be able to have the player skip the title scene like certain games if it's the first time they've played it or there is no saves? Well now you can!

Features

  • Title scene skip if no data

Screenshots
Screenshots not needed as there wouldn't be anything to show

Demo
Not needed as only a small script

Script
(click to show/hide)

Instructions

Just place above main and other custom scripts and below Scene_Debug

Compatibility Issues

None that I can think of

Credits and Thanks

  • Credit goes to Nortos
  • Special thanks to Fantasist, Blizzard and Zeriab being my main inspiration and teachers

Author's Notes

« Last Edit: February 21, 2009, 12:56:55 PM by Blizzard »
(click to show/hide)
Nortos's Stealth System
UltaFlame's Storyline Service
Blizz ABS - The Ultimate ABS!
My Resources

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Title Skip if no Saves
« Reply #1 on: January 20, 2008, 03:23:30 PM »
If you made that aliased, you could make it have like less than 50 lines of code. ^_^
BTW, here's a nice hint:

If you removed the methods that you didn't edit from your script and tell the users to put this extra below Scene_Title, you will both lose in number of coded lines and get in compatibility and easies deinstallation of your script.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: Title Skip if no Saves
« Reply #2 on: January 20, 2008, 08:14:30 PM »
Unless I'm wrong, the only method that's modified is main, right? If that's the case, to alias the script, you need to perform the check for savefiles yourself, right? Like this:

alias main_title_skip main
def main
  cont_enabled = (0..3).any? {|i| FileTest.exist?('Save' + (i+1).to_s)}
  cont_enabled ? main_title_skip : command_new_game
end
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Title Skip if no Saves
« Reply #3 on: January 20, 2008, 08:48:07 PM »
You just got owned, Nortos. >.< I WILL TAKE REVENGE FOR YOU!

Code: [Select]
alias main_title_skip main
def main
  ((0..3).any? {|i| FileTest.exist?("Save{i+1}".rxdata)}) ? main_title_skip : command_new_game
end
« Last Edit: January 20, 2008, 08:48:46 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: Title Skip if no Saves
« Reply #4 on: January 20, 2008, 08:56:25 PM »
Aw, that was not my intension, lol! But yeah, I just missed the extension :P

I was talking more to myself and half asking you, because I always wondered how to alias something in main and I answered myself.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Nortos

  • Has earned a custom title
  • Chaos User
  • ******
  • Posts: 1303
  • LV: 20
  • Gender: Male
  • Celestial Bomb my Digital Ass
    • View Profile
Re: Title Skip if no Saves
« Reply #5 on: January 21, 2008, 01:46:24 AM »
:P I hadn't thought it out...was a 2minute script before went to bed lol
(click to show/hide)
Nortos's Stealth System
UltaFlame's Storyline Service
Blizz ABS - The Ultimate ABS!
My Resources

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Title Skip if no Saves
« Reply #6 on: January 21, 2008, 02:07:45 AM »
Maybe you didn't get owned by FTS after all... Anyway, I shortened it by 1 line and fixed a bug, so I win. *adds 1 energy to self*

...

*or not...* ._.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Nortos

  • Has earned a custom title
  • Chaos User
  • ******
  • Posts: 1303
  • LV: 20
  • Gender: Male
  • Celestial Bomb my Digital Ass
    • View Profile
Re: Title Skip if no Saves
« Reply #7 on: January 21, 2008, 02:11:00 AM »
:P I would but it wasn't much effort would rather save it for when 1.9 abs released or ur quest scene. But anyway ty for fix :)
(click to show/hide)
Nortos's Stealth System
UltaFlame's Storyline Service
Blizz ABS - The Ultimate ABS!
My Resources

FlyingHamsta

  • Guest
Re: [XP] Title Skip if no Saves
« Reply #8 on: August 14, 2008, 09:50:08 AM »
Sorry for bumping a very old post, but I recently found the title skip script by Blizzard and would like to use it, but I don't understand where I'm supposed to place this 'alias' code.

Anyone care to enlighten me?  =]

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: [XP] Title Skip if no Saves
« Reply #9 on: August 14, 2008, 11:53:21 AM »
You mean this:
Code: [Select]
alias main_title_skip main
def main
  ((0..3).any? {|i| FileTest.exist?("Save{i+1}".rxdata)}) ? main_title_skip : command_new_game
end

You need to add two more lines at the top and bottom, so your code looks like this:
Code: [Select]
class Scene_Title
alias main_title_skip main
def main
  ((0..3).any? {|i| FileTest.exist?("Save{i+1}".rxdata)}) ? main_title_skip : command_new_game
end
end

Now paste this just above main.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Title Skip if no Saves
« Reply #10 on: August 14, 2008, 12:37:15 PM »
FTS, Tons? >:3

It should be like this, BTW:

Code: [Select]
class Scene_Title
  alias main_title_skip main
  def main
    $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')
    $game_system = Game_System.new
    ((0..3).any? {|i| FileTest.exist?("Save#{i+1}.rxdata")}) ? main_title_skip : command_new_game
  end
end
« Last Edit: August 14, 2008, 12:59:39 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: [XP] Title Skip if no Saves
« Reply #11 on: August 14, 2008, 12:44:04 PM »
There's that addon in tons? o.o
I checked 6.54b, and it's not there! Or do you mean adding this in Tons? If so, yeah!
« Last Edit: August 14, 2008, 12:45:22 PM by Fantasist »
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Title Skip if no Saves
« Reply #12 on: August 14, 2008, 12:59:26 PM »
No, it's not. I meant to add it, but I noticed something I didn't like when I tested it so meh. Here's the full script anyway:

Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Title Skip if by Blizzard
# Version: 1.0b
# Type: Game Alteration
# Date 20.1.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Instructions:
#
#   This add-on will automatically skip the title.
#   
#   
# Configuration:
#
#   Set up the following constants to configure this add-on:
#   
#   SAVE_NUMBER    - number of save files
#   SAVE_NAME      - name of save files
#   SAVE_EXTENSION - extension of save files
#   SKIP_MODE      - 0: always (just skip)
#                    1: if no save files (starts a new game)
#                    2: if any save files (opens load screen)
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#==============================================================================
# module BlizzCFG
#==============================================================================

module BlizzCFG
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  SAVE_NUMBER = 4
  SAVE_NAME = 'Save'
  SAVE_EXTENSION = 'rxdata'
  SKIP_MODE = 1

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end

#==============================================================================
# Scene_Title
#==============================================================================

class Scene_Title
 
  alias main_title_skip_later main
  def main
    $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')
    $game_system = Game_System.new
    exists = ((1..BlizzCFG::SAVE_NUMBER).any? {|i| FileTest.exist?(
          "#{BlizzCFG::SAVE_NAME}#{i}.#{BlizzCFG::SAVE_EXTENSION}")})
    case BlizzCFG::SKIP_MODE
    when 0 then exists ? command_continue : command_new_game
    when 1 then exists ? main_title_skip_later : command_new_game
    when 2 then exists ? command_continue : main_title_skip_later
    else
      main_title_skip_later
    end
  end

end
« Last Edit: August 14, 2008, 01:05:19 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: [XP] Title Skip if no Saves
« Reply #13 on: August 14, 2008, 02:37:09 PM »
Something you don't like?
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20013
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Title Skip if no Saves
« Reply #14 on: August 14, 2008, 03:39:57 PM »
"confirm" sound is being played. I know how this can be avoided (loading a dummy Data_System bofore and the real one after), but I'm not sure if this will work with other systems without problems.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: [XP] Title Skip if no Saves
« Reply #15 on: August 14, 2008, 05:00:42 PM »
Oh... $data_system isn't read-only, is it? I'll try this out.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



FlyingHamsta

  • Guest
Re: [XP] Title Skip if no Saves
« Reply #16 on: August 15, 2008, 12:28:20 AM »
Ah, thank you very much for the full script.  =]

EDIT: Just tested it, works well.  A suggestion:

-Is it possible to differentiate between loading the game and 'returning to title'?  For example, right now if I start the game up, it skips the title as intended, but if I use the Return to Title option and there's still no save file, it skips the title once more and starts a new game again.
« Last Edit: August 15, 2008, 12:32:01 AM by FlyingHamsta »

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: [XP] Title Skip if no Saves
« Reply #17 on: August 15, 2008, 01:06:24 PM »
@Bliz: The game crashes if there's a savefile because command_continue checks for @continue_enabled and returns if it'sfalse/nil.

@FlyingHamsta: If I understand right, you need this feature only when starting the game and everywhere else, you'd like to use the normal title screen? Okay, so here's how I'd make it work.

 - In the script, change the line "class Scene_Title" to "class Scene_Begin < Scene_Title".
 - Now just below, you'll see "alias main_title_skip_later main". Erase that line.
 - Now find this:
Code: [Select]
exists = ((1..BlizzCFG::SAVE_NUMBER).any? {|i| FileTest.exist?(
          "#{BlizzCFG::SAVE_NAME}#{i}.#{BlizzCFG::SAVE_EXTENSION}")})

and add this line just below:
Code: [Select]
@continue_enabled = exists

 - Next, wherever you see "main_title_skip_later", replace that with "super". You can use Ctrl+H for replacing.
 - Now, go to the 'Main' script slot and change "Scene_Title" to "Scene_Begin". I tried this out and it works fine.
« Last Edit: August 15, 2008, 01:12:41 PM by Fantasist »
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



FlyingHamsta

  • Guest
Re: [XP] Title Skip if no Saves
« Reply #18 on: September 04, 2008, 08:53:46 AM »
Just implemented it myself and replying to let you know it works great.  Thanks again!