Attract Mode


Attract Mode 1.3
by Racheal

​



Introduction
This script allows you to set up an attract mode when the player sits idle on the title screen, similar to many arcade and console games.

Features

  • Sends the player to a blank map after a certain number of frames spent on the title screen.
  • Returns the player to the title screen with a press of a button.
  • *New* Choose to display attract mode once before the first time the title is shown

How to Use
Insert the script anywhere in the Materials section above Main and then configure the options.

Script

Spoiler
Spoiler






#==============================================================================
# Attract Mode
# by: Racheal
# Version 1.3
# Created: 09/12/2013
# Updated: 10/12/2013
#==============================================================================
# Allows you to set up an attract mode map if the player idles on the title
# screen. Attract mode can be canceled at any time with the confirm or cancel
# keys.
#==============================================================================
# Instructions:
# * Insert in the Materials section
# * Configure to your liking below
#==============================================================================

#==============================================================================
# Customization
#==============================================================================
module Racheal_Attract_Mode
# Map that attract mode sends you to
ATTRACT_MAP = 2

# Set whether to view attract mode before the first time you se
# title screen
SHOW_FIRST = true

# Amount of time (in frames) until attract mode kicks in
# The time is set exceptionally low in this demo just so you don't have to
# sit around and wait a long time to see it.
WAIT = 320
end
#==============================================================================
# End Customization
#==============================================================================

module Input

BUTTONS = [
:LEFT, :UP, :RIGHT, 😀OWN,
:A, :B, :C,
:X, :Y, :Z,
:L, :R,
:SHIFT, :CTRL, :ALT,
:F5, :F6, :F7, :F8, :F9
]

def self.any_press?
BUTTONS.any? {|i| press? i}
end

end

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

module DataManager
#--------------------------------------------------------------------------
# * Set Up Attract Mode
#--------------------------------------------------------------------------
def self.setup_attract
create_game_objects
$game_party.setup_starting_members
$game_map.setup(Racheal_Attract_Mode::ATTRACT_MAP)
$game_player.moveto(5, 5)
$game_player.refresh
Graphics.frame_count = 0
end
end

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

class Scene_Attract < Scene_Map
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
SceneManager.goto(Scene_Title) if Input.any_press?
end
end

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

class Scene_Title < Scene_Base
@@attract_seen = !Racheal_Attract_Mode::SHOW_FIRST
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
alias scene_title_start_attract_mode start
def start
unless @@attract_seen
start_attract
@@attract_seen = true
return
end
scene_title_start_attract_mode
@count = 0
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias scene_title_update_attract_mode update
def update
scene_title_update_attract_mode
@count += 1
start_attract if @count == Racheal_Attract_Mode::WAIT
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
alias scene_title_terminate_attract_mode terminate
def terminate
Graphics.freeze
scene_title_terminate_attract_mode if @viewport
end
#--------------------------------------------------------------------------
# * Start Attract
#--------------------------------------------------------------------------
def start_attract
DataManager.setup_attract
close_command_window if @command_window
fadeout_all
$game_player.transparent = true
$game_player.followers.visible = false
$game_player.refresh
$game_map.autoplay
SceneManager.goto(Scene_Attract)
end
end


Credit
- Racheal

Demo
Download Here
Please don't mind how silly the attract mode is. I already spent way more time on this demo than I did the script. I'm sure it can be used far more effectively than what I showed here.

Author's Notes
Free for commercial and non-commercial use. Just credit me (and let me know if you use it, just because).

I'd like to eventually figure out an easy way to cancel the attract mode with any player input instead of just the main two keys like it is right now. I'll update the script if I figure out how I want to do this.
Thanks to Super Cremno 64 Turbo HD, I've updated the script to allow for any standard button to cancel attract mode. The demo has also been updated.

Since this script just teleports you to a map of your choosing, the possibilities for what you can do with it are pretty plentiful. My only recommendations are to not use anything that requires player input (i.e., a text box that doesn't auto-close) and to return to the title screen at the end of the auto-event.
I tried the demo and this is in fact pretty useful! 
It can be used to make some sort of general introductory opening (with map evented stuff or even a nice video) or something like that wich will not appear everytime we open the game (instead, if we want to see it, we just wait little).
this is really neat and I believe it can be used in many many ways
This would definitely give an arcade-feel.
What if I use a custom title scene script like MogHunter's or HK's?
This script doesn't overwrite any methods, just alias the start method of Scene_Title. So I imagine it should be compatible with most scripts. Just put it under anything that overwrites a method.


[Edit] Actually the update method might be an issue. I'll look into it when I get home.


[Edit 2] Fixed. I didn't bother updating the demo for such an insignificant change, so make sure you grab the script from the page and not the demo if you're using an animated title screen.
Not compatible with MogHunter's Animated Title Screen.
Version 1.1 or 1.2? I didn't outright test it with any animated scripts, but 1.2 should work as long as it is below the animated title script.
Sorry, got the demo. Works great now!
But is there a way to temporarily disable the player's ability to cancel Attract Mode?

Given the way that many (most?) players select from the title screen immediately, my concern is that they would never, in fact, ever get to know that there was something there if they just hung about a bit.
The player can only cancel an active Attract Mode, so that wouldn't really affect it. It was never meant to be mandatory content. Not every player is like me and let's a game sit through one title screen song loop before I even start to play, just to see if there's an attract mode.


That being said, I added an option that allows Attract Mode to play once before the first time the title screen is shown. I updated the demo as well. If you're showing any logos or whatnot on the title screen, it will display before those without editing. Unfortunately, that would have to be handled on a case-by-case basis.
Thanks.
Oh, heck yeah! This is super neat!
how about the option to show attract mode once ONLY when no save files found (first time playing). when there's save files it will not play unless we wait. it would me nicer in my opinion.
Uh, sure, since it's a one-line edit. I'm not going to change the script in the original post, but if you want that option, you just need to change line 85 (the one right after def Scene_Title) to the following:

Code:
@@attract_seen = (!Racheal_Attract_Mode::SHOW_FIRST or DataManager.save_file_exists?)
This script is exactly what I need to raise the awesomeness of my project to a whole new level!

Question, is there any way that I can alter the script that the music from the intro continues playing

while the attract screen runs?

Fixed, I worked around it creatively and it really fits so, not needed anymore 🙂 .

Project will be released within 2 weeks and credits for this awesome script will be included for sure 🙂 .
Thanks again! This really REALLY adds a layer of awesomeness to the intro. 
 

I made a little video with the results so far, text is not final but I really love the -press space to start- option

I was able to create thanks to this script!

Hopefully it inspires others  🙂
https://www.youtube.com/watch?v=aXRO4z4C7K4&feature=youtu.be
 
This script is simply AWESOME! Exactly what I was looking for.

Now I can play movie at the beginning, without making players to watch the entire video whenever they launch a game! 😀

Now pressing the F12 button can be use as the skip button! 😀

I was using other script that played movie before title and... You probably know what would happen if you F12 the game during that movie. - I tried that and the movie started from beginning and I was like "Noooooooooooo! Damn it! 😀"

I need to check that in my game, because I'm using wall of scripts and they sometimes are very upset when they'll new neighbors. > 😀
Hope it's cool that I modded your script a little. Now the system uses the first map when the player boots the game and the second map after idling on the main menu. This way you can show your company info or sponsors upfront and get that professional feel and when the game idles you can show off the game. Sort of like Kingdom Hearts (best example I could think of ATM). Anyway, just thought I would share:

 

Spoiler
Code:
#==============================================================================
# Attract Mode
# by: Racheal
# Version 1.3
# Created: 09/12/2013
# Updated: 10/12/2013
#==============================================================================
# Allows you to set up an attract mode map if the player idles on the title
# screen. Attract mode can be canceled at any time with the confirm or cancel
# keys.
#==============================================================================
# Instructions:
# * Insert in the Materials section
# * Configure to your liking below
#==============================================================================

#==============================================================================
# Customization
#==============================================================================
module Racheal_Attract_Mode
  # Map that attract mode sends you to
  ATTRACT_MAP = 2
  
  SECOND_MAP = 3
  
  # Set whether to view attract mode before the first time you se
  # title screen
  SHOW_FIRST = true
  
  # Amount of time (in frames) until attract mode kicks in
  # The time is set exceptionally low in this demo just so you don't have to
  # sit around and wait a long time to see it.
  WAIT = 3600
end
#==============================================================================
# End Customization
#==============================================================================

module Input

  BUTTONS = [
    :LEFT, :UP, :RIGHT, :DOWN,
    :A, :B, :C,
    :X, :Y, :Z,
    :L, :R,
    :SHIFT, :CTRL, :ALT,
    :F5, :F6, :F7, :F8, :F9
  ]

  def self.any_press?
    BUTTONS.any? {|i| press? i}
  end

end

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

module DataManager
  #--------------------------------------------------------------------------
  # * Set Up Attract Mode
  #--------------------------------------------------------------------------
  def self.setup_attract
    create_game_objects
    $game_party.setup_starting_members
    $game_map.setup(Racheal_Attract_Mode::ATTRACT_MAP)
    $game_player.moveto(5, 5)
    $game_player.refresh
    Graphics.frame_count = 0
  end
  
  def self.setup_second_attract
    create_game_objects
    $game_party.setup_starting_members
    $game_map.setup(Racheal_Attract_Mode::SECOND_MAP)
    $game_player.moveto(5, 5)
    $game_player.refresh
    Graphics.frame_count = 0
  end
end

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

class Scene_Attract < Scene_Map
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    SceneManager.goto(Scene_Title) if Input.any_press?
  end
end

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

class Scene_Title < Scene_Base
  @@attract_seen = !Racheal_Attract_Mode::SHOW_FIRST
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  alias scene_title_start_attract_mode start
  def start
    unless @@attract_seen
      start_attract
      @@attract_seen = true
      return
    end
    scene_title_start_attract_mode
    @count = 0
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias scene_title_update_attract_mode update
  def update
    scene_title_update_attract_mode
    @count += 1
    start_second_attract if @count == Racheal_Attract_Mode::WAIT
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias scene_title_terminate_attract_mode terminate
  def terminate
    Graphics.freeze
    scene_title_terminate_attract_mode if @viewport
  end
  #--------------------------------------------------------------------------
  # * Start Attract
  #--------------------------------------------------------------------------
  def start_attract
    DataManager.setup_attract
    close_command_window if @command_window
    fadeout_all
    $game_player.transparent = true
    $game_player.followers.visible = false
    $game_player.refresh
    $game_map.autoplay
    SceneManager.goto(Scene_Attract)
  end
  
  def start_second_attract
    DataManager.setup_second_attract
    close_command_window if @command_window
    fadeout_all
    $game_player.transparent = true
    $game_player.followers.visible = false
    $game_player.refresh
    $game_map.autoplay
    SceneManager.goto(Scene_Attract)
  end
end

Original thread: https://forums.rpgmakerweb.com/threads/attract-mode.20800/