Longer skill description in menu and in battle?

Discussion in 'RGSS3 Script Requests' started by Cuddlebuns, Oct 8, 2019.

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

    Cuddlebuns Veteran Veteran

    Messages:
    30
    Likes Received:
    4
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Two short lines of text is asinine. I need a larger window to display skill descriptions in both the menu and during a battle.

    Any help would be greatly appreciated!
     
    #1
  2. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,256
    Likes Received:
    519
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    This is not something you can do with events. Both those windows are created within their respective scene so you need a script that changes how those windows are initialized and how many lines they can display.
     
    #2
  3. Soulrender

    Soulrender Veteran Veteran

    Messages:
    225
    Likes Received:
    110
    First Language:
    Poland
    Primarily Uses:
    RMMV
    Save this as plugin and add to your game.
    Edit all variables to your likings.
    Code:
    Window_Help.prototype.initialize = function(numLines) {
        if (SceneManager.isSceneBattle()){
            /* This will create a window description the same as in Warcraft 3 */
            /* while you are in battle Assuming that game resolution is set to 1280x720 */
            var leftPos = 760;
            var UpperPos = 188;
            var WinXSize = 520;
            var WinYSize = 220;
          
            Window_Base.prototype.initialize.call(this, LeftPos, UpperPos, WinXSize, WinYSize);
            this._text = '';
        }
        else
            {
                /* default window */
                var leftPos = 0;
                var UpperPos = 0;
                var WinXSize = Graphics.boxWidth;
                var WinYSize = this.fittingHeight(numLines || 2);
          
                Window_Base.prototype.initialize.call(this, 0, 0, width, height);
                this._text = '';
            }
        };
    
    It will look like this in Battle
     
    #3
  4. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,256
    Likes Received:
    519
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    @Soulrender this is a VX thread, JavaScript is not gonna work.
     
    #4
  5. Soulrender

    Soulrender Veteran Veteran

    Messages:
    225
    Likes Received:
    110
    First Language:
    Poland
    Primarily Uses:
    RMMV
    Oh my! I didn't notice, but as far I know the difference is not that much.
     
    #5
  6. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,970
    Likes Received:
    10,663
    First Language:
    English
    Primarily Uses:
    RMVXA
    Wrong, it is a big difference as it is a different language from that of Ace which uses Ruby. Therefore it will not work.

    I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

     
    #6
  7. Cuddlebuns

    Cuddlebuns Veteran Veteran

    Messages:
    30
    Likes Received:
    4
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Would scripting this be particularly difficult to accomplish? I've seen Shiggy's extended item and weapon description script, but it does not appear to apply to skills, which is frustrating, to say the least.


    Code:
    class Scene_Item < Scene_ItemBase
    
      alias description_extension_start start
      def start
        description_extension_start
       
        create_description_window
      end
    
      def create_description_window
        @description_window = Window_Item_Description.new
        @description_window.z = 300
        @description_window.back_opacity = 255
    
        @description_window.hide
       
      end
    
      def unexpand
        @description_window.hide
        @item_window.activate
      end
    
      alias description_extension_create_item_window create_item_window
      def create_item_window
        description_extension_create_item_window
        @item_window.set_handler(:expand,     method(:on_item_expand))
      end
    
      def on_item_cancel
        if @description_window.visible
            @description_window.hide
            @item_window.activate
        else
          @item_window.unselect
          @category_window.activate
        end
      end
    
      def on_item_expand
         if @description_window.visible
            @description_window.hide
            @item_window.activate
        else
          @description_window.show
          @description_window.get_description(@item_window.item)
        end
      end
    
    end
    
    class Window_Item_Description < Window_Base
    
      def initialize
        super(0,0,Graphics.width,200) # <==== change window position and size
      end
    
      def get_description(item)
        contents.clear
        return unless item
        text = item.note.scan(/<\s*description\s*:\s*([^>]+)>/)
        if text[0]
          draw_text_ex( 0 , 0 , text[0][0])
        else
          draw_text_ex( 0 , 0 ,item.description)
        end
      end
    
    end
    
    class Window_ItemList < Window_Selectable
    
    def process_handling
      return unless open? && active
        return process_ok       if ok_enabled?        && Input.trigger?(:C)
        return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
        return process_pagedown if handle?(:pagedown) && Input.trigger?(:R)
        return process_pageup   if handle?(:pageup)   && Input.trigger?(:L)
      return process_description if Input.trigger?(:Z)  #<===== change which button to press to show window
    end
    
    def process_description
      call_handler(:expand)
    end
    end

    Could something be appended or replaced in the script to allow for an additional window that displays longer skill descriptions?
     
    #7
  8. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,256
    Likes Received:
    519
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    It is quite easy to achieve actually. I would do it myself, but I am very busy lately and I am afraid that a long time will pass before I have time to do it.
     
    #8
  9. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,970
    Likes Received:
    10,663
    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.

     
    #9
Thread Status:
Not open for further replies.

Share This Page