Custom Variable Window

Status
Not open for further replies.

Tw0Face

Chief Executive Officer
Veteran
Joined
Nov 12, 2018
Messages
362
Reaction score
340
First Language
German
Primarily Uses
RMVXA
Hi. :)

I just wanted to ask if there's a script for RM Vx Ace that can just display me a couple of custom variables. I want to order them in categories, pretty much in the picture shown below.

Instead of System Stats, Battle Stats etc. I want to display stuff like Resources, Buildings, Units etc. so I want to display either custom variables or Items (e.g. by ID). I need the ability to call this with a Scriptcall. I need to display icons as well, so for example \i[xx]Wood: 0.

Can someone help me out with this? I'm sure this could be pretty useful for a lot of people out there. :)



Picture taken from rpgmakertimes.blogspot.com.

Greetings,
Tw0Face
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,854
Reaction score
11,066
First Language
English
Primarily Uses
RMVXA
@Tw0Face Before closing this it would be helpful if you could post the solution you found. As you say, it could be useful for a lot of people.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,226
Reaction score
456
First Language
English
Primarily Uses
RMVXA
I would like to know if there is a script that does this as well.
Unless it was a commission.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,854
Reaction score
11,066
First Language
English
Primarily Uses
RMVXA
@Tw0Face Will you be posting the solution?
 

Tw0Face

Chief Executive Officer
Veteran
Joined
Nov 12, 2018
Messages
362
Reaction score
340
First Language
German
Primarily Uses
RMVXA
I won't post it public until I get permission from the creator. Until then, please have some patience. :)

Greetings,
Tw0Face
 

Tw0Face

Chief Executive Officer
Veteran
Joined
Nov 12, 2018
Messages
362
Reaction score
340
First Language
German
Primarily Uses
RMVXA
Ok, here you go. The script is made by Boros. Best to give him some credits if you use it. The editable region is written in German. Though, the setup shouldn't be too hard to understand. ;) I hope you can benefit from it.

Code:
#==============================================================================
# INFO WINDOW
# - Version 1.0, Juni 2019
# - by Boros
# - for RPGMaker VX Ace
# - free for Non-Commercial and Commercial use
#
#
# Es können 6 Abschnitte definiert werden.
# Aufbau eines Abschnitts:
# 1. Wert = ID des Schalters, wenn AN wird der Abschnitt angezeigt
# 2. Wert = Überschrift
# 3. Wert = Anzahl der Zeilen in diesem Abschnitt
# 4.-x. Wert = Zeile, bestehend aus Schalter_ID, Icon-ID, Text, Art und
#              Variablen-ID oder Zahl
#              Art = V(ariable), Z(ahl), N(ichts)
#==============================================================================

module INFO
  IN_MENU = true             #<-- Menüeintrag ja/nein
  MENU_NAME = "Übersicht"    #<-- Bezeichnung im Menü
  ABS_WECHSEL = 3            #<-- Spaltenwechsel nach x Abschnitten

  C_UEB = 17    #<-- Farbe der Überschrift
  C_KAT = 0     #<-- Farbe der Kategorie
  C_WERT = 16   #<-- Farbe des Wertes
  C_LINIE = 16  #<-- Farbe der Linie

  #Definition der Abschnitte
  ABS  = [] #<-- nicht ändern

  ABS[0] = [1,                        #<-- Schalter-ID (Anzeige bei ja)
            "Allgemein",              #<-- Überschrift
            4,                        #<-- Anzahl Zeilen
            [1,236, "???", "V", 11],  #<-- Zeile (Schalter-ID, Icon, Text, Art, Variablen-ID oder Zahl)
            [1,236, "???", "Z", 7],
            [2,236, "???", "N", 0],
            [1,236, "???", "N", 11]
           ]
        
  ABS[1] = [2,
            "Lagerbestand",
            4,
            [2,298, "Essen", "V", 12],
            [2,287, "Trinken", "V", 13],
            [2,331, "Holz", "V", 21],
            [2,350, "Stein", "V", 22]
           ]

  ABS[2] = [2,
            "Rucksackinhalt",
            4,
            [2,298, "Essen", "V", 12],
            [2,287, "Trinken", "V", 13],
            [2,331, "Holz", "V", 21],
            [2,350, "Stein", "V", 22]
           ]
  ABS[3] = [1,
            "Gebäude",
            4,
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11]
           ]
  ABS[4] = [1,
            "Einheiten",
            4,
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11]
           ]
  ABS[5] = [1,
            "Sonstiges",
            4,
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11],
            [1,236, "???", "V", 11]
           ]

end

class Scene_Menu < Scene_MenuBase
  alias add_infowindow_menu_entry create_command_window
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    add_infowindow_menu_entry
    @command_window.set_handler(:uebersicht, method(:command_uebersicht)) if INFO::IN_MENU
  end

  #--------------------------------------------------------------------------
  # * Scriptcall
  #--------------------------------------------------------------------------
  def command_uebersicht
    SceneManager.call(Scene_Uebersicht)
  end
end

class Window_MenuCommand < Window_Command
  alias add_info_menu_entry add_main_commands
  #--------------------------------------------------------------------------
  # * Menu Command
  #--------------------------------------------------------------------------
  def add_main_commands
    add_info_menu_entry
    add_command(INFO::MENU_NAME, :uebersicht) if INFO::IN_MENU
  end
end

class Scene_Uebersicht < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    @uebersicht_window = Window_Uebersicht.new
    @uebersicht_window.set_handler(:cancel,   method(:return_scene))
  end
end

class Window_Uebersicht < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, Graphics.width, Graphics.height)
    refresh
    activate
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
 
    wx = contents_width / 2 - 10
    x = 0
    y = 0
    anz = 0
 
    #Schleife über die Abschnitte
    for i in 0..5
      #Prüfung, ob Schalter auf ja
      if $game_switches[INFO::ABS[i][0]] == true
        #Überschrift und Trennlinie
        contents.font.size = 20
        change_color(text_color(INFO::C_UEB))
        draw_text(x, y, wx, 36, INFO::ABS[i][1], 1)
        contents.fill_rect(x, y+30, wx, 1, text_color(INFO::C_LINIE))
        contents.font.size = 18
        y = y+36
        bis = 2 + INFO::ABS[i][2]
        #Schleife über die Zeilen
        for j in 3..bis
          if $game_switches[INFO::ABS[i][j][0]] == true
            change_color(text_color(INFO::C_KAT))
            draw_icon(INFO::ABS[i][j][1], x, y)
            draw_text(x+30, y, wx, line_height, INFO::ABS[i][j][2], 0)
            change_color(text_color(INFO::C_WERT))
            case INFO::ABS[i][j][3]
            when "V"
              draw_text(x, y, wx-10, line_height,
                      $game_variables[INFO::ABS[i][j][4]], 2)
            when "Z"
              draw_text(x, y, wx-10, line_height, INFO::ABS[i][j][4], 2)
            when "N"
            end      
            y = y+20
          end
        end
        y = y+10
        #Spaltenwechsel
        anz = anz + 1
        if anz == INFO::ABS_WECHSEL
          x = contents_width / 2
          y = 0
        end
      end
    end
  end

end

Greetings,
Tw0Face
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
12,961
Reaction score
13,317
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

The video of a psycho chasing people on the streets with a sword before getting subdued is wild. Apparent screenshots of his Twitter feed before it went private reveal a dangerous delusional mindset. I heard there was a bow person too. The crazies are really coming out of the woodworks.
Stream will be live shortly with some Witcher 3, followed by a session of the Interactive Text Adventure! Feel free to drop by!
Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...

Forum statistics

Threads
97,993
Messages
948,401
Members
129,255
Latest member
RPGLordLight
Top