Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

MTool Forum

  1. Home
  2. 错误回报
  3. Monmusu Quest! Paradox RPG 3.06

Monmusu Quest! Paradox RPG 3.06

Scheduled Pinned Locked Moved 错误回报
23 Posts 3 Posters 28 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dnkk
    wrote on last edited by
    #21

    A quick follow up

    Managed to fix the crashing completely, but have no idea why it happens in the first place

    So the current fix is that you have to rename the method being called inside the code snippet I showed

    This is the method that causes the issue -> draw_text_job_desc(r, text, lht)

    And renaming it into anything else fixes the problem

    #--------------------------------------------------------------------------
    # ● ジョブ説明の描画 #Drawing Job Description edited in translation to adjust description font size and text space
    #--------------------------------------------------------------------------
    def draw_job_desc(y, num)
      lht = 24
      desc_text = NWConst::JobChange::JOB_DESC_TEXT[@class_id]
      desc = desc_text[num] if desc_text
      return y + lht unless desc
      lht -= (desc.size - 4) * 2 if desc.size > 4
      lht = 16 if lht < 16
      rect = Rect.new(4, y, contents.width - 4, lht * desc.size)
      r = Rect.new(rect.x, rect.y, rect.width, lht)
      desc.each_with_index do |text, _i|
        draw_text_job_desc2(r, text, lht)
        r.y += lht
      end
      rect.y + rect.height
    end
    
    #--------------------------------------------------------------------------
    # ● ジョブ説明用テキスト描画
    #--------------------------------------------------------------------------
    def draw_text_job_desc2(rect, text, lht)
      reset_font_settings
      text = convert_escape_characters(text)
      pos = { :x => rect.x, :y => rect.y, :new_x => rect.x, :height => lht }
      contents.font.size -= 6 #Sets font size to force word-wrapping and prevent a crash
      process_character(text.slice!(0, 1), text, pos) until text.empty?
    end
    

    As far as I understand Ruby does not allow overloads of methods like in C# or VB (or some other languages as well) and if someone declares a method with the same name, that method then gets overwritten - so perhaps that's why the original name of draw_text_job_desc causes the issues with the new versions of MTool

    Attaching the modified script file just in case - though it's really simple to modify it yourself -> 153 - 転職編集.rb

    The path to this files inside the translation folder from ArzorX is ...\Translated Files\Scripts\画面\

    鬼 1 Reply Last reply
    • D Dnkk

      A quick follow up

      Managed to fix the crashing completely, but have no idea why it happens in the first place

      So the current fix is that you have to rename the method being called inside the code snippet I showed

      This is the method that causes the issue -> draw_text_job_desc(r, text, lht)

      And renaming it into anything else fixes the problem

      #--------------------------------------------------------------------------
      # ● ジョブ説明の描画 #Drawing Job Description edited in translation to adjust description font size and text space
      #--------------------------------------------------------------------------
      def draw_job_desc(y, num)
        lht = 24
        desc_text = NWConst::JobChange::JOB_DESC_TEXT[@class_id]
        desc = desc_text[num] if desc_text
        return y + lht unless desc
        lht -= (desc.size - 4) * 2 if desc.size > 4
        lht = 16 if lht < 16
        rect = Rect.new(4, y, contents.width - 4, lht * desc.size)
        r = Rect.new(rect.x, rect.y, rect.width, lht)
        desc.each_with_index do |text, _i|
          draw_text_job_desc2(r, text, lht)
          r.y += lht
        end
        rect.y + rect.height
      end
      
      #--------------------------------------------------------------------------
      # ● ジョブ説明用テキスト描画
      #--------------------------------------------------------------------------
      def draw_text_job_desc2(rect, text, lht)
        reset_font_settings
        text = convert_escape_characters(text)
        pos = { :x => rect.x, :y => rect.y, :new_x => rect.x, :height => lht }
        contents.font.size -= 6 #Sets font size to force word-wrapping and prevent a crash
        process_character(text.slice!(0, 1), text, pos) until text.empty?
      end
      

      As far as I understand Ruby does not allow overloads of methods like in C# or VB (or some other languages as well) and if someone declares a method with the same name, that method then gets overwritten - so perhaps that's why the original name of draw_text_job_desc causes the issues with the new versions of MTool

      Attaching the modified script file just in case - though it's really simple to modify it yourself -> 153 - 転職編集.rb

      The path to this files inside the translation folder from ArzorX is ...\Translated Files\Scripts\画面\

      鬼 Offline
      鬼 Offline
      鬼才琪露诺
      wrote on last edited by
      #22

      @Dnkk I'm defined this method with this sign: def draw_text_job_desc(rect, text)
      i'll make this functuon defined to float args define.
      with next update.

      1 Reply Last reply
      • D Offline
        D Offline
        Dnkk
        wrote on last edited by
        #23

        Glorious, just tested it and now it works without any modifications to the script 😉

        Seems with some additional research we fixed it 🤜

        1 Reply Last reply
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups