Noob RGSS question

How can I change window opacity ONLY during battle? I.e. the window in the circled area would be invisible, while the window that displays battle options remains visible.

 
battleexample_zpsfn1ypzfs.png


Thank you very much in advance!
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.


You want the WHOLE window to be invisible? Including the actor name, HP, MP, TP? Or just the background?
'I want every last bit of the window gone. The only thing I want left is the character name, stats, etc. I actually have my own hud for it, I just can't get the default box to go away!' 

Sorry for the double'ish post. Totally made it in the wrong section so I just wrote up a new one. Wish I knew how to abort a post awaiting approval :< 
Making the window itself transparent is easy. Hiding the borders requires changing the windowskin. You'll have to save this graphic to your System folder (thanks to AlexxanderX for the image)

window2.png
window2.png


There's a second one there as well if you need one with arrows.

Then paste this as a new script above main:

class Window_BattleStatus < Window_Selectable

  alias heroscratch_init initialize

  def initialize

    heroscratch_init

    self.back_opacity = 0

    self.windowskin = Cache.system("Window2")

  end

end
Making the window itself transparent is easy. Hiding the borders requires changing the windowskin. You'll have to save this graphic to your System folder (thanks to AlexxanderX for the image)

window2.png
window2.png


There's a second one there as well if you need one with arrows.

Then paste this as a new script above main:

class Window_BattleStatus < Window_Selectable

  alias heroscratch_init initialize

  def initialize

    heroscratch_init

    self.back_opacity = 0

    self.windowskin = Cache.system("Window2")

  end

end
Hmm, I tried everything you said and still no go, that window border is still there. Any ideas? I feel like I might be doing something wrong or dumb. I simply added the new graphic to my system folder (graphic system), and added the script in above main as suggested.

Ty again for the quick response!
Change the W in Window2 to a small w. Don't know if that'll fix it but it's worth a try.

Also, do you have any other scripts running that might be changing the windowskin?
The circled window is the status window. In scripting terms, it's @status_window under Scene_Battle.

If your custom hud is implemented independently from @status_window and it's not using Window_BattleStatus, you can just hide or close it, or even prevent it from opening/showing.

Unless there are some other custom scripts, the below should do the job:

Spoiler
class Scene_Battle < Scene_Base def start_party_command_selection unless scene_changing? refresh_status @status_window.unselect #@status_window.open if BattleManager.input_start @actor_command_window.close @party_command_window.setup else @party_command_window.deactivate turn_start end end end def process_action return if scene_changing? if !@subject || [email protected]_action @subject = BattleManager.next_subject end return turn_end unless @subject if @subject.current_action @subject.current_action.prepare if @subject.current_action.valid? #@status_window.open execute_action end @subject.remove_current_action end process_action_end unless @subject.current_action endend
The above snippet can create many compatibility issues though 🙂

If your custom hud window is implemented via @status_window or it's using Window_BattleStatus, you'll have to deal with Window_BattleStatus and its superclasses(although using Luna Engine might work as well).
That is not a custom HUD. It's the default battle status window (RTP).

Just change the opacity of the window.

Code:
class Window_BattleStatus < Window_Selectable  alias initialize_clear_window initialize  def initialize    initialize_clear_window    self.opacity = 0    self.back_opacity = 0  endend
This does not require any of the things mentioned above, so if you've tried several of them and they don't work, and this does, remove the other changes you made.
Huh, I thought self.opacity affected the contents as well; I was originally going to include that but didn't think it would work (incidentally I think just opacity is working fine; you don't need to set back_opacity to 0 if opacity is). Oh well, forget the windowskin stuff. XD
That is not a custom HUD. It's the default battle status window (RTP).

Just change the opacity of the window.

class Window_BattleStatus < Window_Selectable alias initialize_clear_window initialize def initialize initialize_clear_window self.opacity = 0 self.back_opacity = 0 endendThis does not require any of the things mentioned above, so if you've tried several of them and they don't work, and this does, remove the other changes you made.
Sorry, I really am using a HUD. It sounds dumb, but I didn't post a direct battle pic (I was kinda hoping I could just showcase the CBS I've switched over to via a new demo release), BUT, here goes!

I simply want the system skin behind the portraits to be gone. I like the box with "attack" etc the way it is, so I only want to change the status window. I was kinda hoping that there was simply a system script I had to simply alter a few numbers on to get the desired effect. So I was looking around in Scene_Battle, Window_Status etc, but I'm not quite savvy enough to figure it out.

Also, thanks a ton for all the replies! I wish I weren't such a script noob sometimes. Hoping my programming classes this semester pay off!

PS. Shaz, I tried your code, but I still have the same problem. I'm wondering; am I supposed to apply the script you listed above 'main' as well, or is this an edit to a broader system script? Thanks again!
1) Place the attached file in your Graphics/System folder (or a similar file, just make sure that background and border have been removed)

2) Place the following script above Main, but under everything else:

class Window_BattleStatus < Window_Selectable  alias 😮riginal_initialize :initialize  def initialize    original_initialize    self.windowskin = Cache.system("WindowBlank")  endendWorks for me, both with the normal system and DoubleX's ECATB.

Make sure that the filename and this line match:

self.windowskin = Cache.system("WindowBlank")If you also want the selector to be hidden, you have to modify the skin further (in my case, removing the blue box left above the color palette)

WindowBlank.png
@lavra I tried that and I still have the darn box.

I changed the name of the file to the name of the line of code; (I'm actually using the same name as in your example, "WindowBlank"). My Graphic/System name is "WindowBlank.png". I have everything spelled out just right with proper capitalization etc just to be sure. I'm so clueless as to why it won't work; I know a LITTLE about coding, and can certainly load 3rd party scripts/edit them with ease as long as the comments are good etc. I just can't get THIS to work... yet.

Again, thanks for the reply!
You might check your other scripts for Window_BattleStatus or its superclasses, then, to find out what causes this.
You might check your other scripts for Window_BattleStatus or its superclasses, then, to find out what causes this.
Yeah, I'll have to figure this out... I have a feeling I know what script might be doing it. I tried what you gave me on a blank project and it worked just fine. If I try it in my demo or the demo the cbs I'm using came with it's a no go. Has to be in one of their scripts... hm... all notes are in Japanese on it. lol
If it's free to share, you could post the script here, so other people can take a look at it. For starters, a search for "windowskin" might show you that it is set in a later method, thus overriding the script above, or something similar.
If it's free to share, you could post the script here, so other people can take a look at it. For starters, a search for "windowskin" might show you that it is set in a later method, thus overriding the script above, or something similar.
From what I've been able to make out, it seems this person allows commercial use for free etc.
This part here displays your background image:

def create_actor_background    return if LNX11::ACTOR_BACKGROUND == 0    viewport = actor_viewport    height = LNX11::ACTOR_BACKGROUND_HEIGHT    case LNX11::ACTOR_BACKGROUND    when 1      # グラデーション      @actor_background = Sprite.new      back = Bitmap.new(Graphics.width, height)      color = LNX11::ACTOR_BG_GRADIENT_COLOR      back.gradient_fill_rect(back.rect, color[0], color[1], true)      @actor_background.bitmap = back    when 2      # ウィンドウ      @actor_background = Window_Base.new(0, 0, Graphics.width, height)    else      if LNX11::ACTOR_BACKGROUND.is_a?(String)        # ファイル指定        @actor_background = Sprite.new        @actor_background.bitmap = Cache.system(LNX11::ACTOR_BACKGROUND)        @actor_background.x = Graphics.width / 2        @actor_background.ox = @actor_background.bitmap.width / 2        height = @actor_background.bitmap.height      end    end    @actor_background.viewport = viewport    @actor_background.y = Graphics.height - height    @actor_background.z = viewport == @viewport1 ? 120 : -20    update_actor_background  endIm currently too sleepy to work something out and since the script relies a lot on graphics i can't put up a test case, but i would try to work with this method.

Putting a fully transparent image for LNX11::ACTOR_BACKGROUND could be an easy solution.

/edit: I found the following line:

ACTOR_BACKGROUND        = 2According to the part above, it should create a simple window, which in turn uses the windowskin value. You could try debugging the method with msgbox() or p sprintf() (if console enabled) calls, to see which values it receives.

Or try setting ACTOR_BACKGROUND to 0, since the whole method should be skipped in this case.
Or try setting ACTOR_BACKGROUND to 0, since the whole method should be skipped in this case.
I was going to reply and say that I just set it to 0 and it worked, but you beat me to it with an edit! Thanks for the awesome lead. Extremely happy that it worked! 

Original thread: https://forums.rpgmakerweb.com/threads/noob-rgss-question.38939/