Dynamic Title

● ARCHIVED · READ-ONLY
Started by Yato 20 posts View original ↗

  1. Dynamic Title 1.1
    by Racheal




    Introduction
    This script changes the title screen based on a variable set in-game. This could be used, for example, to add a character to the title screen after you meet them.

    Features

    • Change the background, foreground, or both.
    • Pull the variable from the latest save or the highest from all the saves.
    • Use numbers corresponding to the variable for your images or set the names of the files you would like to use

    How to Use
    Insert the script anywhere in the Materials section above Main.

    Script

    Spoiler
    Code:
    #==============================================================================
    # Dynamic Title
    # by: Racheal
    # Version 1.1
    # Created: 24/06/2013
    # Updated: 27/09/2013
    #==============================================================================
    # Changes the title screen based on a variable set in-game.
    #==============================================================================
    # Instructions:
    # * Insert in the Materials section
    # * Configure to your liking below
    #==============================================================================
    # Compatibility:
    # This script is for RPG Maker VX Ace
    # It is unlikely to work with anything that modifies the way the
    # title screen is drawn such as an animated title screen
    # * Overwrites: Scene_Title: create_background
    #==============================================================================
    
    #==============================================================================
    # Customization
    #==============================================================================
    module Racheal_Title
      #Set which variable controls the change in the title screen
      TITLE_VARIABLE = 5
      
      #Set which parts of the title screen are affected
      CHANGE_BACKGROUND = true
      CHANGE_FOREGROUND = true
      
      #Set whether to check the highest variable in all the save files or
      #just use the most recent save
      CHECK_ALL_SAVES = false
      
      #Set whether to use a series of numbers for the filenames (0.png, 1.png, etc)
      #or a series of names you define below
      USE_FILENAMES = true
      BACKGROUND_NAMES = ["Volcano", "Night"]
      FOREGROUND_NAMES = ["Gargoyles", ""]
    end
    #==============================================================================
    # End Customization
    #==============================================================================
    
    #==============================================================================
    # ** DataManager
    #==============================================================================
    
    module DataManager
      #--------------------------------------------------------------------------
      # * Create Save Header
      #--------------------------------------------------------------------------
      class << self; alias dynamic_title_make_save_header make_save_header; end
      def self.make_save_header
          header = dynamic_title_make_save_header
          header[:title] = $game_variables[Racheal_Title::TITLE_VARIABLE]
          header
      end 
    end
    
    #==============================================================================
    # ** Scene_Title
    #==============================================================================
    
    class Scene_Title < Scene_Base
      #--------------------------------------------------------------------------
      # * Create Background
      #--------------------------------------------------------------------------
      def create_background
        @sprite1 = Sprite.new
        sprite_name = Racheal_Title::CHANGE_BACKGROUND ? get_title(1) : $data_system.title1_name
        @sprite1.bitmap = Cache.title1(sprite_name)
        @sprite2 = Sprite.new
        sprite_name = Racheal_Title::CHANGE_FOREGROUND ? get_title(2) : $data_system.title2_name
        @sprite2.bitmap = Cache.title2(sprite_name)
        center_sprite(@sprite1)
        center_sprite(@sprite2)
      end
      #--------------------------------------------------------------------------
      # * Get Title Sprite Name
      #--------------------------------------------------------------------------
      def get_title(num)
        title = 0
        if Racheal_Title::CHECK_ALL_SAVES
          #Check all saves
          for i in 0...DataManager.savefile_max
            header = DataManager.load_header(i)
            next unless header and header[:title]
            title = [title, header[:title]].max
          end
        else
          #Check latest save
          header = DataManager.load_header(DataManager.latest_savefile_index)
          if header and header[:title]
            title = [title, header[:title]].max
          end
        end
        #---
        if Racheal_Title::USE_FILENAMES
          #convert number to name
          case num
          when 1
            return Racheal_Title::BACKGROUND_NAMES[title]
          when 2
            return Racheal_Title::FOREGROUND_NAMES[title]
          end
        else
          return title.to_s
        end
      end
    end


    Credit
    - Racheal

    Author's Notes
    Free for commercial and non-commercial use. Just credit me (and let me know if you use it, just because). There's really not too much to this script. Version 1.1 features increased compatibility with save systems thanks to estriole's tip.

    As this is a script that modifies the save header, it will not work with saves created before this script was installed.
  2. This. Is cool.
  3. I'm really pleased to see this, and will be using it - if I can work out how.  Trouble is I'm a complete script novice, so I was wondering if you'd mind talking me through what it is I have to do.

    I can see that I use e.g. variable 5.  Let us suppose that I want to introduce the characters into the title screen as the player meets them.  Actor 1 is already present, so can be part of the title screen from the get go.  Actor 2 then comes along.  Presumably I have an image in the Graphics/Pictures folder which I want to incorporate.  How do I set the event so that the variable calls that one up?  Is the process for subsequent actors identical?  What happens if I kill off a character - is it possible to remove a picture from somewhere in the middle of the sequence?

    I'm sorry the questions are so basic, but my knowledge of scripts hovers around the level of an idiot.

    EDIT

    Have I been trying to make this too complicated?  Do I just need a series of title pictures (i.e. the whole thing including the actor/actors) and it's this which is called up, not images to be added to the basic?  If so, I still need to know how to event the variable so that it calls up the correct screen.
  4. Your edit is correct. This doesn't add more images to the title screen; it just changes the ones that exist. You have a few different options to how you want to use it.


    By default, the Ace title screen consists of two images. You can choose to change one, the other, or both. So you could have a image that has the background to the title screen, and then a layer that has all your actors. In that case, you'd probably only want to change the foreground and make that your actor images.


    As far as setting which one for the variable, you have a couple options as well. You can either name the images exactly what the variable will be. So 0 for the beginning of the game, 1 for your next one, etc. You can also set up the array of filenames in the customization section.


    FOREGROUND_NAMES = ["OneActor", "TwoActors", "PlotTwist"]


    So the foreground image would be the file named OneActor when the variable is 0, TwoActors when it is 1, and PlotTwist when it is 2.


    Hopefully this makes sense.
  5. Almost.  I have images named Title01, Title02 etc. (I'm so original!!) which I have put into the appropriate bit of the script.  What I am unsure about is exactly what I input for the event command.  Is it as simple and straightforward as

    select Variable 5

    operation - Add

    operand - 1

    and do that each time that I want the screen to change, so that it moves from e.g. Title02 to Title03?
  6. Correct. That's all there is to it.
  7. Very nice extra do add, you could make the title change a goal within the game, like it is on Chaos Rings, when you defeat PiuPiu.
  8. Racheal said:
    Correct. That's all there is to it.
    Am back home, have tried it all out, and it works perfectly.  Thank you - you have a definite user here!
  9. Hey. I know this is super old but I can't seem to use this script because it is all on one line. I have little scripting knowledge and I don't know how to space it to get it to work. I'd appreciate it if someone could point me to a way to use this.
  10. Unfortunately, when the forum software was switched a while back, this happened to most (all?) scripts posted here. The only way it can be fixed is if the creator fixes it. Probably what I would do is do a google search to see if it is posted somewhere else.
  11. You could also pm Yato and ask her if she would be able to reupload the script or provide a link.
  12. mlogan said:
    Unfortunately, when the forum software was switched a while back, this happened to most (all?) scripts posted here. The only way it can be fixed is if the creator fixes it. Probably what I would do is do a google search to see if it is posted somewhere else.


    I looked everywhere for it but everything would just lead right back to this post. It was a last resort since I have no knowledge of how to script, but I ended up just pressing enter wherever I thought appropriate. Somehow it actually functions the way it's supposed to. So it's fixed now, just using a pretty strange method.
  13. Glad that worked, and glad this was a short script. Unfortunately, some of the scripts this has happened to were very long.
  14. Okay, I'm a complete idiot when it comes to scripts. I've put the script into my script editor, but can anybody help me access it in game?
  15. I'm not sure what you mean by 'access it in game'. However, assuming you mean use it in general -
    1. Go to line 27 and put in there the number of the variable you will be using. Make sure you name the variable so that you don't use it for anything else.
    2. Go to lines 30 and 31. By Background and Foreground, she means whether your images are going to be in Titles1 and/or in Titles2. e.g. If you are using only one image which changes, then put them in Titles2, change line 30 to read false and leave line 31 as true. Adjust this to your actual requirements.
    3. Go to line 35. This is likely to be false.
    4. Go to lines 40 and 41 and put in there the names of the image files you will be using. Make sure each name is inside quote marks and separated from the next by a comma. If you are not using one of the lines, e.g. background, leave the it like this ["", ""] Where you are using one, make sure the titles you put in are exactly the same as the the image file titles.
    Once you've done all that, you're set to go.

    At the point you want the image to change, do an event which increases the variable you designated in line 27 by one. And that's it. You don't need to do anything else. The image will move to the next one in the list you provided at lines 40/41
  16. Oh thanks so much. I'm so used to working with scripts that require the "Script" function in events that I forgot about the normal variables.
  17. Thanks. That's just something I really needed.
  18. Ok I'm prolly the only one who still doesn't understand how to activate it.
    Can anyone lend me a hand here?
  19. @AstraliaAkuma I dont Use VXA but if you check the customization section, you can put
    the image name or you want to use on your title scene, and save the variable into a number.

    if you enter 7 in the section to save, I think the 1st image is variable 7 = 0
    if you have variable 7 = 1, the 2nd title image will show and background image (if set)

    but this is only a guess though, but so far I understand it, thats how it works.
  20. @AstraliaAkuma What @ShadowDragon wrote is correct, I have used this script in several past projects where I wanted the title screen to update showing an image of the party as characters join.

    If it helps, here is how I set it up in one project.

    Code:
    module Racheal_Title
      #Set which variable controls the change in the title screen
      TITLE_VARIABLE = 14
     
      #Set which parts of the title screen are affected
      CHANGE_BACKGROUND = false
      CHANGE_FOREGROUND = true
     
      #Set whether to check the highest variable in all the save files or
      #just use the most recent save
      CHECK_ALL_SAVES = false
     
      #Set whether to use a series of numbers for the filenames (0.png, 1.png, etc)
      #or a series of names you define below
      USE_FILENAMES = true
      BACKGROUND_NAMES = ["", ""]
      FOREGROUND_NAMES = ["Title base01", "Title base02", "Title base03", "Title base04", "Title base05"]
    end

    As you can see, I used variable #14. Change that to the variable you are using.
    I only used one complete image each time, so I did not need to have separate images for the background. That is why CHANGE_BACKGROUND is false and there is ["", ""]. I used the file names, rather than a series of numbers, as there is less chance of messing up.