Did you... manually type that out instead of copying? Because the ddbevents typo isn't in anything on my side.
Actually, that one was something screwy with my install, apparently. I created yet another clean install to try to get the mod to work and it stopped giving me those errors, and then I forgot to mention it. Sorry about that. However, it did crash again after much more wandering around than before.
I have no idea what I'm doing with any programming languages of any kind, so forgive me if I just inserted nonsense into the code, but I tried adding that line to more parts of the code, since the game's still crashing after trying what you said to try. Don't worry, though, I can change it back very easily.
function checkIfUnitStillGravelyInjuredForZenkai(unit)
if not unit then return end
if unit.body.blood_count>unit.body.blood_max*.75 then
dfhack.persistent.save({key='ZENKAI_'..unit.id,value='false'})
end
end
function unitHasZenkaiAlready(unit,set)
if not unit then return end
if set then
dfhack.persistent.save({key='ZENKAI_'..unit.id,value='true'})
else
if dfhack.persistent.get('ZENKAI_'..unit.id) and dfhack.persistent.get('ZENKAI_'..unit.id).value=='true' then
checkIfUnitStillGravelyInjuredForZenkai(unit)
return true
end
end
end
dbEvents.onUnitGravelyInjured.zenkai=function(unit)
if not unit then return end
if df.creature_raw.find(unit.race).creature_id~="SAIYAN" or unitHasZenkaiAlready(unit) then return false end
local zenkaiMultiplier=math.log(((unit.body.blood_max*.75)/unit.body.blood_count)*math.exp(1)) --yeah, don't want too much of a bonus
for k,v in ipairs(unit.body.physical_attrs) do
v.value=dbRound(v.value*zenkaiMultiplier)
v.max_value=dbRound(v.max_value*zenkaiMultiplier)
end
unitHasZenkaiAlready(unit,true)
end
dbEvents.onUnitGravelyInjured.super_saiyan=function(unit)
if not unit then return end
if df.creature_raw.find(unit.race).creature_id=='SAIYAN' then
dfhack.run_script('dragonball/super_saiyan_trigger','-unit',unit.id)
end
end
Edit: Oh, also, instant transmission and scouter are both showing wildly different power levels.