Monster Hunter Rise
0 of 0

File information

Last updated

Original upload

Created by

Natoler

Uploaded by

Natoler

Virus scan

Safe to use

86 comments

  1. Natoler
    Natoler
    • member
    • 8 kudos
    Locked
    Sticky
    Updated to ver 5.0

    If you don't like the critical display, element damage display, etc., try editing lines 129 to 158 of [HardOrSoft.lua].
    If the damage is "Gray", no additional damage notation, such as a critical indication, can be added.
  2. SSVAV
    SSVAV
    • member
    • 6 kudos
    I fixed a major performance issue for this mod while customizing it to my liking.
    Instead of hooking the execute method, that is updated several times per frame, this version only hooks once per damage text to display.
    I have added my code below so that you may use it for a future version if you wish. It is missing functionality that I didn't care about but the logic remains mostly the same.


    local config = {}
    local damageNumDisp
    local damageResult
    local damageCalcParam
    local damageTable = {}
    local currentVersion = 1.0

    local function Reset()
        config.Version = currentVersion;
        config.Enable = true;
        config.BuddyDamageHide = false;
        config.CriticalDisplay = false;
        config.ElementDisplay = false;
        config.ChangeFont = false
        config.FontType = 0;
    end

    local function SaveConfig()
        config.Version = currentVersion
        json.dump_file("DamageDisplay.json", config);
    end

    local function LoadConfig()
        loadConfig = json.load_file("DamageDisplay.json")
        if loadConfig ~= nil then
            config = loadConfig
        end
        if config.Version ~= currentVersion then
            Reset()
            SaveConfig()
        end
    end

    local function getDamageStats(damageTable, damageValue)
        for i = 1, #damageTable do
            if damageTable[i][1] == damageValue then
                local retval = damageTable[i]
                table.remove(damageTable, i)
                return retval
            end
        end
        return {0, 0, 0, 0}
    end

    LoadConfig()

    re.on_config_save(function()
        SaveConfig()
    end)

    sdk.hook(sdk.find_type_definition("snow.gui.GuiDamageDisp.NumDisp"):get_method("startNumDisp"), function(args)
        if not config.Enable then
            return
        end
        damageNumDisp = sdk.to_managed_object(args[2])
    end, function(retval)
        if not config.Enable then
            return retval
        end
        local text = damageNumDisp._DamageText
        local damageStats = getDamageStats(damageTable, tonumber(text:get_Message()))
        if damageNumDisp.DispType == -1 or damageNumDisp.DispType == 3 then
            return retval
        end
        local damageDispValue = text:get_Message()
        local newDamageDispValue = damageDispValue
        if config.CriticalDisplay then
            if damageStats[4] == 1 then
                newDamageDispValue = newDamageDispValue .. "!"
            elseif damageStats[4] == 2 then
                newDamageDispValue = newDamageDispValue .. "?"
            end
        end
        if config.ElementDisplay and damageStats[3] ~= 0 then
            newDamageDispValue = newDamageDispValue .. " (" .. math.floor(damageStats[3]) .. ")"
        end
        if config.ChangeFont then
            text:set_FontSlot(config.FontType)
        else
            text:set_FontSlot(1)
        end
        if damageDispValue ~= newDamageDispValue then
            text:set_Message(newDamageDispValue)
        end

        return retval
    end)

    sdk.hook(sdk.find_type_definition("snow.enemy.EnemyUtility"):get_method("getHitUIColorType"), function(args)
        if not config.Enable then
            return
        end
        damageResult = sdk.to_managed_object(args[2])
        damageCalcParam = damageResult._CalcParam
        local dmg = damageResult:get_TotalDamage()
        local physical = damageResult:get_PhysicalDamage()
        local element = damageResult:get_ElementDamage()
        local critical = damageResult:get_CriticalResult()
        table.insert(damageTable, 1, {dmg, physical, element, critical})
    end, function(retval)
        if config.Enable and config.BuddyDamageHide then
            local ownerType = damageCalcParam:get_OwnerType()
            if ownerType == 5 or ownerType == 6 then
                return sdk.to_ptr(-1);
            end
        end
        return retval
    end)

    re.on_draw_ui(function()
        if imgui.tree_node("Damage Display") then
            local changed = false;
            local configChanged = false;

            changed, config.Enable = imgui.checkbox("Enabled", config.Enable);
            if changed then
                configChanged = configChanged or changed;
            end

            changed, config.BuddyDamageHide = imgui.checkbox("Hide Buddy Damage", config.BuddyDamageHide);
            if changed then
                configChanged = configChanged or changed;
            end

            changed, config.CriticalDisplay = imgui.checkbox("Display Critical Hits", config.CriticalDisplay);
            if changed then
                configChanged = configChanged or changed;
            end

            changed, config.ElementDisplay = imgui.checkbox("Display Elemental Damage", config.ElementDisplay);
            if changed then
                configChanged = configChanged or changed;
            end

            changed, config.ChangeFont = imgui.checkbox("Change Font", config.ChangeFont);
            if changed then
                configChanged = configChanged or changed;
            end

            changed, config.FontType = imgui.slider_int("Font Type", config.FontType, 0, 15);
            if changed then
                configChanged = configChanged or changed;
            end

            if imgui.button("Reset") == true then
                Reset()
                SaveConfig()
            end

            if configChanged then
                SaveConfig();
            end

            imgui.tree_pop()
        end
    end)

  3. dan988
    dan988
    • member
    • 0 kudos
    Lovely mod ty so much!its great to been able to see how much job its doing element ,change the color of explosions, change the font tipes,the display timers and hide your budies damage.one thing i would improve its changing the crits with bigger number maybe or outlines for the numbers.Anyway great mod a must have.Support this guy he diserves it.works perfectly on title uptade 4 u can even install it while the game its running just press reset scripts under the script runner tab.
  4. foxinvictus
    foxinvictus
    • member
    • 0 kudos
    Hi, thanks for the mod!
    Is there a way to change the color of Non-Critical Hits (Switch Axe Phial Bursts and Charge Blade Phial Damage) into Blue?
  5. lynnmarie
    lynnmarie
    • member
    • 9 kudos
    Seems like TU4 broke this
  6. Meestur
    Meestur
    • member
    • 0 kudos
    Hi, I was wondering what lines 136 - 137 do after seeing the question marks and how it differs from 134-135. Thank you so much for the mod and happy new year!

     134                       if v.critical == 1 then
     135                           msg = msg .. "!"
     136                       elseif v.critical == 2 then
     137                           msg = msg .. "?"
  7. HeavyMetalLoser
    HeavyMetalLoser
    • member
    • 0 kudos
    can you please add an option for Large White text? I like using color for raw and size for element, and the only one I can't do that for right now is element weakpoints that don't trigger wex or mind's eye.
  8. Midknight910
    Midknight910
    • member
    • 0 kudos
    May I ask how can I make the number appear like mhw (have a X around the numbers) instead of a exclamation mark behind the numbers when I Crit. Really great mod though !
  9. garbim11012001
    garbim11012001
    • member
    • 0 kudos
    this works when a monster attacks the other or when we are controlling them wyverm riding
  10. Miep1234
    Miep1234
    • member
    • 0 kudos
    Is there a way to change the size of the numbers displayed?
    1. Natoler
      Natoler
      • member
      • 8 kudos
      The size can be changed but the display will be a bit unnatural.
      For this reason I did not add that feature.
      If you must, try adding the following sentence between lines 120 and 121 for ver 5.0.
      Changing the default of 35 will change the size.
         local size=text:call("get_FontSize")
         size:set_field("w",35)
         size:set_field("h",35)
         text:call("set_FontSize",size)
  11. sweettoothGTX
    sweettoothGTX
    • member
    • 0 kudos
    on a totally different subject than the mod mentioned, I GOTTA KNOW what is the blood mod ur using when ur fighting the rajang  (shown in the IMAGES tab)? looks really nice! 
    1. tiborandrasi1988
      tiborandrasi1988
      • member
      • 0 kudos
      Should be this one. You might have missed it if you have adult filters on Increase bleeding effects at Monster Hunter Rise - Nexus mods and community