al6ren Posted January 12, 2025 Share Posted January 12, 2025 My custom character can eat nightmare fuel which for them restores health but drains sanity. I want to add a temporal damage buff (50%+ damage for 20 s) activated by the activity of eating nightmare fuel. Another thing I need help with is sanity drain of 2 per second for 10 second upon killing anything other than mobs tagged prey. It's my first mod ever so that might seem like a lot. Thanks for any help ^^ Link to comment https://forums.kleientertainment.com/forums/topic/163094-need-help-adjusting-damage-buff-and-sanity-drain/ Share on other sites More sharing options...
al6ren Posted January 13, 2025 Author Share Posted January 13, 2025 (edited) I think i fixed the second problem, here's my code. haven't checked if it's working yet local function SanitysFall(inst, ini_time) if inst.components.sanity then inst.components.sanity:DoDelta(-1) end if GLOBAL.GetTime() > ini_time + 20 then inst.lose_sanity_task:Cancel() inst.lose_sanity_task = nil end local function OnKill(inst, data) local victim = data.victim if victim and not victim:HasTag("prey") and not victim:HasTag("pigman") and inst.components.sanity then if inst.lose_sanity_task ~= nil then inst.lose_sanity_task:Cancel() end inst.lose_sanity_task = nil inst.lose_sanity_task = inst:DoPeriodicTask(1, SanitysFall, nil, GLOBAL.GetTime()) end end end --in common_postinit : inst:ListenForEvent("killed", OnKill) Edited January 13, 2025 by al6ren Link to comment https://forums.kleientertainment.com/forums/topic/163094-need-help-adjusting-damage-buff-and-sanity-drain/#findComment-1785411 Share on other sites More sharing options...
al6ren Posted January 13, 2025 Author Share Posted January 13, 2025 update it's not not even launching, auto compile doesn't happen, not starting. Logs return this FrontendLoadMod orion mod [00:07:18]: Could not load mod_config_data/modconfiguration_orion mod [00:07:18]: Fontend-Loading mod: orion mod Version: (No modinfo.lua, using defaults... ) [00:07:18]: Mod: orion mod Loading modservercreationmain.lua [00:07:18]: Mod: orion mod Mod had no modservercreationmain.lua. Skipping. [00:07:18]: Mod: orion mod Loading modworldgenmain.lua [00:07:18]: Mod: orion mod Mod had no modworldgenmain.lua. Skipping. please help Link to comment https://forums.kleientertainment.com/forums/topic/163094-need-help-adjusting-damage-buff-and-sanity-drain/#findComment-1785447 Share on other sites More sharing options...
yanecc Posted January 14, 2025 Share Posted January 14, 2025 I suggest using debuff method to do this. You can refer to the foodbuffs.lua and compostwrap.lua files for guidance. Link to comment https://forums.kleientertainment.com/forums/topic/163094-need-help-adjusting-damage-buff-and-sanity-drain/#findComment-1785521 Share on other sites More sharing options...
al6ren Posted January 15, 2025 Author Share Posted January 15, 2025 On 1/14/2025 at 5:53 AM, yanecc said: I suggest using debuff method to do this. You can refer to the foodbuffs.lua and compostwrap.lua files for guidance. Thank you and sorry for not replying earlier! I opted for another mechanic but it was still useful Link to comment https://forums.kleientertainment.com/forums/topic/163094-need-help-adjusting-damage-buff-and-sanity-drain/#findComment-1785818 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now