Custom Variable Window

Discussion in 'RGSS3 Script Requests' started by Tw0Face, Jun 22, 2019.

Thread Status:
Not open for further replies.
  1. Tw0Face

    Tw0Face Chief Executive Officer Veteran

    Messages:
    181
    Likes Received:
    253
    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. :)

    [​IMG]

    Picture taken from rpgmakertimes.blogspot.com.

    Greetings,
    Tw0Face
     
    #1
  2. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,178
    Likes Received:
    10,328
    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.
     
    #2
  3. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,513
    Likes Received:
    324
    Location:
    Canada
    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.
     
    #3
  4. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,178
    Likes Received:
    10,328
    First Language:
    English
    Primarily Uses:
    RMVXA
    @Tw0Face Will you be posting the solution?
     
    #4
  5. Tw0Face

    Tw0Face Chief Executive Officer Veteran

    Messages:
    181
    Likes Received:
    253
    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
     
    #5
  6. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,513
    Likes Received:
    324
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    #6
    tv.ghost likes this.
  7. Tw0Face

    Tw0Face Chief Executive Officer Veteran

    Messages:
    181
    Likes Received:
    253
    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
     
    #7
    tv.ghost likes this.
  8. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    11,623
    Likes Received:
    11,613
    Location:
    USA
    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.

     
    #8
Thread Status:
Not open for further replies.

Share This Page