Menu back opacity / Equipment menu call

CuddleFox

Furry
Veteran
Joined
Feb 18, 2017
Messages
116
Reaction score
40
First Language
French
Primarily Uses
RMVXA
Hi, I have two problems with Ace. As indicated in the title. Since these are two problems that I think the solution is simple, but I don't know it, I only make one post about them.

First problem: I program a custom menu, I would like to make the player choose an actor to open his equipment menu. Unfortunately, SceneManager.call(Scene_equip) only opens the first actor's call.
Second problem: I would like there is no longer any blur or opacity in the background when I open the inventory or another menu. I managed to remove the blur, but where can I change the opacity?

Thank you in advance.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
594
First Language
Italian
Primarily Uses
RMVXA
SceneManager.call(Scene_equip) only opens the first actor's call.
You have to change the value of the actor ID first. You can do that using the following script call:
Code:
$game_party.menu_actor = $game_actors[ID]
I would like there is no longer any blur or opacity in the background when I open the inventory or another menu. I managed to remove the blur, but where can I change the opacity?
You have to change the back_opacity attribute of your menu window. If you want to take a look at the documentation you have to look for the "Window" class.
Code:
class Window_Base < Window
  alias hrk_init_old initialize
  def initialize(wx, wy, ww, wh)
    hrk_init_old(wx, wy, ww, wh)
    self.back_opacity = 255
  end
end
The code above changes it for every single window in the game (just copy/paste it below Materials in your script editor). If you don't want that to happen for certain window classes, you have to be more specific.
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,295
Reaction score
11,710
First Language
English
Primarily Uses
RMVXA
Please note that there are a couple of reasons why we ask people to post one thread for one query, and give meaningful titles.

Very often when there are more than one query in a thread, it becomes confusing, and sometimes hard to work out which bit people are replying to. We have seen threads where the OP misunderstood the instructions completely because they thought that a piece of advice applied to one query when in fact it was for the other. In this particular thread that hasn't happened and you received clear and unambiguous advice, but that cannot be guaranteed for the future. It also means that if one query can be solved with events/script call but the other requires a script, the thread cannot be moved to Script Requests.

Linked with the need for a clear thread is also the need for a clear topic title that gives some indication of the actual query. This helps people looking at New Posts to decide if this is something they might be able to help with - with non-descriptive titles many people just move on. It also means that people who have the same query as you can find the thread and (hopefully) the solution. At the moment a search would not bring up this thread, and so they would probably have to start a new one.
 

CuddleFox

Furry
Veteran
Joined
Feb 18, 2017
Messages
116
Reaction score
40
First Language
French
Primarily Uses
RMVXA
Okay, I changed the title. I'll be careful next time.

You have to change the back_opacity attribute of your menu window. If you want to take a look at the documentation you have to look for the "Window" class.
When I talk about the background, I mean that. When the window opens, the game takes a snapshot from the background and places it behind the window. How to put its opacity to the maximum?



$game_party.menu_actor = ID
It didn't work, I get an error message:



I put it in script call.

Code:
$game_party.menu_actor = 2
SceneManager.call(Scene_Equip)
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
594
First Language
Italian
Primarily Uses
RMVXA
It didn't work, I get an error message
My bad, ID should not be a number, it should be the the real actor. If you are doing that for actor 2, then the call is this:
Code:
$game_party.menu_actor = $game_actors[2]
I also changed this in the previous post so that people looking at this thread can find the solution faster.

When I talk about the background, I mean that. When the window opens, the game takes a snapshot from the background and places it behind the window. How to put its opacity to the maximum?
If you are fine with using the same background (or not using any) for all your menus, you can use this script. It also allows you to use a custom image as your menu background.
Code:
#===============================================================================
# HEIRUKICHI CUSTOM MENU BACKGROUND
#===============================================================================
# Version 1.0.0
# - Author: Heirukichi
# - Last update 06-02-2019 [MM-DD-YYYY]
#===============================================================================
# TERMS OF USE
#-------------------------------------------------------------------------------
# You are free to use this script in both commercial and non commercial games as
# long as proper credit is given to me (Heirukichi).
# Feen free to edit this script as much as you like as long as you do not
# pretend you wrote the whole script and you distribute it under the same
# license.
#
# Attribution-ShareAlike 4.0 International: https://creativecommons.org/licenses/by-sa/4.0/
#
# In addition to this I would like to be notified when this script is used in a
# commercial game. As the license says the usage of this script is free. The
# notification is only used to keep track of games where it is being used.
# You can send me a private message on RPG Maker Forums @Heirukichi.
# While doing this is not mandatory please do not forget about it.
# It helps a lot. Of course feel free to notify me when you use it for
# non-commercial games as well (if you feel like doing it).
#===============================================================================
# DESCRIPTION
#-------------------------------------------------------------------------------
# This script allows you to show a custom background image for menus. The same
# image is going to be used for each menu. It also allows you to remove that
# image (and the default one as well) and show nothing at all behind your menu.
#===============================================================================
# INSTRUCTIONS
#-------------------------------------------------------------------------------
# Instructions on how to configure this script can be found in the CONFIG module
# below.
#===============================================================================
# COMPATIBILITY
#-------------------------------------------------------------------------------
# The script should not have any compatibility issue with other scripts. However
# be sure to place it BELOW any other script that OVERWRITES one of the aliased
# methods.
# If any script you are using aliases one of the new methods in this script, be
# sure to place this one ABOVE that script.
#-------------------------------------------------------------------------------
# Classes and methods (* = aliased, + = new, ! = overwritten)
#-------------------------------------------------------------------------------
# Scene_MenuBase
# * create_background (Aliased method)
# * dispose_background (Aliased nethod)
# + hrk_create_custom_bg (New method)
#===============================================================================

module HRK_MBG
 
  module CONFIG
 
    #===========================================================================
    # Set SWITCH_ID to be the real switch id of the switch you want to use to
    # tell the engine if the background image has to be shown or not.
    # Default is 50
    #===========================================================================
    SWITCH_ID = 50 # Change this to be your switch id
    DEFAULT_VALUE = true # Set this to false if you want a background by default
 
    #===========================================================================
    # Set CUSTOM_IMAGE to true if you want to use a custom background image for
    # menus. If it is set to true, you have to set a file name for the image you
    # want to use. Images should be saved in "Graphics/System/".
    #===========================================================================
    CUSTOM_IMAGE = false
    IMAGE_NAME = "menu_bg"

    #===========================================================================
    # Set CUSTOM_TINT to true if you want to have a different tint for the background sprite.
    # When set to true, change BACKGROUND_TINT accordingly
    #===========================================================================
    BACKGROUND_TINT = [0, 0, 0, 255] # Red, Green, Blue, Opacity
    CUSTOM_TINT = true
 
  end # end of CONFIG module
 
  #=============================================================================
  # - - WARNING! - - Any modification after this point might prevent the script
  # from working properly. Do it at your own risk.
  #=============================================================================
  # * True when using the background image for menus.
  #-----------------------------------------------------------------------------
  def self.using_bg?
    $game_switches[CONFIG::SWITCH_ID] == CONFIG::DEFAULT_VALUE
  end
 
  #-----------------------------------------------------------------------------
  # * True when using a custom background
  #-----------------------------------------------------------------------------
  def self.custom_bg?
    CONFIG::CUSTOM_IMAGE
  end
 
  #-----------------------------------------------------------------------------
  # * Returns the file path of custom background images
  #-----------------------------------------------------------------------------
  def self.menu_bg
    sprintf("Graphics/System/%s", CONFIG::IMAGE_NAME)
  end

  #-----------------------------------------------------------------------------
  # * Returns true if a custom background tint is being used
  #-----------------------------------------------------------------------------
  def self.bg_custom_tint?
    CONFIG::CUSTOM_TINT
  end

  #-----------------------------------------------------------------------------
  # * Custom background tint value
  #-----------------------------------------------------------------------------
  def self.bg_tint
    CONFIG::BACKGROUND_TINT
  end
 
  #-----------------------------------------------------------------------------
  # * Cached bitmap
  #-----------------------------------------------------------------------------
  def self.img
    if @bg_img.nil?
      @bg_img = Bitmap.new(menu_bg)
    else
      @bg_img = Bitmap.new(menu_bg) if @bg_img.disposed?
    end
    @bg_img
  end
 
end # end of HRK_MBG module

#===============================================================================
# * Scene_MenuBase class
#===============================================================================
class Scene_MenuBase < Scene_Base
 
  #-----------------------------------------------------------------------------
  # * Aliased method: create_background
  #-----------------------------------------------------------------------------
  alias hrk_create_bg_old create_background
  def create_background
    if HRK_MBG.using_bg?
      HRK_MBG.custom_bg? ? hrk_create_custom_bg : hrk_create_bg_old
      if HRK_MBG.bg_custom_tint?
       t = HRK_MBG.bg_tint
       @background_sprite.color.set(t[0], t[1], t[2], t[3])
      end
    end
  end
 
  #-----------------------------------------------------------------------------
  # + New method: hrk_create_custom_bg
  #-----------------------------------------------------------------------------
  def hrk_create_custom_bg
    @background_sprite = Sprite.new
    @background_sprite.bitmap = HRK_MBG.img
  end
 
  #-----------------------------------------------------------------------------
  # * Aliased method: dispose_background
  #-----------------------------------------------------------------------------
  alias hrk_dispose_bg_old dispose_background
  def dispose_background
    hrk_dispose_bg_old if HRK_MBG.using_bg?
  end
 
end
 
Last edited:

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
594
First Language
Italian
Primarily Uses
RMVXA
All that remains is the problem of the opacity of the backgrounds.
Did you check the script I sent you in the previous message? Because if you want it to be black the one I sent you does the trick.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,647
Reaction score
562
First Language
English
Primarily Uses
RMVXA
opacity to the maximum?
This means fully visible, correct?
Then a simple replacement of the create_background numbers will do the trick.
Code:
class Scene_MenuBase < Scene_Base
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = SceneManager.background_bitmap
    @background_sprite.color.set(0, 0, 0, 0)
  end
end
If you want to adjust this more then follow this guide
(0, 0, 0, 0)
(red, green, blue, opacity)
Opacity = 0 = fully visible background
Opacity = 255 = black background
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
594
First Language
Italian
Primarily Uses
RMVXA
@Umbreon what @Roninator2 said is true. If you want it fully visible instead of black, then you have to set the opacity to 255. I added a few customization parameters to the script above, if you use that, you can easily configure them and change them whenever you want.
 

CuddleFox

Furry
Veteran
Joined
Feb 18, 2017
Messages
116
Reaction score
40
First Language
French
Primarily Uses
RMVXA
So do you want it to be black or fully visible?
Fully visible.
Did you check the script I sent you in the previous message? Because if you want it to be black the one I sent you does the trick.
No, I don't.
class Scene_MenuBase < Scene_Base
def create_background
@background_sprite = Sprite.new
@background_sprite.bitmap = SceneManager.background_bitmap
@background_sprite.color.set(0, 0, 0, 0)
end
end
It works perfectly, thank you ^^
 

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

Latest Threads

Latest Profile Posts

um... why didn't anyone tell how easy it is to add motions to Sideview battlers? I literally copied the last one, changed the name and index, said where it should play, and boom... I've got intro motions.
Lately when I listen to 1970s songs, I always think that the "real world" is still at mid 70s. What we experience now is a futuristic dream. With this point of view, even 80s and 90s looks super futuristic. :D

The GIF of this seemed too cool to bury in replies. :LZSwink:
You may have slept with my aunt... but, given the circumstances, cheers.

- Professor Ian Duncan, 2013

Forum statistics

Threads
105,538
Messages
1,014,464
Members
137,219
Latest member
Lamand
Top