Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Revive Adventurer with DFhack  (Read 5271 times)

mosshadow

  • Bay Watcher
    • View Profile
Revive Adventurer with DFhack
« on: March 02, 2014, 05:00:55 pm »

Just a question, is there a way to revive a dead adventurer with Dfhack/dfusion? I Used reincarnate which sent me into a near by body but i expected that to revive the dead character
Logged

TheOnlySolitaire

  • Bay Watcher
  • [BRAG_ON_KILL]
    • View Profile
Re: Revive Adventurer with DFhack
« Reply #1 on: March 02, 2014, 06:21:14 pm »

I'm not sure, having never done it myself, but I believe you use dfusion misc, then heal unit, and it should fix you right up.

HOWEVER, I'm pretty sure it does, or used to, cause a problem with DF because you can't heal a dead person, and the game flips out, it might cause a crash. Sorry, I don't remember what was said about it, or how long ago that was said, as it may have been worked around.

So, give that a go, hopefully it will work.
If not, I'm sure someone who has used df more recently than I will help you out.
There is probably a resurrect script somewhere... 
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: Revive Adventurer with DFhack
« Reply #2 on: March 03, 2014, 07:59:25 am »

yeah there is... but given how 'not fort mode friendly' some of the adv fort content are you usually end up with no one making scripts for this.
but
Code: [Select]
function healunit(unit)
if unit==nil then
unit=getCreatureAtPos(getxyz())
end
if unit==nil then
error("Failed to Heal unit. Unit not selected/valid")
end
    for i=#unit.body.wounds-1,0,-1 do
    unit.body.wounds[i]:delete()
    end
    unit.body.wounds:resize(0)
unit.body.blood_count=unit.body.blood_max
--set flags for standing and grasping...
unit.status2.limbs_stand_max=4
unit.status2.limbs_stand_count=4
unit.status2.limbs_grasp_max=4
unit.status2.limbs_grasp_count=4
--should also set temperatures, and flags for breath etc...
unit.flags1.dead=false
unit.flags2.calculated_bodyparts=false
unit.flags2.calculated_nerves=false
unit.flags2.circulatory_spray=false
unit.flags2.vision_good=true
unit.flags2.vision_damaged=false
unit.flags2.vision_missing=false
unit.counters.winded=0
unit.counters.unconscious=0
for k,v in pairs(unit.body.components) do
for kk,vv in pairs(v) do
if k == 'body_part_status' or k=='layer_status' then v[kk].whole = 0  else v[kk] = 0 end
end
end
end
or if you don't want to look at your self to heal(which you have to do to get it to work this works great for reviving dead people need their original resting place though)
Code: [Select]
function healunit(unit)
if unit==nil then
unit=df.global.world.units.active[0]
end
if unit==nil then
error("Failed to Heal unit. Unit not selected/valid")
end
    for i=#unit.body.wounds-1,0,-1 do
    unit.body.wounds[i]:delete()
    end
    unit.body.wounds:resize(0)
unit.body.blood_count=unit.body.blood_max
--set flags for standing and grasping...
unit.status2.limbs_stand_max=4
unit.status2.limbs_stand_count=4
unit.status2.limbs_grasp_max=4
unit.status2.limbs_grasp_count=4
--should also set temperatures, and flags for breath etc...
unit.flags1.dead=false
unit.flags2.calculated_bodyparts=false
unit.flags2.calculated_nerves=false
unit.flags2.circulatory_spray=false
unit.flags2.vision_good=true
unit.flags2.vision_damaged=false
unit.flags2.vision_missing=false
unit.counters.winded=0
unit.counters.unconscious=0
for k,v in pairs(unit.body.components) do
for kk,vv in pairs(v) do
if k == 'body_part_status' or k=='layer_status' then v[kk].whole = 0  else v[kk] = 0 end
end
end
end
which works on your adventurer, warning the issue with reviving is that you might end up getting killed again and horribly break legend mode with it having to rerecord a death again so just wait for the person that kill you to walk away from your corpse. Oh yeah this game is brutal to those who got a second chance since you come back from the dead prone and leaves you open for another crit. When I dive into reviving characters the illusion of the game kinda broke and I was left doing weird stuff to pass time what I'm saying is using this will just be a gateway drug into running scripts to recruit the entire town so that you can warp them all to hell to battle out demons long enough to give you breathing room to build a cottage there, then figure out how to play Liberal crime squad in Dwarf fortress and/or learning how to spark a civil war that wipes out several towns. looking for the next big hit before you resort to knocking up babies that aren't apart of the race the mother is and wonder if that interaction that causes them to explode leave a horrible surprise. Then you soon not relate to any one in this board for you tamed the bogiemen, talk to demons on a normal basis, built a minecart skate park and coded in the means to do ollies and tricks, and the worst of all everything you done is worthless dribble of non impressiveness since you didn't do it in vanilla/mod vanilla. 
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

mosshadow

  • Bay Watcher
    • View Profile
Re: Revive Adventurer with DFhack
« Reply #3 on: March 03, 2014, 10:19:46 am »

So the difference between that and the standard dfhack heal is that it heals without looking at the unit screen?
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: Revive Adventurer with DFhack
« Reply #4 on: March 03, 2014, 11:14:56 am »

So the difference between that and the standard dfhack heal is that it heals without looking at the unit screen?
that and it doesn't give out an error if you have the recent dfhack.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

mosshadow

  • Bay Watcher
    • View Profile
Re: Revive Adventurer with DFhack
« Reply #5 on: March 05, 2014, 01:25:20 am »

hmm doesnt seem to work after I replaced the regular Healunit with it. I guess I will just roll up another adventurer
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: Revive Adventurer with DFhack
« Reply #6 on: March 05, 2014, 11:32:40 am »

hmm doesnt seem to work after I replaced the regular Healunit with it. I guess I will just roll up another adventurer
wait really I'm sure this works on... hmm then again I am using masterworks so vanilla is pretty different.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes