Moghunter's Title Screen - Adding Commands (RGSS3)

Status
Not open for further replies.

AshteriskGaming

Failure
Member
Joined
Jul 28, 2013
Messages
13
Reaction score
1
First Language
English
Primarily Uses
RMMV
I actually did fix this problem on my own once before. Unfortunately, I have completely forgotten how I did it last time and have been unable to replicate the previous process.


I am trying to enhance my title screen in a few ways, but this is most important: I need to add another command to Moghunter's Animated_Title_A script. I know most people have probably moved on to MV by now, but I've already done a lot with this project and it would be a shame to just dump and redo. (Plus I'm not quite fond of MV's new default sideview system. I'm not one for chibi characters in general, and it seems like the characters have only gotten shorter and cuter.)


 


My main issue is that the part of the code that seems like it should tell the script which command goes where is not actually doing that. It establishes the image used, but it doesn't seem to actually do much else.


 


The command I added before is the Resolution Selection script, and it works accordingly, but all commands seem to be locked to each number. 0=NewGame, 1=Continue, 2=Resolution, and 3=Shutdown. I likely achieved the change just by bumbling around like an idiot, and I can't seem to identify how to do it again with another command.


 


What I need it to do is:


0=NewGame


1=Continue


2=??????/Return (turns into "Return" upon completing the first half of the story; essentially a secret chapter/sequel story without making an entire new project. ?????? wouldn't do anything, and Return should teleport the player to a specified map which will then have an autorun event that starts the new story.)


3=Resolution


4=Shutdown


 


What it actually does:


0=Displays as NewGame, performs NewGame


1=Displays as Continue, performs Continue with save game present


2=Displays as ?????? or return depending on a persistent switch, performs Resolution


3=Displays as Resolution, performs Shutdown


4=Displays as Shutdown, and not able to be selected, nor hovered over


 


It is just determined to have the same exact function, and only the appearance of the commands change.


 


Another user told me in a previous topic (in which I acted particularly less appropriately than I'd like to admit,) that the script is hardwired to use the default title screen commands. What I need to know is, what do I need to alter to move the shutdown and resolution functions down by one position in the script's sequence and force the script to use 5 commands total, rather than ignoring the last command? (I have tried changing the "5" in "for com in 0...5" to several different numbers, and it currently has no effect unless you decrease it, and then I just lose more commands.)


 


Not sure if I'm doing the spoiler tag right; here's my adjusted script below. It isn't in English or anything, though, as the script in originally in Portuguese, I think...


 



#==============================================================================
# +++ MOG - Animated Title A (v2.4) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Tela de titulo animado, com logo, imagens aleatórias e outros efeitos visuais.
#==============================================================================


 


#==============================================================================
# IMAGENS NECESSÁRIAS
#==============================================================================
# Serão necessários as seguintes imagens na pasta Graphics/Titles2/
#
# Cursor.png  
# Commmand_Name.png (image filename = name of command)
# Particle.png   (Opcional)
# Logo.jpg       (Opcional)
# Animated.png   (Opcional)
#==============================================================================


 


#==============================================================================
# NOTA 1 - Para definir a imagem de texto basta selecionar no banco de dados
# a imagem do titulo numero 2 (Segunda camada)
#==============================================================================


 


#==============================================================================
# NOTA 2 - O nome da imagem de comando é iguál ao nome do comando definido
# no banco de dados do Rpg Maker.
#==============================================================================


 



#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 2.4 - Compatibilidade com resoluções acima do padrão.
# v 2.3 - O nome do comando não é mais baseado no database.
#==============================================================================


 


module MOG_SCENE_TITLE_A


 


  #--------------------------------------------------------------------------
  # ▼ LOGO ▼
  #--------------------------------------------------------------------------
  # Apresenta um Logo ao começar a tela de titulo.
  # Será necessário ter a imagem LOGO.jpg (png) na pasta Graphics/Title2
  #--------------------------------------------------------------------------
  # Ativar Logo
  LOGO = true
  # Duração do logo.
  LOGO_DURATION = 2 #(Sec)
 
  #--------------------------------------------------------------------------
  # ▼ RANDOM BACKGROUND ▼
  #-------------------------------------------------------------------------- 
  #Definição das pictures.
  #--------------------------------------------------------------------------
  RANDOM_PICTURES = ["Title0", "Title1", "Title2", "Title3", "Title4", "Title5",
  "Title6", "Title7", "Title8", "Title9", "Title10", "Title11", "Title12"]
  #Tempo de duração para ativar a troca de imagens.
  RANDOM_PICTURES_DURATION = 10#(sec)
  #Seleção aleatória.
  RANDOM_SELECTION = false
  #Velocidade de Scrolling. (Speed X , Speed Y)
  RANDOM_PICTURES_SCROLL_SPEED = [0,0]
 
  #--------------------------------------------------------------------------
  # ▼ MULTIPLE LAYERS ▼
  #--------------------------------------------------------------------------
  # Definição de multiplas camadas. * (não há limíte na quantidade de camadas
  # usadas)
  #--------------------------------------------------------------------------
  # MULTIPLE_LAYERS = [  ["A",B,C,D], ["A",B,C,D], ["A",B,C D], ["A",B,C,D ], ....]
  #
  # A - Nome da imagem.
  # B - Velocidade de scroll na horizontal.
  # C - Velocidade de scroll na vertical.
  # D - Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
  #
  MULTIPLE_LAYERS = [
  ["Layer1",1,0,1],
  ["Layer2",3,0,1],  
  ["Layer3",0,0,0],
  ["Layer4",0,0,0],
  ["Layer5",1,0,1],
  ["Layer6",3,0,1]
  ] 
 
  #--------------------------------------------------------------------------
  # ▼ PARTICLES ▼
  #--------------------------------------------------------------------------
  # Adiciona partículas animadas na tela do titulo.
  # Será necessário ter a imagem PARTICLE.png na pasta Graphics/Title2
  #--------------------------------------------------------------------------
  # Ativar Partículas.
  PARTICLE = true
  # Ativar Cores Aleatórias.
  PARTICLE_RANDOM_COLOR = true 
  # Definição do tipo de blend. (0,1,2)
  PARTICLE_BLEND_TYPE = 1
  #Definição do limite de velocidade das partículas.
  PARTICLE_MOVEMENT_RANGE_X = 3
  PARTICLE_MOVEMENT_RANGE_Y = 3
  PARTICLE_ANGLE_RANGE = 3
 
  #--------------------------------------------------------------------------
  # ▼ WAVE TITLE ▼
  #-------------------------------------------------------------------------- 
  # Ativa o efeito  WAVE no texto do titulo, o Texto do titulo é definido
  # na camada do titulo 2, que pode ser definido através do banco de dados
  #--------------------------------------------------------------------------   
  #Ativar o efeito do titulo com efeito WAVE.
  TITLE_WAVE = true
  #Configuração do efeito WAVE
  #
  # TITLE_WAVE_CONFIG = [ AMP, LENGTH , SPEED]
  #
  TITLE_WAVE_CONFIG = [6 , 232 , 360]
 
  #--------------------------------------------------------------------------
  # ▼ ANIMATED_SPRITE ▼ (Opcional)
  #--------------------------------------------------------------------------
  # Adiciona um sprite animado no titulo.
  # A quantidade de frames é proporcional a largura dividido pela altura
  # da imagem, ou seja, não há limite de quantidade de frames e nem de
  # tamanho da imagem.
  # Será necessário ter a imagem ANIMATED.png (Jpg) na pasta Graphics/Title2
  #--------------------------------------------------------------------------
  # Ativar Sprite animado.
  ANIMATED_SPRITE = true
  # Posição do Sprite animado.
  ANIMATED_SPRITE_POSITION = [Graphics.width * 0, Graphics.height * 1]
  # Velocidade da animação
  ANIMATED_SPRITE_SPEED = 10
  # Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
  ANIMATED_SPRITE_BLEND_TYPE = 0
  # Definição do zoom,
  ANIMATED_SPRITE_ZOOM = 1.5
 
 
  #--------------------------------------------------------------------------
  # ▼ COMMANDS / SELECTION ▼
  #--------------------------------------------------------------------------
  # Configuração extras da tela de titulo.
  #--------------------------------------------------------------------------
  # Posição do comando.
  COMMANDS_POS = [Graphics.width, Graphics.height]
  # Ativar o efeito de tremor ao selecionar o comando.
  COMMAND_SHAKE = true
  # Definição da posição do cursor.(Para ajustes)
  CURSOR_POS = [-50,-7]
  # Ativar flash ao mover o comando.
  CURSOR_FLASH_SELECTION = true
  # Definição da posição do flash.
  CURSOR_FLASH_SLECTION_POS = [-100,0]
  # Tipo de Blend. (0 - Normal / 2 - Add / 3 - Substract)
  CURSOR_FLASH_SLECTION_BLEND_TYPE = 1
 
end


 


#==============================================================================
# ■ Window TitleCommand
#==============================================================================
class Window_TitleCommand < Window_Command
  attr_reader :list
end


 


#==============================================================================
# ■ Particle Title
#==============================================================================
class Particle_Title < Sprite
 
  include MOG_SCENE_TITLE_A
 
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------            
  def initialize(viewport = nil)
      super(viewport)
      self.bitmap = Cache.title2("Particle")
      self.tone.set(rand(255),rand(255), rand(255), 255) if PARTICLE_RANDOM_COLOR
      self.blend_type = PARTICLE_BLEND_TYPE
      self.z = 50
      @sc_x = [self.bitmap.width / 2, self.bitmap.width, Graphics.width ]
      @sc_y = [self.bitmap.height / 2, self.bitmap.height, Graphics.height ]
     
      @cw0 = self.bitmap.width / 2 ; @ch0 = self.bitmap.height / 2
      @cw = self.bitmap.width + @cw0 ; @cw2 = Graphics.width
      @ch = self.bitmap.height + @ch0 ; @ch2 = Graphics.height
     
      @nx = PARTICLE_MOVEMENT_RANGE_X
      @ny = PARTICLE_MOVEMENT_RANGE_Y
      reset_setting
  end 
 
 #--------------------------------------------------------------------------
 # ● Reset Setting
 #--------------------------------------------------------------------------              
  def reset_setting
      zoom = (50 + rand(100)) / 100.1
      self.zoom_x = zoom
      self.zoom_y = zoom
      self.x = (rand(@cw2 + 32) -32)
      self.y = rand((@ch2 + 32) + @ch)
      self.opacity = 0
      self.angle = rand(360)
      nx2 = rand(@nx).abs
      nx2 = 1 if (@nx != 0 and nx2 < 1)     
      @speed_x = @nx > 0 ? nx2 : @nx < 0 ? -nx2 : 0       
      ny2 = rand(@ny).abs
      ny2 = 1 if (@ny != 0 and ny2 < 1)     
      @speed_y = @ny > 0 ? ny2 : @ny < 0 ? -ny2 : 0  
      @speed_a = [[rand(PARTICLE_ANGLE_RANGE), PARTICLE_ANGLE_RANGE].min, 0].max
  end
 
 #--------------------------------------------------------------------------
 # ● Dispose
 #--------------------------------------------------------------------------              
  def dispose
      super
      self.bitmap.dispose
  end 
 
 #--------------------------------------------------------------------------
 # ● Update
 #--------------------------------------------------------------------------              
  def update
      super
      self.x += @speed_x
      self.y -= @speed_y
      self.angle += @speed_a     
      self.opacity += 5
      reset_setting if can_reset_setting?
  end 
 
 #--------------------------------------------------------------------------
 # ● Can Reset Setting
 #--------------------------------------------------------------------------                
  def can_reset_setting?
      return true if (self.x < -(@cw * 2) or self.x > (@cw2 + @cw))   
      return true if (self.y < -(@ch * 2) or self.y > (@ch2 + @ch))
      return false
  end 
end


 


#==============================================================================
# ■ Multiple Layers Title
#==============================================================================
class Multiple_Layers_Title
 
  #--------------------------------------------------------------------------
  # ● Initialize
  #-------------------------------------------------------------------------- 
  def initialize(name = "", scroll_x = 0, scroll_y = 0, blend = 0, index = 0)
      @layer = Plane.new
      @layer.bitmap = Cache.title1(name.to_s) rescue nil
      @layer.bitmap = Bitmap.new(32,32) if @layer.bitmap == nil
      @layer.z = 10 + index
      @layer.opacity = 0
      @layer.blend_type = blend
      @scroll_speed = [scroll_x, scroll_y]
  end
 
  #--------------------------------------------------------------------------
  # ● Dispose
  #-------------------------------------------------------------------------- 
  def dispose
      @layer.bitmap.dispose
      @layer.bitmap = nil
      @layer.dispose
  end
 
  #--------------------------------------------------------------------------
  # ● Update
  #-------------------------------------------------------------------------- 
  def update
      @layer.opacity += 2
      @layer.ox += @scroll_speed[0]
      @layer.oy += @scroll_speed[1]
  end
 
end
#==============================================================================
# ■ Scene Title
#==============================================================================
class Scene_Title < Scene_Base
 include MOG_SCENE_TITLE_A
 
 #--------------------------------------------------------------------------
 # ● Start
 #--------------------------------------------------------------------------         
 def start
     super
     RPG::BGM.fade(2000)
     @logo_active = LOGO
     SceneManager.clear
     @phase = 1
     @phase_time = -1
     dispose_title_sprites
     create_logo if @logo_active
     create_logo2
     create_command_window
     create_commands
     create_background
     create_light
     create_cursor
     create_animated_object
     create_flash_select
     create_multiple_layers
     play_title_music unless @logo_active
 end
  
 #--------------------------------------------------------------------------
 # ● Create Multiple Layers
 #--------------------------------------------------------------------------
 def create_flash_select
     return if !CURSOR_FLASH_SELECTION
     @flash_select = Sprite.new
     @flash_select.bitmap = Cache.title2("Cursor2")
     @flash_select.z = 99
     @flash_select.opacity = 0
     @flash_select.blend_type = CURSOR_FLASH_SLECTION_BLEND_TYPE
 end 
 
 #--------------------------------------------------------------------------
 # ● Create Multiple Layers
 #--------------------------------------------------------------------------          
 def create_multiple_layers
     @m_layers = []
     index = 0
     for i in MULTIPLE_LAYERS
         @m_layers.push(Multiple_Layers_Title.new(i[0],i[1],i[2],i[3],index))
         index += 1
     end 
 end


 


 #--------------------------------------------------------------------------
 # ● Create_Logo
 #--------------------------------------------------------------------------           
 def create_animated_object
      return if !ANIMATED_SPRITE
      @object_index = 0
      @object_animation_speed = 0
      @object = Sprite.new
      @object.z = 98
      @object.opacity = 0
      @object.blend_type = ANIMATED_SPRITE_BLEND_TYPE
      @object.zoom_x = ANIMATED_SPRITE_ZOOM
      @object.zoom_y = ANIMATED_SPRITE_ZOOM
      @object_image = Cache.title2("Animated")
      @object_frame_max = @object_image.width / @object_image.height
      @object_width = @object_image.width / @object_frame_max 
      @object.bitmap = Bitmap.new(@object_width,@object_image.height)
      @object.x = ANIMATED_SPRITE_POSITION[0]
      @object.y = ANIMATED_SPRITE_POSITION[1]    
      make_object_bitmap
 end 
 
 #--------------------------------------------------------------------------
 # ● Create_Logo
 #--------------------------------------------------------------------------          
 def create_cursor
     @cursor = Sprite.new
     @cursor.bitmap = Cache.title2("Cursor")
     @cursor.opacity = 0
     @cursor.z = 130
     @cursor_position = [0,0]
     @mx = [0,0,0]
 end
 
 #--------------------------------------------------------------------------
 # ● Create_Logo
 #--------------------------------------------------------------------------          
 def create_logo
     @phase = 0
     @logo = Sprite.new
     @logo.bitmap = Cache.title2("Logo")
     @logo.opacity = 0
     @logo_duration = 180 + (LOGO_DURATION * 60)
     @logo.z = 200
 end


 


 #--------------------------------------------------------------------------
 # ● Create_Logo
 #--------------------------------------------------------------------------          
 def create_logo2
     @phase = 0
     @logo = Sprite.new
     @logo.bitmap = Cache.title2("Logo2")
     @logo.opacity = 0
     @logo_duration = 180 + (LOGO_DURATION * 60)
     @logo.z = 200
 end
 
 #--------------------------------------------------------------------------
 # ● Create Commands
 #--------------------------------------------------------------------------
 def create_commands
     @command_window.visible = true
     @commands_index_old = -1
     @commands = []
     @commands_shake_duration = 0
     index = 0
     for com in 0...5
         sprite = Sprite.new
         case index
            when 0; com_name = "New_Game"
            when 1; com_name = "Continue"
            when 2;
              if $game_switches[50] == true
                com_name = "Return"
              else
                com_name = "qqqqqq"
              end
            when 3; com_name = "Resolution"
            when 4; com_name = "Shutdown"
         end
         sprite.bitmap = Cache.title2(com_name.to_s) rescue nil
         if sprite.bitmap == nil
            sprite.bitmap = Bitmap.new(200,32)
            sprite.bitmap.font.size = 24
            sprite.bitmap.font.bold = true
            sprite.bitmap.font.italic = true
            sprite.bitmap.draw_text(0, 0, 200, 32, com_name.to_s,1)
         end
         sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
         sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
         sprite.z = 100 + index
         sprite.opacity = 0
         index += 1
         @commands.push(sprite)
     end
     @command_max = index
 end
 
  #--------------------------------------------------------------------------
  # ● create_background
  #--------------------------------------------------------------------------
  def create_background
      @rand_title_duration = 120
      @old_back_index = 0
      @sprite1 = Plane.new
      @sprite1.opacity = 0
      @sprite1.z = 1
      if RANDOM_SELECTION
         execute_random_picture(false)
      else
         execute_random_picture(true)
      end
      @sprite2 = Sprite.new
      @sprite2.bitmap = Cache.title2($data_system.title2_name)
      @sprite2.z = 140
      @sprite2.opacity = 0
      if TITLE_WAVE
          @sprite2.wave_amp = TITLE_WAVE_CONFIG[0]
          @sprite2.wave_length = TITLE_WAVE_CONFIG[1]
          @sprite2.wave_speed = TITLE_WAVE_CONFIG[2]
      end   
  end
 
  #--------------------------------------------------------------------------
  # ● Create Light
  #-------------------------------------------------------------------------- 
  def create_light
      return unless PARTICLE
      @light_bitmap =[]
      for i in 0...20
          @light_bitmap.push(Particle_Title.new(nil))
      end 
  end
   
  #--------------------------------------------------------------------------
  # ● dispose Background1
  #--------------------------------------------------------------------------
  def dispose_background1
      @sprite1.bitmap.dispose
      @sprite1.bitmap = nil
      @sprite1.dispose
      @sprite1 = nil
  end
 
 #--------------------------------------------------------------------------
 # ● Dispose Background2
 #--------------------------------------------------------------------------               
  def dispose_background2
      if @sprite2.bitmap != nil
         @sprite2.bitmap.dispose
         @sprite2.bitmap = nil
         @sprite2.dispose
         @sprite2 = nil
      end
  end
   
 #--------------------------------------------------------------------------
 # ● Dispose Light
 #--------------------------------------------------------------------------             
  def dispose_light
      return unless PARTICLE
      if @light_bitmap != nil
         for i in @light_bitmap
             i.dispose
         end
         @light_bitmap = nil
      end
  end   
 
 #--------------------------------------------------------------------------
 # ● Dispose Logo
 #--------------------------------------------------------------------------            
 def dispose_logo
     return unless @logo_active
     @logo.bitmap.dispose
     @logo.dispose
 end 
 
 #--------------------------------------------------------------------------
 # ● Dispose Multiple Layers
 #--------------------------------------------------------------------------                         
 def dispose_multiple_layers
     return if @m_layers == nil
     @m_layers.each {|layer| layer.dispose }
 end
 
 #--------------------------------------------------------------------------
 # ● Terminate
 #--------------------------------------------------------------------------           
 def terminate
     super
     dispose_title_sprites    
 end 
 
 #--------------------------------------------------------------------------
 # ● Dispose Title Sprites
 #--------------------------------------------------------------------------            
 def dispose_title_sprites
     return if @cursor == nil
     dispose_background1
     dispose_background2
     dispose_light
     dispose_logo
     dispose_multiple_layers
     @cursor.bitmap.dispose
     @cursor.dispose
     @cursor = nil
     if @flash_select != nil
        @flash_select.bitmap.dispose
        @flash_select.dispose
     end  
     for com in @commands
         com.bitmap.dispose
         com.dispose
     end
     if ANIMATED_SPRITE
        @object.bitmap.dispose
        @object.dispose
        @object_image.dispose
     end        
 end
  
 #--------------------------------------------------------------------------
 # ● Update
 #--------------------------------------------------------------------------            
 def update
     super
     update_logo
     update_initial_animation
     update_command
     update_background
     update_light
     update_object_animation
     update_multiple_layers
 end
 
 #--------------------------------------------------------------------------
 # ● Update Multiple Layers
 #--------------------------------------------------------------------------                         
 def update_multiple_layers
     return if @m_layers == nil
     @m_layers.each {|layer| layer.update }
 end
  
 #--------------------------------------------------------------------------
 # ● Make Object bitmap
 #--------------------------------------------------------------------------                        
  def make_object_bitmap
      @object.bitmap.clear
      src_rect_back = Rect.new(@object_width * @object_index, 0,@object_width,@object_image.height)
      @object.bitmap.blt(0,0, @object_image, src_rect_back) 
  end
   
 #--------------------------------------------------------------------------
 # ● Update Object Animation
 #--------------------------------------------------------------------------                      
  def update_object_animation
      return if !ANIMATED_SPRITE
      @object.opacity += 2
      @object_animation_speed += 1
      if @object_animation_speed > ANIMATED_SPRITE_SPEED
         @object_animation_speed = 0
         @object_index += 1
         @object_index = 0 if @object_index >= @object_frame_max
         make_object_bitmap   
      end
  end 
 
 #--------------------------------------------------------------------------
 # ● Update Cursor Position
 #--------------------------------------------------------------------------           
 def update_cursor_position
     @cursor.opacity += 5
     execute_animation_s
     execute_cursor_move(0,@cursor.x,@cursor_position[0] + @mx[1])
     execute_cursor_move(1,@cursor.y,@cursor_position[1])
 end 
 
  #--------------------------------------------------------------------------
  # ● Execute Animation S
  #--------------------------------------------------------------------------     
  def execute_animation_s
      @mx[2] += 1
      return if @mx[2] < 4
      @mx[2] = 0
      @mx[0] += 1
      case @mx[0]
         when 1..7;  @mx[1] += 1           
         when 8..14; @mx[1] -= 1
         else
           @mx[0] = 0
           @mx[1] = 0
      end
  end
   
  #--------------------------------------------------------------------------
  # ● Execute Cursor Move
  #--------------------------------------------------------------------------     
  def execute_cursor_move(type,cp,np)
      sp = 5 + ((cp - np).abs / 5)
      if cp > np
         cp -= sp
         cp = np if cp < np
      elsif cp < np
         cp += sp
         cp = np if cp > np
      end    
      @cursor.x = cp if type == 0
      @cursor.y = cp if type == 1
  end  
 
 #--------------------------------------------------------------------------
 # ● Update Logo
 #--------------------------------------------------------------------------           
 def update_logo
     return if @phase != 0
     loop do
        break if  @logo_duration == 0
        execute_logo
        Graphics.update
        Input.update
     end
     play_title_music
 end
 
 #--------------------------------------------------------------------------
 # ● Execute Logo
 #--------------------------------------------------------------------------            
 def execute_logo
     if @logo_duration > 120 and (Input.trigger?:)C) or Input.trigger?:)B))
        @logo_duration = 120
     end 
     @logo_duration -= 1
     if @logo_duration > 120
        @logo.opacity += 5
     else
        @logo.opacity -= 5
     end
     if @logo.opacity <= 0
        @logo_duration = 0
        @phase = 1
     end    
 end
  
 #--------------------------------------------------------------------------
 # ● Update Background
 #--------------------------------------------------------------------------             
 def update_background
     @sprite1.ox += RANDOM_PICTURES_SCROLL_SPEED[0]
     @sprite1.oy += RANDOM_PICTURES_SCROLL_SPEED[1]
     @sprite2.opacity += 2
     @sprite2.update
     return if RANDOM_PICTURES.size < 1
     @rand_title_duration -= 1
     if @rand_title_duration <= 0
        @sprite1.opacity -= 5 unless RANDOM_PICTURES.size < 2
     else
        @sprite1.opacity += 5
     end  
     return if @sprite1.opacity != 0
     execute_random_picture
 end
 
 #--------------------------------------------------------------------------
 # ● Execute Random Picture
 #--------------------------------------------------------------------------             
 def execute_random_picture(initial = false)
     @rand_title_duration = [[60 * RANDOM_PICTURES_DURATION, 9999].min, 60].max
     if @sprite1.bitmap != nil
        @sprite1.bitmap.dispose
        @sprite1.bitmap = nil
     end
     if RANDOM_SELECTION
         rand_pic = rand(RANDOM_PICTURES.size)
         if rand_pic == @old_back_index
            rand_pic += 1
            rand_pic = 0 if rand_pic >= RANDOM_PICTURES.size
         end
         @old_back_index = rand_pic  
     else
         @old_back_index += 1 unless initial
         @old_back_index = 0 if @old_back_index >= RANDOM_PICTURES.size
     end
     pic = RANDOM_PICTURES[@old_back_index]
     @sprite1.bitmap = Cache.title1(pic) rescue nil
     @sprite1.bitmap = Cache.title1("") if @sprite1.bitmap == nil
 end
  
 #--------------------------------------------------------------------------
 # ● Update Light
 #--------------------------------------------------------------------------             
 def update_light
     return unless PARTICLE
     if @light_bitmap != nil
        for i in @light_bitmap
            i.update
        end 
     end  
 end
   
 #--------------------------------------------------------------------------
 # ● Update Initial Animation
 #--------------------------------------------------------------------------              
 def update_initial_animation
     return if @phase != 1
     @phase_time -= 1 if @phase_time > 0
     if @phase_time == 0
        @phase = 2
        @phase_time = 30
     end  
     for i in @commands
        index = 0
        if i.x < COMMANDS_POS[0]
           i.x += 5 + (2 * index)
           i.opacity += 10
           if i.x >= COMMANDS_POS[0]
              i.x = COMMANDS_POS[0]
              i.opacity = 255
              if @phase_time < 15 / 2
                 @phase_time = 15
              end  
           end 
         end
         index += 1
     end 
 end 
 
 #--------------------------------------------------------------------------
 # ● Update Command
 #--------------------------------------------------------------------------             
 def update_command
     return if @phase != 2  
     update_command_slide
     update_cursor_position
     update_flash_select
 end
 
 #--------------------------------------------------------------------------
 # ● Update Command Slide
 #--------------------------------------------------------------------------              
 def update_command_slide
     if @commands_index_old != @command_window.index
        @commands_index_old = @command_window.index
        @commands_shake_duration = 30
        if @flash_select != nil
           @flash_select.opacity = 255
        end  
     end
     return if @commands_shake_duration == 0
     @commands_shake_duration -= 1 if @commands_shake_duration > 0 
     @commands_shake_duration = 0 if !COMMAND_SHAKE
     for i in @commands
       if (i.z - 100) == @command_window.index
          i.opacity += 10
          @cursor_position = [COMMANDS_POS[0] + CURSOR_POS[0],i.y + CURSOR_POS[1]]
          i.x = COMMANDS_POS[0] + rand(@commands_shake_duration)
       else 
          i.opacity -= 7 if i.opacity > 100
          i.x = COMMANDS_POS[0]
       end
     end 
   end
  
 #--------------------------------------------------------------------------
 # ● Update Flash Select
 #--------------------------------------------------------------------------                 
 def update_flash_select
     return if !CURSOR_FLASH_SELECTION
     @flash_select.opacity -= 8
     @flash_select.x = @cursor_position[0] + CURSOR_FLASH_SLECTION_POS[0]
     @flash_select.y = @cursor_position[1] + CURSOR_FLASH_SLECTION_POS[1]    
 end
end


 


$mog_rgss3_animated_title_a = true
 
Last edited by a moderator:
  • Like
Reactions: BCj

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
811
First Language
Hungarian
Primarily Uses
RMVXA
Your spoiler tags are wrong. They should be:


*text here*


Or you can simply click on the spoiler icon in the text editor (that eye looking icon on the right side) and write your text in the little box. 


Anyway...


Do you actually added these new functions to your default command window? 


If you did, you could try this script I wrote:

class Window_Command < Window_Selectable

attr_reader :list

end

class Scene_Title < Scene_Base

def create_commands
@command_max = @command_window.list.size
@command_window.visible = true
@commands_index_old = -1
@commands = []
@commands_shake_duration = 0
@command_window.list.each_with_index do |data,index|
sprite = Sprite.new
sprite.bitmap = Cache.title2(data[:name]) rescue nil
if sprite.bitmap == nil
sprite.bitmap = Bitmap.new(200,32)
sprite.bitmap.font.size = 24
sprite.bitmap.font.bold = true
sprite.bitmap.font.italic = true
sprite.bitmap.draw_text(0, 0, 200, 32, data[:name],1)
end
sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
sprite.z = 100 + index
sprite.opacity = 0
@commands.push(sprite)
end
end

end



I haven't tested this, so no idea if it works or not. It should, judging on Mog's code, but I can't be sure without actually testing it.


Note that the images must be named the same way like the names of your command buttons.


So, if you want to change the image based on some condition, you can add that condition in the default title command script (Window_TitleCommand). You can do it in the make_command_list method (those Vocab::XXX things are the names of the commands).


Depending on where you added these extra options, you will most probably need to add your conditions there instead of the default title window script.
 

AshteriskGaming

Failure
Member
Joined
Jul 28, 2013
Messages
13
Reaction score
1
First Language
English
Primarily Uses
RMMV
Your spoiler tags are wrong. They should be:



*text here*


Or you can simply click on the spoiler icon in the text editor (that eye looking icon on the right side) and write your text in the little box. 


Anyway...


Do you actually added these new functions to your default command window? 


If you did, you could try this script I wrote:

class Window_Command < Window_Selectable

attr_reader :list

end

class Scene_Title < Scene_Base

def create_commands
@command_max = @command_window.list.size
@command_window.visible = true
@commands_index_old = -1
@commands = []
@commands_shake_duration = 0
@command_window.list.each_with_index do |data,index|
sprite = Sprite.new
sprite.bitmap = Cache.title2(data[:name]) rescue nil
if sprite.bitmap == nil
sprite.bitmap = Bitmap.new(200,32)
sprite.bitmap.font.size = 24
sprite.bitmap.font.bold = true
sprite.bitmap.font.italic = true
sprite.bitmap.draw_text(0, 0, 200, 32, data[:name],1)
end
sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
sprite.y = index * sprite.bitmap.height + COMMANDS_POS[1]
sprite.z = 100 + index
sprite.opacity = 0
@commands.push(sprite)
end
end

end



I haven't tested this, so no idea if it works or not. It should, judging on Mog's code, but I can't be sure without actually testing it.


Note that the images must be named the same way like the names of your command buttons.


So, if you want to change the image based on some condition, you can add that condition in the default title command script (Window_TitleCommand). You can do it in the make_command_list method (those Vocab::XXX things are the names of the commands).


Depending on where you added these extra options, you will most probably need to add your conditions there instead of the default title window script.


Thanks; I edited my post with correct tags. Sorry, I'm a bit of a noob to this forum.


Your script kind of just overwrites the commands in the title script when placed below it, and my commands don't even show visually. I'm not sure what you mean by adding the commands; I attempted to add them everywhere, but it hasn't worked. I'm afraid I need more details on where exactly I need to add these. I added them to the Vocab and Window_TitleCommand and it hasn't changed.(Massive scripting noob; sorry.)


Also, within Window_TitleCommand, would it be correct to add the conditional command this way?

add_command(Vocab::qqqqqq,   :qqqqqq, :Return)




I want the qqqqqq one to do nothing, like Continue does when no load is present, and for it to do Return when a condition is met. I haven't really gotten to the conditioning part; I'm just trying to get the commands to work right on the title screen first. I don't want two commands on the screen, but I need two functions within the same slot, that switch depending on that condition. I'm not experienced with coding in Ruby or RGSS, so I'm still lost on what to do half the time. ¯\_(ツ)_/¯


I'll keep trying in the morning. Hopefully I'll figure it out by then.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
811
First Language
Hungarian
Primarily Uses
RMVXA
You wrote that these new commands actually do something, so you either have other scripts which add the functions needed for your new title commands, or you plan to make these options on the title screen, but don't have the necessary new functions for them yet.


If you get these new functions from other custom scripts (so, you have them already in your project), tell us which scripts you use for these, and post a link to these scripts (but don't post the scripts themselves, unless it's really necessary - if the script's terms says that you can not re-post them, you shouldn't post them either way).


If you don't have these functions yet (just planning to add these), than you first need to make the methods necessary for these new stuffs you want, and only after that add your buttons on the title screen. You could add the buttons first, but that won't really help you, because you can't test them that way, you can just see them visually and that's all.


And yes, the point of my script was exactly that, overwriting the method Mog made, because his method is basically a hard-coded, static method (only reading the 3 default commands), while mine gets all your title commands, regardless of how many you have and how you organize them.


Yes, you can add your commands that way, but if you already has these commands added in some other scripts, you don't have to add them at all.


If you need to add them, and want to have a condition as well, you can do this:


if condition == true
add_command("enabled command name",:enabled_command_symbol,true)
else
add_command("disabled command name",:disabled_command_symbol,false)
end


You don't have to read your command names from the Vocab module, you can simply enter their name as a string.


The last arguments there (true and false) set the enable state of the command button. true means that the command is usable, false means it's not.


Let us know if you have these new functions from other script or not, so we know exactly what you need help with.
 

AshteriskGaming

Failure
Member
Joined
Jul 28, 2013
Messages
13
Reaction score
1
First Language
English
Primarily Uses
RMMV
New Game doesn't show it's graphic either; It's just text now. And I still can't get the graphics to show up on the Title screen. Will they only show once I have the commands tied to a script?

Let us know if you have these new functions from other script or not, so we know exactly what you need help with.


I do not have them from a script, no. I basically was trying to put together an extra story, like there is in the Horror RPG, "Misao". After completing the main story (or making all the right choices) you get to play an extra bit. I still haven't figured out how to make it transfer player exp and whatnot, though. Loading a save would actually load the save entirely, I just need to be able to let the player choose their file so they can retain player level, experience, etc. from that save and start the extra story with that info. It would teleport the character to the map and positioning I put in after it does that. So far, I haven't come across any scripts that could do that stuff for me. Everyone seems to have moved to MV now that it has the new resolution and platforming stuff built in, and a lot of scripts are unavailable for download now. :/
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
811
First Language
Hungarian
Primarily Uses
RMVXA
You don't need a script for that.

  1. Let the player finish the game.
  2. Roll the credits, darken the screen, move the player wherever you want, etc...
  3. Turn ON a switch which will indicate that the player completed the game.
  4. Show a message/picture that will explain the player that they can save the game now and load that save file for the extra dungeons/story/whatever.
  5. Force open the save menu.
  6. Wait 1 frame (just in case, it's safer to wait 1 frame after scene changes).
  7. Return the player to the title screen.
  8. Now that the player saved the game, it can be loaded again anytime, with all the data the player had at the end of the game.
  9. Remember that switch you turned ON at step 3? Use that in eventing to do your extra stuffs.
  10. Profit! :p

The command images MUST have the same name as you named these commands, otherwise they will be plain texts. I mentioned this before.


So, if your new game command is named "Neue Play" (just an example :p) your image name must also be "Neue Play".


Which graphics are not showing up exactly? Only the command buttons or others too?


If the other graphics don't show up, you most probably inserted the script at the wrong place or you did a mistake in it's configuration.


The background and such images should show up regardless of your commands.
 
Joined
Aug 1, 2019
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMVXA
You don't need a script for that.

  1. Let the player finish the game.

  2. Roll the credits, darken the screen, move the player wherever you want, etc...

  3. Turn ON a switch which will indicate that the player completed the game.

  4. Show a message/picture that will explain the player that they can save the game now and load that save file for the extra dungeons/story/whatever.

  5. Force open the save menu.

  6. Wait 1 frame (just in case, it's safer to wait 1 frame after scene changes).

  7. Return the player to the title screen.

  8. Now that the player saved the game, it can be loaded again anytime, with all the data the player had at the end of the game.

  9. Remember that switch you turned ON at step 3? Use that in eventing to do your extra stuffs.

  10. Profit! :p


  1. I'm sorry for responding to this considering it's so old but I am trying to do a similar thing and I seen this and it seems to be the only thing that will work. I seen this numbered list of things to do here that seemed to explain how to achieve this goal but when I did it ended up with the event just continuing even after the save is loaded, thus ending with the player getting sent to the title screen even after loading back in, while the screens still black. I'm not sure how this is supposed to be done to get it to work where the screen fades in and the player doesn't get sent to the title screen but I haven't been able to figure it out. I'm sorry if this is obvious and I'm over-thinking, but can you please explain exactly what to do?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,112
Reaction score
11,461
First Language
English
Primarily Uses
RMVXA
[necro]Thatonegamergeek2[/necro]
If the solution given here does not work for you, that almost certainly means that the cause of your problem is not identical to that of the OP.

I suggest you start a new thread, explaining exactly what happens. Details of what events are involved, any script calls, tags, configurations which may impact this are needed so that people have an idea where to start. You can link back to this thread if that helps your explanation.

[mod]Closing this.[/mod]
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

ESAMarathon on Twitch, now streaming "Eat Girl". Yep, that's the title of a game... Apparently it's a Pacman knockoff.... Which is of course the only logical conclusion one would get from a name like "Eat Girl". :kaopride: I can't believe anybody would think anything else! :kaoback:
Super stoked i just finished my first town in my project, by finished i mean i can always add more decorative aesthetics and the NPCs don't talk yet but the mapping is complete and all the important chess pieces are present!
My brain: Hey, I have an idea how to make the transition to the main story quest in The Wastes more natural!
Me: Good!
My brain: You need to remake the hotel you start out in, it's not realistic enough.
Me: Ok... This was unexpected, but I can do it.
My brain: Now make each hotel floor 5 times as large to match the main part. Oh, you also need to make a bunch of new npcs to fill in the space on these maps.
Me: Crap.
Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.

Forum statistics

Threads
100,610
Messages
977,808
Members
132,226
Latest member
iyako
Top