Soramaro´s Scene_Title
#1
Soramaro´s Scene_Title v1.0
May 27 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Sorry for my english but i´m from venezuela and my i can talk this lenguage very well

This is my first script, is a scene title animated whit characters and battlers, very suitable and easy of edit, options of FullScreen, Aleatorie BGM.




For a better effect you can use the TDS Fog in Title Screen Script too.


The Script

Code:
#==============================================================================
# Soramaro´s Scene_Title v1.0
# by Soramaro
# 26-05-07
#------------------------------------------------------------------------------
# A easy scene_title, this is my first script, thanks to TDS for help me
#==============================================================================
class Scene_Title
#============================================================================
#--------------------------------------------------------------------------
#Begin of the Editable Part
#--------------------------------------------------------------------------  

#Name Of The First Command
C1 = "  Nuevo Juego"
#Name of the command number two
C2 = " Cargar Partida"
#Name of the third Command
C3 = "         Salir      "

#Opacity of the Chooses Box
CWO = 160
#Coord. X chooses Box
CWX = 320
#Coord. Y chooses Box
CWY = 288
#Weith of the Chooses Box
DIA = 192

#Activate Characters
MCHA = true
#Animation in the characters
CHANI = true
#Battlers,  "0" for desactivate its and "150" for activate
BAON = 150
#Animation of the battlers
BAANI = true
#Animatión of the Words graphics in tittle Screens
STIANI = true

#Gráfico Character de New Game (Carpeta Characters)
NEW_GAME = '001-Fighter01'
#Coordenada X New Game Chara Izquierdo
VONEIX = 175
#Coord. Y Exit Chara Left
VONEIY = 285
#Coord. X Exit Chara Right
VONEDX = 435
#Coord. Y Exit Chara Right
VONEDY = 285

#Gráfico de Continue (Carpeta Characters)
CONTINUE = '002-Fighter02'
#Coord. X Exit Chara Left
VTWOIX = 175
#Coord. Y Exit Chara Left
VTWOIY = 325
#Coord. X Exit Chara Right
VTWODX = 435
#Coord. Y Exit Chara Right
VTWODY = 325

#Gráfico de Exit (Carpeta Characters)
EXIT = '003-Fighter03'
#Coord. X Exit Chara Left
VTREIX = 175
#Coord. Y Exit Chara Left
VTREIY = 354
#Coordenada X Exit Right
VTREDX = 435
#Coord. Y Exit Chara Right
VTREDY = 354

#Battler Graphic of New Game option (Battlers Folder)
BANEW = '001-Fighter01'
#Coord. X New Game Battler
BONEX = 140
#Coord. Y New Game Battler
BONEY = 230

#Battler Graphic of  Continue option (Battlers Folder)
BACON = '002-Fighter02'
#Coord. X Continue Battler
BTWOX = 400
#Coord. Y Continue Battler
BTWOY = 250

#Battler Graphic of  Exit option (Battlers Folder)
BAEXI = '003-Fighter03'
#Coord. X Exit Battler
BTREX = 110
#Coord. Exit Battler
BTREY = 290

#Words of the Title (Titles Folder)
STITLE = 'stitle1'
#FullScreen Modw
FULLSCREEN = false
#Set to true for aleatorie BGM
ALEBGM = true
#BGM 1
BGM1 = '013-Theme02'
#BGM 2
BGM2 = '014-Theme03'
#BGM 3
BGM3 = '015-Theme04'
#BGM 4
BGM4 = '016-Theme05'

#--------------------------------------------------------------------------
#End of the Editable Part
#--------------------------------------------------------------------------

#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================
  def main
    if $BTEST
      battle_test
      return
    end
    $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
    @sprite = Sprite.new
    @count = 0
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    @sprite_stitle = Sprite.new
    @logo_anim = 0
    @sprite_stitle.bitmap = RPG::Cache.title(STITLE)
#--------------------------------------------------------------------------
#Battlers
#--------------------------------------------------------------------------    
    @banew_anim = 0
    @sprite_banew = Sprite.new
    @sprite_banew.bitmap = RPG::Cache.battler(BANEW, 0)
    @sprite_banew.opacity = 0
    @sprite_banew.x = ( BONEX)
    @sprite_banew.y = ( BONEY)
    #--------------------------------------------------------------------------    
    @bacon_anim = 0
    @sprite_bacon = Sprite.new
    @sprite_bacon.bitmap = RPG::Cache.battler(BACON, 0)
    @sprite_bacon.opacity = 0
    @sprite_bacon.x = ( BTWOX)
    @sprite_bacon.y = ( BTWOY)
    #--------------------------------------------------------------------------    
    @baexi_anim = 0
    @sprite_baexi = Sprite.new
    @sprite_baexi.bitmap = RPG::Cache.battler(BAEXI, 0)
    @sprite_baexi.opacity = 0
    @sprite_baexi.x = ( BTREX)
    @sprite_baexi.y = ( BTREY)
#--------------------------------------------------------------------------
#Characters Viewports
#--------------------------------------------------------------------------
    @v1  = Viewport.new(( VONEIX), ( VONEIY), 32, 49)
    @sprite_comenzar = Sprite.new(@v1 )
    @sprite_comenzar.bitmap = RPG::Cache.character(NEW_GAME, 0)  
    @sprite_comenzar.opacity = 0
    #--------------------------------------------------------------------------
    @v2  = Viewport.new(( VTWOIX), ( VTWOIY), 32, 49)
    @sprite_continuar = Sprite.new(@v2 )
    @sprite_continuar.bitmap = RPG::Cache.character(CONTINUE, 0)  
    @sprite_continuar.opacity = 0
    #--------------------------------------------------------------------------
    @v3  = Viewport.new(( VTREIX), ( VTREIY), 32, 49)
    @sprite_salir = Sprite.new(@v3 )
    @sprite_salir.bitmap = RPG::Cache.character(EXIT, 0)  
    @sprite_salir.opacity = 0
    #--------------------------------------------------------------------------
    @v4  = Viewport.new(( VONEDX), ( VONEDY), 32, 49)
    @sprite_comenzar2 = Sprite.new(@v4 )
    @sprite_comenzar2.bitmap = RPG::Cache.character(NEW_GAME, 0)  
    @sprite_comenzar2.opacity = 0
    #--------------------------------------------------------------------------
    @v5  = Viewport.new(( VTWODX), ( VTWODY), 32, 49)
    @sprite_continuar2 = Sprite.new(@v5 )
    @sprite_continuar2.bitmap = RPG::Cache.character(CONTINUE, 0)  
    @sprite_continuar2.opacity = 0
    #--------------------------------------------------------------------------
    @v6  = Viewport.new(( VTREDX), ( VTREDY), 32, 49)
    @sprite_salir2 = Sprite.new(@v6 )
    @sprite_salir2.bitmap = RPG::Cache.character(EXIT, 0)  
    @sprite_salir2.opacity = 0    
#--------------------------------------------------------------------------    
#FullScreen    
#--------------------------------------------------------------------------
    if FULLSCREEN == true
    $keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v'
    $keybd.call 0xA4, 0, 0, 0
    $keybd.call 13, 0, 0, 0
    $keybd.call 13, 0, 2, 0
    $keybd.call 0xA4, 0, 2, 0        
  end
#--------------------------------------------------------------------------  
# Command window
#--------------------------------------------------------------------------
    s1 = ( C1)
    s2 = ( C2)
    s3 = ( C3)
    @command_window = Window_Command.new((DIA), [s1, s2, s3])
    @command_window.back_opacity = ( CWO)
    @command_window.x = ( CWX) - @command_window.width / 2
    @command_window.y = ( CWY)
#--------------------------------------------------------------------------
# Continue Command
#--------------------------------------------------------------------------    
@continue_enabled = false
          for i in 0..3
      if FileTest.exist?("Save#{i+1}.rxdata")
        @continue_enabled = true
      end
    end
    if @continue_enabled
      @command_window.index = 1
    else
      @command_window.disable_item(1)
    end
#--------------------------------------------------------------------------    
#Sora´s BGM Tittle
#--------------------------------------------------------------------------
    if ALEBGM == true
    case rand(4)
    when 0
    Audio.bgm_play("Audio/BGM/" + BGM1, 100, 100)
    when 1
    Audio.bgm_play("Audio/BGM/" + BGM2, 100, 100)
    when 2  
    Audio.bgm_play("Audio/BGM/" + BGM3, 100, 100)
    when 3  
    Audio.bgm_play("Audio/BGM/" + BGM4, 100, 100)
    end
    else    
    $game_system.bgm_play($data_system.title_bgm)
    end
#--------------------------------------------------------------------------    
# Disposes y Breaks
#--------------------------------------------------------------------------
    Audio.me_stop
    Audio.bgs_stop
    Graphics.transition
     loop do
    Graphics.update
    Input.update
    update
  if $scene != self
    break
    end
    end
  Graphics.freeze
    @command_window.dispose
    @sprite.bitmap.dispose
    @sprite.dispose
    @sprite_stitle.dispose
    @sprite_stitle.bitmap.dispose
    @sprite_banew.bitmap.dispose
    @sprite_banew.dispose
    @sprite_bacon.bitmap.dispose
    @sprite_bacon.dispose
    @sprite_baexi.bitmap.dispose
    @sprite_baexi.dispose
    @sprite_comenzar.bitmap.dispose
    @sprite_comenzar.dispose
    @sprite_comenzar2.bitmap.dispose
    @sprite_comenzar2.dispose
    @sprite_continuar.bitmap.dispose
    @sprite_continuar.dispose
    @sprite_continuar2.bitmap.dispose
    @sprite_continuar2.dispose
    @sprite_salir.bitmap.dispose
    @sprite_salir.dispose
    @sprite_salir2.bitmap.dispose
    @sprite_salir2.dispose
    end
#--------------------------------------------------------------------------
# Frame Character Update
#--------------------------------------------------------------------------  
  def update_chara
    if MCHA == true  
    case @command_window.index  
    when 0
    @sprite_comenzar.opacity = 0  
    @sprite_continuar.opacity = 0
    @sprite_salir.opacity = 0  
    @sprite_comenzar2.opacity = 0      
    @sprite_continuar2.opacity = 0
    @sprite_salir2.opacity = 0
    @sprite_banew.opacity = (BAON)  
    @sprite_bacon.opacity =
    @sprite_baexi.opacity = 0
    when 1  
    @sprite_comenzar.opacity = 0  
    @sprite_continuar.opacity = 0
    @sprite_salir.opacity = 0  
    @sprite_comenzar2.opacity = 0      
    @sprite_continuar2.opacity = 0
    @sprite_salir2.opacity = 0
    @sprite_banew.opacity = 0    
    @sprite_bacon.opacity = (BAON)
    @sprite_baexi.opacity = 0  
    when 2
    @sprite_comenzar.opacity = 0    
    @sprite_continuar.opacity = 0
    @sprite_salir.opacity = 0  
    @sprite_comenzar2.opacity = 0      
    @sprite_continuar2.opacity = 0
    @sprite_salir2.opacity = 0
    @sprite_banew.opacity = 0    
    @sprite_bacon.opacity = 0
    @sprite_baexi.opacity = (BAON)  
end
end  
else
    case @command_window.index  
    when 0
    @sprite_comenzar.opacity = 255    
    @sprite_continuar.opacity = 0
    @sprite_salir.opacity = 0  
    @sprite_comenzar2.opacity = 255      
    @sprite_continuar2.opacity = 0
    @sprite_salir2.opacity = 0
    @sprite_banew.opacity = (BAON)  
    @sprite_bacon.opacity = 0
    @sprite_baexi.opacity = 0
    when 1  
    @sprite_comenzar.opacity = 0  
    @sprite_continuar.opacity = 255
    @sprite_salir.opacity = 0  
    @sprite_comenzar2.opacity = 0      
    @sprite_continuar2.opacity = 255
    @sprite_salir2.opacity = 0
    @sprite_banew.opacity = 0    
    @sprite_bacon.opacity = (BAON)
    @sprite_baexi.opacity = 0  
    when 2
    @sprite_comenzar.opacity = 0    
    @sprite_continuar.opacity = 0
    @sprite_salir.opacity = 255  
    @sprite_comenzar2.opacity = 0      
    @sprite_continuar2.opacity = 0
    @sprite_salir2.opacity = 255
    @sprite_banew.opacity = 0    
    @sprite_bacon.opacity = 0
    @sprite_baexi.opacity = (BAON)
end
end
#--------------------------------------------------------------------------
# Frame Update Animation
#--------------------------------------------------------------------------
  def update_animation
  if CHANI == true  
    case @count
     when 0
      @sprite_comenzar.ox = 0
      @sprite_comenzar2.ox = 0
      @sprite_continuar.ox = 0
      @sprite_continuar2.ox = 0
      @sprite_salir.ox = 0
      @sprite_salir2.ox = 0
     when 10      
       @sprite_comenzar.ox =  32
       @sprite_comenzar2.ox = 32
       @sprite_continuar.ox = 32
       @sprite_continuar2.ox = 32
       @sprite_salir.ox = 32
       @sprite_salir2.ox = 32
     when 20          
       @sprite_comenzar.ox =  64    
       @sprite_comenzar2.ox = 64
       @sprite_continuar.ox = 64
       @sprite_continuar2.ox = 64
       @sprite_salir.ox = 64
       @sprite_salir2.ox = 64
     when 30
       @sprite_comenzar.ox =  95
       @sprite_comenzar2.ox = 95
       @sprite_continuar.ox = 95
       @sprite_continuar2.ox = 95
       @sprite_salir.ox = 95  
       @sprite_salir2.ox = 95
     when 40
       @sprite_comenzar.ox =  64
       @sprite_comenzar2.ox = 64
       @sprite_continuar.ox = 64
       @sprite_continuar2.ox = 64
       @sprite_salir.ox = 64
       @sprite_salir2.ox = 64
       @count = 0                      
end
end
else
end  
#--------------------------------------------------------------------------
# Frame Update Logo
#--------------------------------------------------------------------------
  def update_logo
  if STIANI == true    
  @sprite_stitle.zoom_y += 0.010 if @logo_anim < 30
  @sprite_stitle.zoom_y -= 0.010 if @logo_anim > 30
  if @logo_anim > 60  
    @sprite_stitle.zoom_y = 1.0
    @logo_anim = 0
end
end
else
end
#--------------------------------------------------------------------------
# Frame Update Battlers
#--------------------------------------------------------------------------
  def update_battler
  #------------------------------------------------
   if BAANI == true    
  @sprite_banew.zoom_x += 0.010 if @banew_anim < 7
  @sprite_banew.zoom_x -= 0.010 if @banew_anim > 7
   if @banew_anim > 14
    @sprite_banew.zoom_x = 1.0
    @banew_anim = 0
end
  #------------------------------------------------
  @sprite_bacon.zoom_x += 0.010 if @bacon_anim < 7
  @sprite_bacon.zoom_x -= 0.010 if @bacon_anim > 7
   if @bacon_anim > 14
    @sprite_bacon.zoom_x = 1.0
    @bacon_anim = 0  
end
  #------------------------------------------------
  @sprite_baexi.zoom_x += 0.010 if @baexi_anim < 7
  @sprite_baexi.zoom_x -= 0.010 if @baexi_anim > 7
   if @baexi_anim > 14
    @sprite_baexi.zoom_x = 1.0
    @baexi_anim = 0  
end
end
else
end
#==============================================================================
#
# Frame Update
#--------------------------------------------------------------------------
#==============================================================================
def update
     @count += 1
     @logo_anim += 1
     @banew_anim += 1
     @bacon_anim += 1
     @baexi_anim += 1
     update_chara
     update_animation
     update_battler
     update_logo
     @command_window.update

  if Input.trigger?(Input::C)
    case @command_window.index
      when 0  # New game
        command_new_game
      when 1  # Continue
        command_continue
      when 2  # Shutdown
        command_shutdown
end
end
end
#--------------------------------------------------------------------------
# Command: New Game
#--------------------------------------------------------------------------
  def command_new_game
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_stop
    Graphics.frame_count = 0
    $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
    $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
    $game_map.autoplay
    $game_map.update
    $scene = Scene_Map.new
  end
#--------------------------------------------------------------------------
# Command: Continue
#--------------------------------------------------------------------------
  def command_continue
   unless @continue_enabled
    $game_system.se_play($data_system.buzzer_se)
return
end
    $game_system.se_play($data_system.decision_se)
    $scene = Scene_Load.new
  end
#--------------------------------------------------------------------------
# Command: Shutdown
#--------------------------------------------------------------------------
  def command_shutdown
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_fade(800)
    Audio.bgs_fade(800)
    Audio.me_fade(800)
    $scene = nil
end
#==============================================================================  
#--------------------------------------------------------------------------
# Battle Test
#--------------------------------------------------------------------------
  def battle_test
    $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")
    Graphics.frame_count = 0
    $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
    $game_party.setup_battle_test_members
    $game_temp.battle_troop_id = $data_system.test_troop_id
    $game_temp.battle_can_escape = true
    $game_map.battleback_name = $data_system.battleback_name
    $game_system.se_play($data_system.battle_start_se)
    $game_system.bgm_play($game_system.battle_bgm)
    $scene = Scene_Battle.new
  end
end




You gonna need a image 640x480px in the "Titles" foolder, you can use this image how example
(imageshack link broken)



Dudes, bugs or troubles you can contact me here or to my msn (look my profile), not publish the script in other forums if you don´t have my autoritation


sorry for my bad english again
}




Users browsing this thread: 1 Guest(s)