N.A.S.T.Y Replace Window with Picture

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
N.A.S.T.Y. Replace Window with Picture
By: Nelderson


Introduction
This script uses pictures instead of windows you specify.  While this looks very simple, for the Photoshop nerds this will be invaluable. 

Features
- Have a picture instead of the default window.
- Use pictures on only the windows you want

- Should be compatible with most custom scripts and windows

Screenshots



Same pictures, with opacity taken down in Photoshop


How to Use

-Configure the PICWINDOW Hash. It should work with not only default windows, but custom windows from other scripts as well.

 

-If you want to know how big your window is to make a picture, the best way is to look at the initialize method on each window class.  It is usually in the format (x, y, width, height).  So the picture you need to make should be the same width and height.  Or another way is to find out the dimensions is to take a screenshot of your game window.  And then with photoshop, or something similar, select the box and look at how big the dimensions are in the select window.

 

 

Demo
I'll make one if you guys want one!

Script

#===============================================================================#           N.A.S.T.Y. Replace Window with Picture#               Nelderson's Awesome Scripts To You# By: Nelderson# Made On: 3/11/2015# Last Updated: 3/12/2015#===============================================================================# Update History:# - Version 0.5 - Initial Release - Technically BETA/Tesing Stage# - Version 1.0 - Fixed issues with the Message window and added#                 feature to change picture to a window with a script call#===============================================================================# *Notes:#  -This script uses pictures instead of windows you specify.#===============================================================================# Credits:# -Nelderson#===============================================================================#  Instructions:##  -Configure the PICWINDOW Hash below. It should work with not only #   default windows, but custom windows from other scripts as well.##  -If you want to know how big your window is to make a picture,#   the best way is to look at the initialize method on each window#   class.  It is usually in the format (x, y, width, height).#   So the picture you need to make should be the same width and height.##  -You can change the pic of the window you want by using the script call:#     change_nelwinpic(window, "pic") #        Where window is the class and pic is the name in the pictures folder.#        Ex. change_nelwinpic(Window_Gold, "Gold")#===============================================================================# Take the Window Class name => Name of the "picture" in the Pictures folder # Example:# Window_Gold => "Gold",module NEL    PICWINDOW ={   # <=== Do Not Remove      Window_Message => "BlueMessage",  Window_Gold => "BlueGold",  Window_MenuStatus => "BlueStatus",  Window_MenuCommand => "BlueCommand",  Window_NameInput => "pic4",  Window_NameEdit => "blah",          }# <=== Do Not Removeend#==============================================================================##                            END OF CUSTOMIZATION                              ##==============================================================================#class Game_System  attr_accessor :nelpicwindow  alias nel_winpic_sysinit initialize  def initialize    nel_winpic_sysinit    @nelpicwindow = {}    for i in NEL::pICWINDOW      @nelpicwindow[i[0]] = i[1]    end  endendclass Window_Base < Window  attr_accessor :nelwinpic  alias nel_winpic_scrpt_init initialize  def initialize(*args)    nel_winpic_scrpt_init(*args)    create_nelpicture  end    def create_nelpicture    for i in $game_system.nelpicwindow    #Stupid Gold Window....    next if SceneManager.scene_is?(Scene_Map) && self.instance_of?(Window_Gold)    next if SceneManager.scene_is?(Scene_Battle) && self.instance_of?(Window_Gold)    next if i[1] == nil #In case in game is changed.  Goes back to default      if self.instance_of?(i[0]) ###Where all the magic happens!###        @nelwinpic = ::Sprite.new(self.viewport)        @nelwinpic.visible = false        @nelwinpic.bitmap = Cache.picture(i[1])        @nelwinpic.x = self.x        @nelwinpic.y = self.y        @nelwinpic.opacity = self.opacity        self.opacity = 0      end    end  end    alias nel_winpic_scrpt_dispose dispose  def dispose    if @nelwinpic != nil      @nelwinpic.bitmap.dispose      @nelwinpic = nil    end    nel_winpic_scrpt_dispose  end    alias nel_winpic_srpt_update update  def update    nel_winpic_srpt_update    if @nelwinpic != nil      @nelwinpic.x = self.x      @nelwinpic.y = self.y      @nelwinpic.viewport = self.viewport      @nelwinpic.visible = self.visible      if self.instance_of?(Window_Message) && $game_system.nelpicwindow[Window_Message] != nil        @nelwinpic.visible = $game_message.visible        self.opacity = 0      end    end  endend  class Game_Interpreter  def change_nelwinpic(window, pic)    $game_system.nelpicwindow[window] = pic    if SceneManager.scene_is?(Scene_Map)       SceneManager.goto(Scene_Map) if window == Window_Message    end  endend

FAQ

Q: What does N.A.S.T.Y. stand for?
A: Nelderson's Awesome Scripts To You!

Credit and Thanks
- Nelderson

Terms of Use: 

Free to use for non-commercial use.  Any commercial use is fine as long as you credit and throw me a copy of your completed game if it ever gets finished  :)
 
Last edited by a moderator:

MECM

Villager
Member
Joined
Jun 16, 2014
Messages
11
Reaction score
2
First Language
Spanish
Primarily Uses
Really;this is a treasure for PS maniacs. Thanks.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
This looks like it will be invaluable.  What are your terms of use?
 

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
Terms of Use: 

Free to use for non-commercial use.  Any commercial use is fine as long as you credit and throw me a copy of your completed game if it ever gets finished :)
 

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,905
Reaction score
451
First Language
April Fools
Primarily Uses
N/A


OMFG You always could see right into my mind a make the exact script I was needing!!! <3 your mad skills still my old friend!!
 

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
Version 1.0 Update:  Now includes a script call to change any window.  You use this before a scene is called, and the pic will change accordingly.
 
  • Like
Reactions: Kes

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
Fixed the script format bcz I'm bored
Code:
#===============================================================================
#           N.A.S.T.Y. Replace Window with Picture
#               Nelderson's Awesome Scripts To You
# By: Nelderson
# Made On: 3/11/2015
# Last Updated: 3/12/2015
#===============================================================================
# Update History:
# - Version 0.5 - Initial Release - Technically BETA/Tesing Stage
# - Version 1.0 - Fixed issues with the Message window and added
#                 feature to change picture to a window with a script call
#===============================================================================
# *Notes:
#  -This script uses pictures instead of windows you specify.
#===============================================================================
# Credits:
# -Nelderson
#===============================================================================
#  Instructions:
#
#  -Configure the PICWINDOW Hash below. It should work with not only 
#   default windows, but custom windows from other scripts as well.
#
#  -If you want to know how big your window is to make a picture,
#   the best way is to look at the initialize method on each window
#   class.  It is usually in the format (x, y, width, height).
#   So the picture you need to make should be the same width and height.
#
#  -You can change the pic of the window you want by using the script call:
#     change_nelwinpic(window, "pic") 
#        Where window is the class and pic is the name in the pictures folder.
#        Ex. change_nelwinpic(Window_Gold, "Gold")
#===============================================================================
# Take the Window Class name => Name of the "picture" in the Pictures folder 
# Example:
# Window_Gold => "Gold",

module NEL    
  PICWINDOW ={   # <=== Do Not Remove      
    Window_Message => "BlueMessage",  
    Window_Gold => "BlueGold",  
    Window_MenuStatus => "BlueStatus",  
    Window_MenuCommand => "BlueCommand",  
    Window_NameInput => "pic4",  
    Window_NameEdit => "blah",
  } # <=== Do Not Remove
end

#==============================================================================
#
#                            END OF CUSTOMIZATION                              
#
#==============================================================================
class Game_System  
  attr_accessor :nelpicwindow  
  
  alias nel_winpic_sysinit initialize  
  def initialize    
    nel_winpic_sysinit    
    @nelpicwindow = {}    
    for i in NEL::PICWINDOW      
      @nelpicwindow[i[0]] = i[1]    
    end  
  end
end

class Window_Base < Window  
  attr_accessor :nelwinpic  
  
  alias nel_winpic_scrpt_init initialize  
  def initialize(*args)    
    nel_winpic_scrpt_init(*args)    
    create_nelpicture  
  end    
  
  def create_nelpicture    
    for i in $game_system.nelpicwindow    #Stupid Gold Window....    
      next if SceneManager.scene_is?(Scene_Map) && 
        self.instance_of?(Window_Gold)    
      next if SceneManager.scene_is?(Scene_Battle) && 
        self.instance_of?(Window_Gold)    
      next if i[1] == nil #In case in game is changed.  Goes back to default      
      if self.instance_of?(i[0]) 
        ###Where all the magic happens!###        
        @nelwinpic = ::Sprite.new(self.viewport)        
        @nelwinpic.visible = false        
        @nelwinpic.bitmap = Cache.picture(i[1])        
        @nelwinpic.x = self.x        
        @nelwinpic.y = self.y        
        @nelwinpic.opacity = self.opacity        
        self.opacity = 0      
      end    
    end  
  end
  
  alias nel_winpic_scrpt_dispose dispose  
  def dispose    
    if @nelwinpic != nil      
      @nelwinpic.bitmap.dispose      
      @nelwinpic = nil    
    end    
    nel_winpic_scrpt_dispose  
  end    
  
  alias nel_winpic_srpt_update update  
  def update    
    nel_winpic_srpt_update    
    if @nelwinpic != nil      
      @nelwinpic.x = self.x      
      @nelwinpic.y = self.y      
      @nelwinpic.viewport = self.viewport      
      @nelwinpic.visible = self.visible      
      if self.instance_of?(Window_Message) && 
        $game_system.nelpicwindow[Window_Message] != nil        
        @nelwinpic.visible = $game_message.visible        
        self.opacity = 0      
      end    
    end  
  end
end  

class Game_Interpreter  
  def change_nelwinpic(window, pic)    
    $game_system.nelpicwindow[window] = pic    
    if SceneManager.scene_is?(Scene_Map)       
      SceneManager.goto(Scene_Map) if window == Window_Message    
    end  
  end
end
 

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

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,881
Messages
1,017,227
Members
137,607
Latest member
Maddo
Top