Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Making scenes that show the Act and Chapter number and title.

What I want is that before every start of the "Act" or "Chapter", a title screen pops up and shows just that.  Also, is it possible to input the Act and Chapter names/numbers into a HUD?
 
Do you mean a title screen in the sense of the Start, Continue, etc? Or do you just mean like a picture on the screen? Because a picture on the screen can be done with the picture event command. Also, the HUD just requires that you use the numbers as variables, though I would recommend that you script it instead of using events.
 
Create an image for every act or chapter, and use the "Show Pictures" command, wait a few frames, then erase it.

For the HUD, create two variables, one for Act and one for Chapter. Every time it's a new chapter, add one to the Chapter variable. Every time it's a new Act, add one to the Act variable and set the Chapter variable to 0.

Now, you can simply script a HUD showing some text and then these two variables. If you need help with RGSS I can move this to that support section for you.
 

Kraft

Sponsor

YOU DONT HAVE TO SCRIPT IT!

XD  you just have to use something like photoshop, GIMP or even paint to create an image that shows Act (#) and scene (#) and have it appear before each scene and act.  You use the show picture command, which is on Page 2 of the event processes that you can run.
 
jjangjae":1cp66k2u said:
Uh, I was talking about the Act and Chapter numbers appearing in the HUD
Hmm... If it for the minimap such as Mr.Moes SBABS, you should name that map Act II- Chapter V.
WHat I do is add a Batch of Act/Chapater Maps and put the maps in there
 
Samhatake":2vxkz8wa said:
jjangjae":2vxkz8wa said:
Uh, I was talking about the Act and Chapter numbers appearing in the HUD
Hmm... If it for the minimap such as Mr.Moes SBABS, you should name that map Act II- Chapter V.
WHat I do is add a Batch of Act/Chapater Maps and put the maps in there

I mean that since the player is able to travel through the world map and each map already has its own name shown in the HUD, I was wondering if it was possible to input the Act and Chapter number into the HUD script.  Since I know its possible, I'm looking for the coding to put it into the script
 
If you're already using a HUD script, posting it would help. If you're not and instead want a HUD scripted from scratch, just say so.

I'm no master at scripting, but I'm sure someone will come along and help.
 
Code:
#==============================================================================


class Window_KHUD < Window_Base
  def initialize
    super(440, 350, 200, 130)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 145 #Change to 0 if you use a picture
    refresh
  end
  def refresh
    self.contents.clear

   #Uncomment these lines if you want a picture instead of window
  #  bitmap = RPG::Cache.picture("khud")
   # self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 175, 175))


    # Displays Gold, Map, and unchanged words
    self.contents.font.size = 14 
    self.contents.font.color = normal_color
    self.contents.draw_text(-32, 54, 120, 32, $game_party.gold.to_s, 2)
    #Show Map Name
    map_infos = load_data("Data/MapInfos.rxdata")
    name = map_infos[$game_map.map_id].name.to_s
    self.contents.draw_text(28, 22, 400, 32, name.to_s)
    self.contents.font.color = system_color
    self.contents.draw_text(-96, 54, 120, 32, $data_system.words.gold, 2)
    self.contents.draw_text(0, 22, 120, 32, "Map")
    self.contents.draw_text(0, 38, 120, 32, "Status")
    
    reset_variables
    return if !@actor
    # Displays actors state, level, EXP and name
    draw_actor_level(@actor, 0, 6)
    draw_actor_state(@actor, 44, 38, width = 120)
    self.contents.font.size = 18
    draw_actor_name(@actor, 0, -10)
    self.contents.font.size = 14
    self.contents.font.color = system_color
    self.contents.draw_text(72, 6, 48, 32, "EXP")
    self.contents.font.color = normal_color
    self.contents.draw_text(76, 6, 84, 32, @actor.exp_s, 2)
  end
  def reset_variables
    @actor = $game_party.actors[0]
    @old_level = @actor ? @actor.level : 0
    @old_exp = @actor ? @actor.exp : 0
  end
  def update
    super
    refresh if (@actor = $game_party.actors[0] or
                @old_level = @actor ? @actor.level : 0 or
                @old_exp = @actor ? @actor.exp : 0 )

  end
end


class Scene_Map
  alias khud_main main
  alias khud_update update
  def main
    @khud = Window_KHUD.new
    khud_main
    @khud.dispose
  end
  def update
    @khud.update
    khud_update
  end
end

that's my current HUD script.
 
Would you be able to post an edited screenshot that shows where in the HUD you want the act/chapeter text to appear? That would be extremely helpful.

EDIT: Never mind, I can just insert them into it as is.
 
jjangjae":2m8vowih said:
Well, I would like it like this:
It would read (after the row that says Gold--

Act [Number of Act]
Chapter [Number of Chapter]

I'll need to change the size of the window to fit them in. Is that OK? Also, is it OK if I move the gold display over to the left so that it is in line with everything else?

Well, I just modified the script, but just tell me if you want to move the other parts back to where they were. Here it is:

Code:
#==============================================================================
class Game_System
  attr_accessor :act
  attr_accessor :chapter
  alias old_init initialize
  def initialize
    old_init
    @act = 1
    @chapter = 1
  end
end

class Window_KHUD < Window_Base
  def initialize
    super(440, 340, 200, 140)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 145 #Change to 0 if you use a picture
    refresh
  end
  def refresh
    self.contents.clear

   #Uncomment these lines if you want a picture instead of window
  #  bitmap = RPG::Cache.picture("khud")
   # self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 175, 175))


    # Displays Gold, Map, and unchanged words
    self.contents.font.size = 14 
    self.contents.font.color = normal_color
    self.contents.draw_text(44, 54, 120, 32, $game_party.gold.to_s)
    #Show Map Name
    map_infos = load_data("Data/MapInfos.rxdata")
    name = map_infos[$game_map.map_id].name.to_s
    self.contents.draw_text(44, 22, 400, 32, name.to_s)
    self.contents.font.color = system_color
    self.contents.draw_text(0, 54, 120, 32, $data_system.words.gold)
    self.contents.draw_text(0, 22, 120, 32, "Map")
    self.contents.draw_text(0, 38, 120, 32, "Status")
    
    reset_variables
    return if !@actor
    # Displays actors state, level, EXP and name
    draw_actor_level(@actor, 0, 6)
    draw_actor_state(@actor, 44, 38, width = 120)
    self.contents.font.size = 18
    draw_actor_name(@actor, 0, -10)
    self.contents.font.size = 14
    self.contents.font.color = system_color
    self.contents.draw_text(72, 6, 48, 32, "EXP")
    self.contents.font.color = normal_color
    self.contents.draw_text(76, 6, 84, 32, @actor.exp_s, 2)
    self.contents.font.color = system_color
    
    # Displays current act and chapter
    self.contents.draw_text(0, 70, 120, 32, "Act")
    self.contents.font.color = normal_color
    self.contents.draw_text(44, 70, 120, 32, $game_system.act.to_s)
    self.contents.font.color = system_color
    self.contents.draw_text(0, 86, 120, 32, "Chapter")
    self.contents.font.color = normal_color
    self.contents.draw_text(44, 86, 120, 32, $game_system.chapter.to_s)
    
  end
  def reset_variables
    @actor = $game_party.actors[0]
    @old_level = @actor ? @actor.level : 0
    @old_exp = @actor ? @actor.exp : 0
  end
  def update
    super
    refresh if (@actor = $game_party.actors[0] or
                @old_level = @actor ? @actor.level : 0 or
                @old_exp = @actor ? @actor.exp : 0 )

  end
end


class Scene_Map
  alias khud_main main
  alias khud_update update
  def main
    @khud = Window_KHUD.new
    khud_main
    @khud.dispose
  end
  def update
    @khud.update
    khud_update
  end
end

To change the chapter or act numbers, just use one of these codes in an event's script command: (I know you'll know which of the two to use when you need it)

Code:
$game_system.act = #
$game_system.chapter = #

You have to replace the # symbol with the number you need.
 
It's great.  I don't see the gold but that's okay though I do wonder why in place of gold it says "id".  I'm not sure if that was supposed to be part of an object id or what not. 
 
jjangjae":33tyx64c said:
It's great.  I don't see the gold but that's okay though I do wonder why in place of gold it says "id".  I'm not sure if that was supposed to be part of an object id or what not. 
It still uses the system word for gold, which means that it must have been changed in your project. Go into the system tab of the database, and check to see if the system word for gold has been changed. (It is under "G (currency):")
 
jjangjae":2s6oqt1s said:
I know.   I checked again and the currency I listed still does not show in-game for the HUD, it still says "id".

Actually, it says ld. I assume you changed the system word to Gold? Its displaying the last half of the word. Anyway, change line 31 to:

Code:
contents.draw_text(44, 54, 120, 32, $game_party.gold.to_s)

And change line 37 to:

Code:
contents.draw_text(0, 54, 120, 32, $data_system.words.gold)

I've updated the edited code I posted as well.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top