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.

[A] Simple Menu (easy) - Crepusculum

CERU

Member

Hi guys. I've been making Crepusculum, and I think the game could really benefit from a simplified menu. It's pretty, well, simple. Not that complicated. I DO have SDK, but I deleted the menu portion. My menu is now an edit of the original. If you would like to see the script for it, ask and I'll post it.

I've created an image to show what I want:

http://i109.photobucket.com/albums/n45/ ... PUMENU.png[/IMG]

1. The most important thing, is disabling a 2nd character from appearing in the menu. If someone could show me how to do this, that would be great (whether it be from adding it on, or modifying a previous part of the script.

2. Now, see those two pictures that simulate health and battery power? If someone would help me do this, I need it so that it will allow me to display images based on the HP or SP the character has (or a variable thats based on HP or SP). I'll be using four images each.

3. And I'll really love you if you can find a way to make the background transparent, so it shows what was going on when the game was paused.

You can do 1,2, or 3, but I need 1 the most. One way that I was thinking that this could be done would be by creating a new status window, that would only have Alexis and would be able to display the health images that I wanted.

If you can help me I'd greatly appreciate it!
 

CERU

Member

hima;111144 said:
I can help with all of them. Just give me a script and I'll get back to you :) (But it may take me a while since I'm having final exam this week ^ ^;)

Thank you! Take all the time you need (unless its like .. forever). I'll post the script here once I fix that little gap I have in the picture. :)
 

Abbey

Member

Someone else will have to edit it to show the pictures. Right now, it still shows the numbers. Add as a new script above main.
class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 640, 480 - 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.color = Color.new(0, 0, 0, 255)
refresh
self.active = false
self.index = -1
end

def refresh
self.contents.clear
@item_max = $game_party.actors.size
x = 64
y = 0
actor = $game_party.actors[0]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x - 64, y)
draw_actor_hp(actor, x, y + 30)
draw_actor_sp(actor, x, y + 50)
end

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end


class Scene_Item
alias Abbey_ItemScene_Main main
alias Abbey_ItemScene_Update update
def main
@help_window = Window_Help.new
@help_window.opacity = 155
@item_window = Window_Item.new
@item_window.help_window = @help_window
@item_window.opacity = 155
@target_window = Window_Target.new
@target_window.opacity = 155
@target_window.visible = false
@target_window.active = false
@sprite = Spriteset_Map.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@item_window.dispose
@target_window.dispose
end

def update
@help_window.update
@item_window.update
@target_window.update
@sprite.update
if @item_window.active
update_item
return
end
if @target_window.active
update_target
return
end
end
end


class Scene_End
alias Abbey_EndScene_Main main
alias Abbey_EndScene_Cancel command_cancel
alias Abbey_EndScene_Update update

def main
s1 = "Go To Title"
s2 = "End Game"
s3 = "Back To Menu"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 240 - @command_window.height / 2
@command_window.opacity = 155
@sprite = Spriteset_Map.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
end

def update
@command_window.update
@sprite.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1)
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_to_title
when 1
command_shutdown
when 2
command_cancel
end
return
end
end

def command_cancel
$game_system.se_play($data_system.decision_se)
$scene = Scene_Menu.new(1)
end
end




class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end

def main
s1 = "Item"
s2 = "End Game"
@command_window = Window_Command.new(640, [s1, s2])
@command_window.opacity = 155
@command_window.index = @menu_index
@sprite = Spriteset_Map.new
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
end
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 96
@status_window.opacity = 155

Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@sprite.dispose
@status_window.dispose
end

def update
@command_window.update
@sprite.update
@status_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end

def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = Scene_End.new
end
return
end
end

def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
end
end

Give credit if you want. I'm new to aliasing, so someone else can probably shorten it a little. Besides, this was more of a test to see what I could do (not that CMSs like this are hard :P)
I even made the item and end windows translucent.

Only the first character will show up (if you ask me, it looks very empty :P)

So I've done parts one and three for whoever wants to finish this.

I'm not sure if it's SDK compatible, but since you took that part out, it should be. If not, someone else can change it.
 

CERU

Member

Abbey;113304 said:
Someone else will have to edit it to show the pictures. Right now, it still shows the numbers. Add as a new script above main.
Give credit if you want. I'm new to aliasing, so someone else can probably shorten it a little. Besides, this was more of a test to see what I could do (not that CMSs like this are hard :P)
I even made the item and end windows translucent.

Only the first character will show up (if you ask me, it looks very empty :P)

So I've done parts one and three for whoever wants to finish this.

I'm not sure if it's SDK compatible, but since you took that part out, it should be. If not, someone else can change it.


Thank you very much. I'll test it out right now!

Note: I am a firm believer in giving credit where credit is due, which is frustrating because I can not use some resources that would be very useful to me, simply because sites such as zanyzora's seem to steal without giving credit (I can prove that at least a few of the tilesets were stolen, and edited). So you can bet that I will give you credit.
 

CERU

Member

Okay, it works, but it doesn't work. It shuts down. And I didn't see the problem of the darkness coming up, as the pictures that make the darkness overlap the menu. And because the darkness is supposed to follow the character, I think it gets confused, and it shuts down.

So maybe a transparent screen is not possible. However, the character fix may be possible, if I can pinpoint which part that is.

Nonetheless, thank you for your effort. I do appreciate it.
 

CERU

Member

hima;113996 said:
Have you fixed the little gap? I just want to tell you that I'm done with my finals and am ready to help you :)

Yes. Here it is:

Code:
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = "End Game"
    @command_window = Window_Command.new(640, [s1, s2])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 90
    @status_window.back_opacity = 250
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 1  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end
 
It's done.
http://download.yousendit.com/66A3E89364FC194B


Here are the screenshots.
http://img.photobucket.com/albums/v628/ ... o/Clip.jpg[/IMG]


http://img.photobucket.com/albums/v628/ ... Clip_2.jpg[/IMG]


How To Use
Replace your scene_menu with the one in the project. Copy all the pictures file in Picture folder from the project into your game. And everything should be fine. Should you find any problems, please tell me.


I won't mess with the other part since I do not know what do you want them to be like in your game, but if you need any help , just ask. :)
 

CERU

Member

hima;115010 said:
It's done.
http://download.yousendit.com/66A3E89364FC194B

How To Use
Replace your scene_menu with the one in the project. Copy all the pictures file in Picture folder from the project into your game. And everything should be fine. Should you find any problems, please tell me.


I won't mess with the other part since I do not know what do you want them to be like in your game, but if you need any help , just ask. :)

Thank you so much! You've really been a lifesaver. I'll try and implement it into my game tommorow (I'm very busy tonight).
 

CERU

Member

There's one last thing I need done now. The problem can be solved via one of two methods:

1. Make it so that pictures TEMPORARILY do not appear when the menu is up.
2. Make it so that the screen tone is changed to a much lighter tone TEMPORARILY when the menu is up (preferable).

Can we do this Hima? x.x
 
Hmm I don't quite understand what are you trying to do ^ ^;; You want to hide the pictures on the map?

I'll try the second one, taking it as you mean brighten up the game screen (and not the menu.) If I'm mistaken, please correct me :)
 

CERU

Member

hima;125087 said:
Hmm I don't quite understand what are you trying to do ^ ^;; You want to hide the pictures on the map?

I'll try the second one, taking it as you mean brighten up the game screen (and not the menu.) If I'm mistaken, please correct me :)

I want to hide the pictures on the map if possible, but that sounds like its confusing so lets just bright the game screen only when the menu comes up.

Or we could make it so it displays a 640x480 image in the background instead of the paused gameplay. Could we do that? Would this be a simple task?

Thank you for all your support.
 
Hmm I'll do three of them and let you decide then. About the first one, by hiding the pictures, you mean the pictures from Show Pictures command? Or simply everything on the screen?

In scene_menu, find this comment and replace them by this.
Code:
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    $game_screen.update
    @command_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
    tone = Tone.new(0,0,0,0)
    $game_screen.start_tone_change(tone,5 * 2)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end


In Scene_Map , replace the old call_menu by this one
Code:
  #--------------------------------------------------------------------------
  # - Call of menu
  #--------------------------------------------------------------------------
  def call_menu
    tone = Tone.new(100,100,100,0)
    $game_screen.start_tone_change(tone,0 * 2)
    # Clearing the menu call flag
    $game_temp.menu_calling = false
    # When the menu SE performance flag is set
    if $game_temp.menu_beep
      # Performing decision SE
      $game_system.se_play($data_system.decision_se)
      # Clearing the menu SE performance flag
      $game_temp.menu_beep = false
    end
    # Reforming the attitude of the prayer
    $game_player.straighten
    # Change to menu screen
    $scene = Scene_Menu.new
  end
 

CERU

Member

hima;128808 said:
Hmm I'll do three of them and let you decide then. About the first one, by hiding the pictures, you mean the pictures from Show Pictures command? Or simply everything on the screen?

I like the effect I achieved with changing the color, but one more thing is needed and that is the picture issue. To answer your question, I would like to hide the show-pictures, but not everything on the screen.

thank you for all of Your help btw.
 

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