If in your environment the mod doesn't work after hours passed, use the new uploaded 1.1-perframe version. In 1.1-perframe version, the mod will heal you per frame, makes the value no precise.
You can't heal with v1.1 if you are in Unmoored World for a while because the game clock is paused at 23:59.
mod is not working for me at all. i tried both versions, i tried manually installing it and i tried installing it using fluffy. it shows up in the insert menu and lets me edit the values but it no healing occurs at all. is the mod outdated ? :'(
I am also experiencing this issue as of late. It was working earlier today during my playthrough and just stopped working. I've deleted and re-installed both versions the mod page recommended and still to no avail. I also used the other versions the mod page has, and still It does no healing for me. I just hope I'm not bugged out from this mod in some way :(
I'm keeping an eye out every day for a mod that simply restores the capability of healing items to also heal the loss gauge. The system worked great in DD1, I don't know why they wanted to force that whole "You MUST rest!" system on us
FWIW there is a potion that restores full health alongside removing loss gauge. It's called All Heals or something similar to that, but those potions are pretty rare.
Look, any "curative" should be able to recover the loss gauge. That's what they are for, it was like that for the first game, why suddenly change the rules now because of the pathetic camping system?
Is this "Monster Hunter: Redemption" now, or Dragons Dogma? It's like Japanese game developers are so stuck up in the past and just can't move on, or afraid of moving on "fun" wise.
It wouldn't be as bad if every goblin nick didn't decrease your max HP. It's absurd that you only get to fight at max power for literally a single fight or two (so like 5 minutes of gameplay) before your black HP starts ticking down, it's just tedious.
When installed with Fluffy, the files are not in the correct folder. Try moving the "heal_by_time.lua" file to ...\Dragons Dogma 2\reframework\autorun\
Can confirm. Fluffy installs it in its own folder. Copy and paste "/framework" from the HealByTime folder to the main folder. Then you're fine. Just remove the old HealByTime folder then.
Is there any chance this will be modified to NOT require REFramework? A lot of people, myself included, are having problems with it, either from the start or after the patch.
Same here. Not working. At first start of the game after installing this mod it worked, healed me up to full. But now its not doing anything anymore. It is loaded, I see it in REF script loaded UI. But wont heal anymore.
I edited the code to work- heals over time and seemingly faster with more consistency. Not an unfair amount. Replace All code within heal_by_time.lua Should be located ?\HealByTime\reframework\autorun\heal_by_time.lua local re = re local sdk = sdk local d2d = d2d local imgui = imgui local log = log local json = json local draw = draw -- Configuration loading with validation local config = json.load_file('heal-by-time.json') or {} config.Enabled = config.Enabled ~= nil and config.Enabled or true config.FullHealHours = type(config.FullHealHours) == "number" and config.FullHealHours or 6 config.HealInBattle = config.HealInBattle ~= nil and config.HealInBattle or false config.DebugMode = config.DebugMode ~= nil and config.DebugMode or false log.info("[Heal By Time] Loaded"); -- Improved singleton getter with error handling local function GetSingleton(class) local instance = sdk.get_managed_singleton(class) if instance == nil then log.error("Failed to get singleton instance for class: " .. class) return nil end return instance end local function HealCharacter(character, mins) if mins <= 0 or not character then return end local human = character:call('get_Human()') if not human then log.error("Character does not have a human component.") return end local hit = human:get_field("Hit") if not hit or hit:call("get_Hp()") <= 0 then log.error("Character is dead or missing hit component.") return end local reduced = hit:call("get_ReducedMaxHp()") local full = hit:call("get_OriginalMaxHp()")
-- Adjusted the healing rate to be more gradual local healingRate = 0.1 -- Adjust this rate to control the speed of healing, lower is slower local delta = ((full - reduced) * (mins / (config.FullHealHours * 60))) * healingRate delta = math.max(delta, 0.01) -- Ensure at least a minimal amount of healing, adjust as needed local newMaxHP = reduced + delta if newMaxHP > full then newMaxHP = full end hit:call("set_ReducedMaxHp(System.Single)", newMaxHP) end local lastTime = -1 re.on_frame(function() if not config.Enabled then return end local TimeManager = GetSingleton("app.TimeManager") if TimeManager == nil then return end -- Guard against failure to get TimeManager local currentTime = TimeManager:call("get_InGameElapsedDaySeconds") if currentTime < lastTime or lastTime == -1 then -- This condition now correctly resets lastTime at the start of a new game day -- or when the script runs for the first time. lastTime = currentTime end if currentTime > lastTime then local deltaMinutes = (currentTime - lastTime) / 60 local PlayerManager = GetSingleton("app.CharacterManager") local player = PlayerManager and PlayerManager:call("get_ManualPlayer()") if player then HealCharacter(player, deltaMinutes) end local PawnManager = GetSingleton("app.PawnManager") local list = PawnManager and PawnManager:call("get_PawnCharacterList()") if list then local len = list:call("get_Count") for i = 0, len - 1 do local pawnChar = list:call("get_Item", i) HealCharacter(pawnChar, deltaMinutes) end end lastTime = currentTime -- Update lastTime to the current time after processing end end)
I don't see any difference in your fix Clayh0814 this line `lastTime = currentTime` is executed every frame. The lastTime should be reset even if the currrentTime is reset to 0
You're right my bad. I fixed some of it and added a few things, take a look and see what you like.
With detail this time lol:
Redundancies:Issue Identified: Duplicate function definitions and unnecessary repetitions were present, notably with the singleton getters (GetPlayerManager, GetPawnManager, etc.) and the HealCharacter function.Refinement: The code was streamlined by defining each piece only once and utilizing sdk.get_managed_singleton directly within the main logic, enhancing maintainability and reducing complexity.Variable Name Typo:Issue Identified: Inconsistent naming (lastMinutes vs. lastMiniutes) could lead to confusion and errors.Refinement: Adopted consistent and correctly spelled variable names, improving readability and minimizing the risk of bugs.Time Adjustments/Approach:Observation: The script includes logic to handle the transition from one day to the next, adding 1440 minutes (a full day) when necessary to calculate deltaMin accurately. Consideration: This approach assumes a potential game time wrap at midnight. While it's not confirmed if "Dragon's Dogma 2" employs such a reset, the adjustment aims to mitigate this possible pitfall. Conditional Healing Based on Battle State [Suggestion]: Integrate a check more seamlessly into the re.on_frame function, enhancing the logic's clarity and efficiency by eliminating unnecessary function calls when healing isn't applicable.Configurable and Interactive Debugging:User-friendliness Suggestion: Included debugging functionality can be toggled through the configuration, allowing for real-time inspection of effects without cluttering the code with always-executed debug statements. Streamlined UI Interaction: Efficiency Suggestion: Made the configuration UI interaction within re.on_draw_ui more intuitive and interactive, ensuring immediate reflection of configuration changes and enhancing user experience. Revised Code:local re = re local sdk = sdk local imgui = imgui local log = log local json = json local draw = draw -- Load configuration with validation local config = json.load_file('heal-by-time.json') or {} config.Enabled = config.Enabled ~= nil and config.Enabled or true config.FullHealHours = type(config.FullHealHours) == "number" and config.FullHealHours or 6 config.HealInBattle = config.HealInBattle ~= nil and config.HealInBattle or false config.DebugMode = config.DebugMode ~= nil and config.DebugMode or false log.info("[Heal By Time] Loaded"); -- Healing function definition local function HealCharacter(character, mins) if mins <= 0 or not character then return end local human = character:call('get_Human()') if not human then log.error("Character does not have a human component.") return end local hit = human:get_field("Hit") if not hit or hit:call("get_Hp()") <= 0 then log.error("Character is dead or missing hit component.") return end local reduced = hit:call("get_ReducedMaxHp()") local full = hit:call("get_OriginalMaxHp()") local delta = ((full - reduced) * mins / (config.FullHealHours * 60)) * 0.1 delta = math.max(delta, 0.01) local newMaxHP = math.min(reduced + delta, full) hit:call("set_ReducedMaxHp(System.Single)", newMaxHP) end -- Time tracking to trigger healing local lastMinutes = -1 re.on_frame(function () if not config.Enabled then return end local TimeManager = sdk.get_managed_singleton("app.TimeManager") if not TimeManager then return end local min = TimeManager:call("get_InGameMinute()") if lastMinutes ~= min then local deltaMin = (min < lastMinutes) and (min + 1440 - lastMinutes) or (min - lastMinutes)
if config.HealInBattle or not sdk.get_managed_singleton("app.BattleManager"):call("get_IsBattleMode()") then local PlayerManager = sdk.get_managed_singleton("app.CharacterManager") local player = PlayerManager:call("get_ManualPlayer()") if player then HealCharacter(player, deltaMin) end local PawnManager = sdk.get_managed_singleton("app.PawnManager") local list = PawnManager:call("get_PawnCharacterList()") for i = 0, list:call("get_Count") - 1 do local pawnChar = list:call("get_Item", i) HealCharacter(pawnChar, deltaMin) end end lastMinutes = min end end) -- Debug functionality local function DebugCharacter(character) if not config.DebugMode then return end local human = character:call('get_Human()') local hit = human:get_field("Hit") imgui.text(string.format("HP: %s/%s", hit:call("get_ReducedMaxHp()"), hit:call("get_OriginalMaxHp()"))) end re.on_draw_ui(function() if imgui.tree_node("Heal by Time Settings") then local changed changed, config.Enabled = imgui.checkbox("Enabled", config.Enabled) changed, config.HealInBattle = imgui.checkbox("Heal In Battle", config.HealInBattle) changed, config.FullHealHours = imgui.drag_float("Full Heal Hours", config.FullHealHours, 0.1, 1, 24) changed, config.DebugMode = imgui.checkbox("Debug Mode", config.DebugMode) if changed then json.dump_file('heal-by-time.json', config) end imgui.tree_pop() end end) re.on_config_save(function() json.dump_file('heal-by-time.json', config) end)
51 comments
In 1.1-perframe version, the mod will heal you per frame, makes the value no precise.
You can't heal with v1.1 if you are in Unmoored World for a while because the game clock is paused at 23:59.
Is this "Monster Hunter: Redemption" now, or Dragons Dogma? It's like Japanese game developers are so stuck up in the past and just can't move on, or afraid of moving on "fun" wise.
https://www.nexusmods.com/dragonsdogma2/mods/198
It worked for me.
heals over time and seemingly faster with more consistency.
Not an unfair amount.
Replace All code within heal_by_time.lua
Should be located
?\HealByTime\reframework\autorun\heal_by_time.lua
local re = re
local sdk = sdk
local d2d = d2d
local imgui = imgui
local log = log
local json = json
local draw = draw
-- Configuration loading with validation
local config = json.load_file('heal-by-time.json') or {}
config.Enabled = config.Enabled ~= nil and config.Enabled or true
config.FullHealHours = type(config.FullHealHours) == "number" and config.FullHealHours or 6
config.HealInBattle = config.HealInBattle ~= nil and config.HealInBattle or false
config.DebugMode = config.DebugMode ~= nil and config.DebugMode or false
log.info("[Heal By Time] Loaded");
-- Improved singleton getter with error handling
local function GetSingleton(class)
local instance = sdk.get_managed_singleton(class)
if instance == nil then
log.error("Failed to get singleton instance for class: " .. class)
return nil
end
return instance
end
local function HealCharacter(character, mins)
if mins <= 0 or not character then return end
local human = character:call('get_Human()')
if not human then
log.error("Character does not have a human component.")
return
end
local hit = human:get_field("Hit")
if not hit or hit:call("get_Hp()") <= 0 then
log.error("Character is dead or missing hit component.")
return
end
local reduced = hit:call("get_ReducedMaxHp()")
local full = hit:call("get_OriginalMaxHp()")
-- Adjusted the healing rate to be more gradual
local healingRate = 0.1 -- Adjust this rate to control the speed of healing, lower is slower
local delta = ((full - reduced) * (mins / (config.FullHealHours * 60))) * healingRate
delta = math.max(delta, 0.01) -- Ensure at least a minimal amount of healing, adjust as needed
local newMaxHP = reduced + delta
if newMaxHP > full then newMaxHP = full end
hit:call("set_ReducedMaxHp(System.Single)", newMaxHP)
end
local lastTime = -1
re.on_frame(function()
if not config.Enabled then return end
local TimeManager = GetSingleton("app.TimeManager")
if TimeManager == nil then return end -- Guard against failure to get TimeManager
local currentTime = TimeManager:call("get_InGameElapsedDaySeconds")
if currentTime < lastTime or lastTime == -1 then
-- This condition now correctly resets lastTime at the start of a new game day
-- or when the script runs for the first time.
lastTime = currentTime
end
if currentTime > lastTime then
local deltaMinutes = (currentTime - lastTime) / 60
local PlayerManager = GetSingleton("app.CharacterManager")
local player = PlayerManager and PlayerManager:call("get_ManualPlayer()")
if player then
HealCharacter(player, deltaMinutes)
end
local PawnManager = GetSingleton("app.PawnManager")
local list = PawnManager and PawnManager:call("get_PawnCharacterList()")
if list then
local len = list:call("get_Count")
for i = 0, len - 1 do
local pawnChar = list:call("get_Item", i)
HealCharacter(pawnChar, deltaMinutes)
end
end
lastTime = currentTime -- Update lastTime to the current time after processing
end
end)
this line `lastTime = currentTime` is executed every frame. The lastTime should be reset even if the currrentTime is reset to 0
With detail this time lol:
Redundancies:Issue Identified: Duplicate function definitions and unnecessary repetitions were present, notably with the singleton getters (GetPlayerManager, GetPawnManager, etc.) and the HealCharacter function.Refinement: The code was streamlined by defining each piece only once and utilizing sdk.get_managed_singleton directly within the main logic, enhancing maintainability and reducing complexity.Variable Name Typo:Issue Identified: Inconsistent naming (lastMinutes vs. lastMiniutes) could lead to confusion and errors.Refinement: Adopted consistent and correctly spelled variable names, improving readability and minimizing the risk of bugs.Time Adjustments/Approach:Observation: The script includes logic to handle the transition from one day to the next, adding 1440 minutes (a full day) when necessary to calculate deltaMin accurately.
Consideration:
This approach assumes a potential game time wrap at midnight. While it's not confirmed if "Dragon's Dogma 2" employs such a reset, the adjustment aims to mitigate this possible pitfall.
Conditional Healing Based on Battle State [Suggestion]: Integrate a check more seamlessly into the re.on_frame function, enhancing the logic's clarity and efficiency by eliminating unnecessary function calls when healing isn't applicable.Configurable and Interactive Debugging:User-friendliness Suggestion: Included debugging functionality can be toggled through the configuration, allowing for real-time inspection of effects without cluttering the code with always-executed debug statements.
Streamlined UI Interaction: Efficiency Suggestion: Made the configuration UI interaction within re.on_draw_ui more intuitive and interactive, ensuring immediate reflection of configuration changes and enhancing user experience.
Revised Code:
local re = re
local sdk = sdk
local imgui = imgui
local log = log
local json = json
local draw = draw
-- Load configuration with validation
local config = json.load_file('heal-by-time.json') or {}
config.Enabled = config.Enabled ~= nil and config.Enabled or true
config.FullHealHours = type(config.FullHealHours) == "number" and config.FullHealHours or 6
config.HealInBattle = config.HealInBattle ~= nil and config.HealInBattle or false
config.DebugMode = config.DebugMode ~= nil and config.DebugMode or false
log.info("[Heal By Time] Loaded");
-- Healing function definition
local function HealCharacter(character, mins)
if mins <= 0 or not character then return end
local human = character:call('get_Human()')
if not human then
log.error("Character does not have a human component.")
return
end
local hit = human:get_field("Hit")
if not hit or hit:call("get_Hp()") <= 0 then
log.error("Character is dead or missing hit component.")
return
end
local reduced = hit:call("get_ReducedMaxHp()")
local full = hit:call("get_OriginalMaxHp()")
local delta = ((full - reduced) * mins / (config.FullHealHours * 60)) * 0.1
delta = math.max(delta, 0.01)
local newMaxHP = math.min(reduced + delta, full)
hit:call("set_ReducedMaxHp(System.Single)", newMaxHP)
end
-- Time tracking to trigger healing
local lastMinutes = -1
re.on_frame(function ()
if not config.Enabled then return end
local TimeManager = sdk.get_managed_singleton("app.TimeManager")
if not TimeManager then return end
local min = TimeManager:call("get_InGameMinute()")
if lastMinutes ~= min then
local deltaMin = (min < lastMinutes) and (min + 1440 - lastMinutes) or (min - lastMinutes)
if config.HealInBattle or not sdk.get_managed_singleton("app.BattleManager"):call("get_IsBattleMode()") then
local PlayerManager = sdk.get_managed_singleton("app.CharacterManager")
local player = PlayerManager:call("get_ManualPlayer()")
if player then HealCharacter(player, deltaMin) end
local PawnManager = sdk.get_managed_singleton("app.PawnManager")
local list = PawnManager:call("get_PawnCharacterList()")
for i = 0, list:call("get_Count") - 1 do
local pawnChar = list:call("get_Item", i)
HealCharacter(pawnChar, deltaMin)
end
end
lastMinutes = min
end
end)
-- Debug functionality
local function DebugCharacter(character)
if not config.DebugMode then return end
local human = character:call('get_Human()')
local hit = human:get_field("Hit")
imgui.text(string.format("HP: %s/%s", hit:call("get_ReducedMaxHp()"), hit:call("get_OriginalMaxHp()")))
end
re.on_draw_ui(function()
if imgui.tree_node("Heal by Time Settings") then
local changed
changed, config.Enabled = imgui.checkbox("Enabled", config.Enabled)
changed, config.HealInBattle = imgui.checkbox("Heal In Battle", config.HealInBattle)
changed, config.FullHealHours = imgui.drag_float("Full Heal Hours", config.FullHealHours, 0.1, 1, 24)
changed, config.DebugMode = imgui.checkbox("Debug Mode", config.DebugMode)
if changed then json.dump_file('heal-by-time.json', config) end
imgui.tree_pop()
end
end)
re.on_config_save(function()
json.dump_file('heal-by-time.json', config)
end)