Noob RGSS question

heroscratch

Veteran
Veteran
Joined
Oct 10, 2012
Messages
111
Reaction score
12
First Language
English
Primarily Uses
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.

 


Thank you very much in advance!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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?
 

heroscratch

Veteran
Veteran
Joined
Oct 10, 2012
Messages
111
Reaction score
12
First Language
English
Primarily Uses
'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 :< 
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
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)



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
 

heroscratch

Veteran
Veteran
Joined
Oct 10, 2012
Messages
111
Reaction score
12
First Language
English
Primarily Uses
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)



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!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
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?
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
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:

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 || !@subject.current_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).
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
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
 

heroscratch

Veteran
Veteran
Joined
Oct 10, 2012
Messages
111
Reaction score
12
First Language
English
Primarily Uses
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!
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
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 :original_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
 

heroscratch

Veteran
Veteran
Joined
Oct 10, 2012
Messages
111
Reaction score
12
First Language
English
Primarily Uses
@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!
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
You might check your other scripts for Window_BattleStatus or its superclasses, then, to find out what causes this.
 
Last edited by a moderator:

heroscratch

Veteran
Veteran
Joined
Oct 10, 2012
Messages
111
Reaction score
12
First Language
English
Primarily Uses
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
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
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.
 

heroscratch

Veteran
Veteran
Joined
Oct 10, 2012
Messages
111
Reaction score
12
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
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.
 
Last edited by a moderator:

heroscratch

Veteran
Veteran
Joined
Oct 10, 2012
Messages
111
Reaction score
12
First Language
English
Primarily Uses
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! 
 

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

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top