Fix the formatting of this script

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
196
Reaction score
176
First Language
English
Primarily Uses
N/A
I need the script provided by MeowFace in this thread.
However, the formatting got messed up because of the code box. I'm still not very familiar with formatting scripts. i would appreciate it if someone format it for me. I would PM MeowFace myself but the user hasn't been active since 2016.

The script is also here:
#==============================================================================# ■ Meow Face Weapon & States#------------------------------------------------------------------------------# Display Weapon & States#==============================================================================# How to Use:# Plug & Play, Put this script below Material and above Main#==============================================================================class Window_StateEquip < Window_Base def initialize super(Graphics.width - window_width, 0, window_width, window_height) self.z = 999 self.opacity = 0 draw_equip_icons end def window_width 200 end def window_height fitting_height(1) end def draw_equip_icons draw_icon($game_party.members[0].weapons[0].icon_index, window_width - 48, 0, true) if $game_party.members[0].weapons[0] != nil draw_actor_states($game_party.members[0], window_width - 80, 0, 120) end def draw_actor_states(actor, x, y, width = 120) icons = (actor.state_icons + actor.buff_icons)[0, width / 24] icons.each_with_index {|n, i| draw_icon(n, x - 24 * i, y) } end def update contents.clear draw_equip_icons endendclass Scene_Map < Scene_Base def create_state_equip @stateicon_window = Window_StateEquip.new end alias meow_windows create_all_windows def create_all_windows meow_windows create_state_equip endend
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I haven't tested it, but give this a go:

Code:
#==============================================================================
# ■ Meow Face Weapon & States
#------------------------------------------------------------------------------
# Display Weapon & States
#==============================================================================
# How to Use:
# Plug & Play, Put this script below Material and above Main
#==============================================================================

class Window_StateEquip < Window_Base
    def initialize
        super(Graphics.width - window_width, 0, window_width, window_height)
        self.z = 999
        self.opacity = 0
        draw_equip_icons
    end

    def window_width
        200
    end

    def window_height
        fitting_height(1)
    end

    def draw_equip_icons
        draw_icon($game_party.members[0].weapons[0].icon_index, window_width - 48, 0, true) if $game_party.members[0].weapons[0] != nil 
        draw_actor_states($game_party.members[0], window_width - 80, 0, 120)
    end

    def draw_actor_states(actor, x, y, width = 120)
        icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
        icons.each_with_index {|n, i|
            draw_icon(n, x - 24 * i, y)
        }
    end

    def update
        contents.clear
        draw_equip_icons
    end
end

class Scene_Map < Scene_Base
    def create_state_equip
        @stateicon_window = Window_StateEquip.new
    end
   
    alias meow_windows create_all_windows
    def create_all_windows
        meow_windows
        create_state_equip
    end
end
 

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
196
Reaction score
176
First Language
English
Primarily Uses
N/A
I haven't tested it, but give this a go:
It works perfect but the script only shows the icon on the map. I was wondering if there was a way to show an HUD window behind the icon.
Something like this.

EDIT: Also, is there a way to turn the script off and on?
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
89
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
On line 16 (or somehwere there) is self.opacity. Change the value to 255, and you will see the window. But the window will be wider than the one from your picture, as the equiped weapon and the actor's states share same window, which width is defined on line 21.
 

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
196
Reaction score
176
First Language
English
Primarily Uses
N/A
On line 16 (or somehwere there) is self.opacity. Change the value to 255, and you will see the window. But the window will be wider than the one from your picture, as the equiped weapon and the actor's states share same window, which width is defined on line 21.
Thanks! Now, is there any way for me to hide the window? There's no switch option for it so is there a script call command?
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
89
Reaction score
32
First Language
Bulgarian
Primarily Uses
RMVXA
Try with this edit:
Code:
#==============================================================================
# ■ Meow Face Weapon & States
#------------------------------------------------------------------------------
# Display Weapon & States
#==============================================================================
# How to Use:
# Plug & Play, Put this script below Material and above Main
#==============================================================================

module Display_Weapon_and_States
#============================Settings==========================================

#GGZiron's Edit

# Higher Z value, higher chance to be above everything. If you don't want
#to be above certain things, you can reduce it
  Z_VALUE = 999
# That is th opacity of the window only. 255 for fully visible window layout,
# 0 for transparent window.
  OPACITY = 0
#If you want to hide this window, set the Switch ID (those from event commands)
#you want to use to hide it. When the switch value is false, the window will be
#hidden. When is true, it will be displayed.
#If you want it always visible, set the switch ID to nil
  SWITCH_ID = 1
#==========================End of Settings===========================
end


class Window_StateEquip < Window_Base
    def initialize
        super(Graphics.width - window_width, 0, window_width, window_height)
        self.z = Display_Weapon_and_States::Z_VALUE
        self.opacity = Display_Weapon_and_States::OPACITY
        draw_equip_icons
    end

    def window_width
        200
    end

    def window_height
        fitting_height(1)
    end

    def draw_equip_icons
        draw_icon($game_party.leader.weapons[0].icon_index, window_width - 48, 0, true) if $game_party.leader.weapons[0]
        draw_actor_states($game_party.leader, window_width - 80, 0, 120)
    end

    def draw_actor_states(actor, x, y, width = 120)
        icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
        icons.each_with_index {|n, i|
            draw_icon(n, x - 24 * i, y)
        }
    end

    def update
        contents.clear
        draw_equip_icons
    end
end

class Scene_Map < Scene_Base
    def create_state_equip
        @stateicon_window = Window_StateEquip.new
    end
  alias_method :update_old, :update
  def update
    update_old
    switch_id = Display_Weapon_and_States::SWITCH_ID
    @stateicon_window.visible = $game_switches[switch_id] if switch_id
  end
 
  alias meow_windows create_all_windows
    def create_all_windows
        meow_windows
        create_state_equip
    end
end
If I come with some addition, will update this post. Tell me if it works.
Edit: With my edit, is not Plug & Play anymore. There is newly added settings header.
Edit 2: Did minor touch, improving some expressions of mine.
Edit 3: In case you or someone else is interested, I made addition to the script.
It allows you to set dynamic window width. You can keep with the static as now if you
prefer it. The default settings are set so the script to work as the original one.
Code:
#==============================================================================
# ■ Meow Face Weapon & States
#------------------------------------------------------------------------------
# Display Weapon & States
#==============================================================================
# How to Use:
# Plug & Play, Put this script below Material and above Main
#==============================================================================

module Display_Weapon_and_States
#============================Settings==========================================  

#GGZiron's Edit

# Higher Z value, higher chance to be above everything. If you don't want
#to be above certain things, you can reduce it
  Z_VALUE = 50
# That is th opacity of the window only. 255 for fully visible window layout,
# 0 for transparent window.
  OPACITY = 255
 
#If you want to hide this window, set the Switch ID (those from event commands)
#you want to use to hide it. When the switch value is false, the window will be
#hidden. When is true, it will be displayed.
#If you want it always visible, set the switch ID to nil
  SWITCH_ID = nil
#keep true if you want the window size to fit the number of icons.
#Since the code assume all states will fit in single line, the size is
#window width.
  DYNAMIC_WINDOW_SIZE = true
 
#if the above value is set to false, it will take this one for window's width  
  WINDOW_WIDTH_SIZE = 200  

#==========================End of Settings===========================  
end


class Window_StateEquip < Window_Base
 
    def initialize
      @actor = $game_party.leader
      @dynamic_size = Display_Weapon_and_States::DYNAMIC_WINDOW_SIZE
      @fixed_size = Display_Weapon_and_States::WINDOW_WIDTH_SIZE
      super(Graphics.width - window_width, 0, window_width, window_height)
      self.z = Display_Weapon_and_States::Z_VALUE
      self.opacity = Display_Weapon_and_States::OPACITY
      draw_equip_icons
      resize_window
    end

    def window_width
      return 0 if contents_count <= 0 && @dynamic_size
      @dynamic_size ? ((contents_count + 1) * 24 ) : @fixed_size
    end
   
    def resize_window
      self.width = window_width
      self.x = Graphics.width - window_width
    end

    def window_height
      fitting_height(1)
    end

    def draw_equip_icons
      draw_icon(@actor.weapons[0].icon_index, self.width - 48 , 0, true) if @actor.weapons[0]
      draw_actor_states(@actor.weapons[0] ? 1 : 0)
    end

    def draw_actor_states(icon_x)
      icons = (@actor.state_icons + @actor.buff_icons)
      icons.each_with_index {|n, i|
      draw_icon(n, self.width - ((24) * ( i + 2 + icon_x ) ), y)}
    end
     
    def contents_count
      weapon = @actor.weapons[0] ? 1 : 0
      icons = (@actor.state_icons + @actor.buff_icons)
      return weapon + icons.each_with_index.count
    end

    def update
      contents.clear
      resize_window
      create_contents
      draw_equip_icons
    end
     
end

class Scene_Map < Scene_Base
    def create_state_equip
      @stateicon_window = Window_StateEquip.new
    end
     
  alias_method :update_old, :update
   
    def update
      update_old
      switch_id = Display_Weapon_and_States::SWITCH_ID
      @stateicon_window.visible = $game_switches[switch_id] if switch_id
    end
   
    alias meow_windows create_all_windows
   
    def create_all_windows
      meow_windows
      create_state_equip
    end
   
end
 
Last edited:

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
196
Reaction score
176
First Language
English
Primarily Uses
N/A
Try with this edit:
Code:
#==============================================================================
# ■ Meow Face Weapon & States
#------------------------------------------------------------------------------
# Display Weapon & States
#==============================================================================
# How to Use:
# Plug & Play, Put this script below Material and above Main
#==============================================================================

module Display_Weapon_and_States
#============================Settings==========================================

#GGZiron's Edit

# Higher Z value, higher chance to be above everything. If you don't want
#to be above certain things, you can reduce it
  Z_VALUE = 999
# That is th opacity of the window only. 255 for fully visible window layout,
# 0 for transparent window.
  OPACITY = 0
 
#If you want to hide this window, set the Switch ID (those from event commands)
#you want to use to hide it. When the switch value is false, the window will be
#hidden. When is true, it will be displayed.
#If you want it always visible, set the switch ID to nil
  SWITCH_ID = 1
 
#==========================End of Settings===========================
end


class Window_StateEquip < Window_Base
    def initialize
        super(Graphics.width - window_width, 0, window_width, window_height)
        self.z = Display_Weapon_and_States::Z_VALUE
        self.opacity = Display_Weapon_and_States::OPACITY
        draw_equip_icons
    end

    def window_width
        200
    end

    def window_height
        fitting_height(1)
    end

    def draw_equip_icons
        draw_icon($game_party.leader.weapons[0].icon_index, window_width - 48, 0, true) if $game_party.leader.weapons[0]
        draw_actor_states($game_party.members[0], window_width - 80, 0, 120)
    end

    def draw_actor_states(actor, x, y, width = 120)
        icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
        icons.each_with_index {|n, i|
            draw_icon(n, x - 24 * i, y)
        }
    end

    def update
        contents.clear
        draw_equip_icons
    end
end

class Scene_Map < Scene_Base
    def create_state_equip
        @stateicon_window = Window_StateEquip.new
    end
  
  alias_method :update_old, :update
  
  def update
    update_old
    switch_id = Display_Weapon_and_States::SWITCH_ID
    if switch_id
      $game_switches[switch_id] ? set_meow_visibility(true) : set_meow_visibility(false)
      end
  end
 
  def set_meow_visibility(display)
    display ? @stateicon_window.show : @stateicon_window.hide
    end
 
    alias meow_windows create_all_windows
    def create_all_windows
        meow_windows
        create_state_equip
    end
end
If I come with some addition, will update this post. Tell me if it works.
Edit: With my edit, is not Plug & Play anymore. There is newly added settings header.
It works perfectly how I want it to. Thank you so much!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top