How To Change Windowskins Using RGSS

As the title states, the How To Change Windowskins Using RGSS tutorial is to demonstrate how to change a windowskin using RGSS. Each RPG Maker (RMXP, VX and VXA) handles windowskins slightly differently but the scripting process is essentially the same.

How Windowskins Are Handled

RMXPRMVXRMVXA
Windowskins in RMXP are imported into the Graphics/Windowskins folder. By default, its windowskin name is 001-Blue01. Unlike RMVX and RMVXA, however, a windowskin can be changed (once imported) in the Database under the "System" tab. This definitely makes it easier to select a default windowskin to use throughout a project.
In RMVX, windowskins are usually stored in the Graphics/System folder, with the default named Window. This means that (without using RGSS2) any windowskins you’d like to use must also be imported as Window, which will override the default.
As with RMVX, the default folder to import windowskins is Graphics/System, with the default windowskin also named Window.

In the Database, however, RMVXA allows you to change the colouration of the windowskin to suit the theme and needs of your game. This will override the background image of your chosen windowskin and the colour scheme will be used instead. An easy solution to this is to apply my RMVX to RMVXA Windowskin Patch to overcome this.

Changing Windowskins With RGSS

So to change the default windowskin, import it into the appropriate folder (the filename itself doesn’t matter) and then look for the corresponding lines in Window_Base. Remember that RMVX windowskins are also compatible with RMVXA.

RMXPRMVX/VXA
In RMXP, the following is used to display windowskins:

@windowskin_name = $game_system.windowskin_name
self.windowskin = RPG::Cache.windowskin(@windowskin_name)
All you’d do is change $game_system.windowskin_name to the name of your windowskin (contained in quotes).
In RMVX and RMVXA, the process is exactly the same, using the following:

self.windowskin = Cache.system("Window")
The windowskin filename would be placed within the quotes to replace the default Window one.

Always Alias

It’s always recommended that you use alias as and when you can, rather than directly modifying any of the default scripts. That way it prevents any risks for corrupting the code and makes it easier to modify if something goes wrong.

The following formula is used for alias:

   alias <new name> <old name>
For physically changing the default windowskins through RGSS then, the following aliased methods would be used:

RMXPRMVX/VXA
class Window_Base < Window
  alias cwws_winbs_initialize initialize
  def initialize(x, y, width, height)
    cwws_winbs_initialize(x, y, width, height)
    $game_system.windowskin_name = "windowskin name"
  end
end
class Window_Base < Window
  alias cwws_winbs_initialize initialize
  def initialize(x, y, width, height)
    cwws_winbs_initialize(x, y, width, height)
    self.windowskin = Cache.system("windowskin name")
  end

Leave a Reply