Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 243 244 [245] 246 247 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1456743 times)

zzedar

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3660 on: April 29, 2013, 06:23:48 am »

Not sure if this is the correct place to post this info, but: I've figured out the meaning of two of the fields that are currently marked as unknown in DFHack. The unk2 field of body_part_layer_raw (currently found on line 394 of df.creature-raws.xml) is a scale number that represents the relative thickness of that layer in the body part; basically, it works like RELATIVE_THICKNESS does in the raws. The unk2 field of body_part_raw (currently found on line 430 of df.creature-raws.xml) is simply the sum of the the thicknesses for all layers of that body part.
Logged
kingubu cancels Efficiency: Taken by mood
Project Whalegun is a go. Load the whale cannon!

Imperator314

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3661 on: April 29, 2013, 09:05:25 pm »

Sorry if this is a repeat or common question, but I poked around and couldn't find this anywhere. I made the mistake of locking my Legendary Siege Operator inside the control room for a little too long, and he starved to death. I'd really like to resurrect him. I found this script. This leaves me with 2 questions: how do I modify this to resurrect a dwarf, not just heal them, and how do I actually use the code? I've spend a good while trying to figure out how to use dfusion and just can't. Thanks in advance for any help.
Code: [Select]
function tools.heal2(unit)
if unit==nil then
unit=getCreatureAtPos(getxyz())
end
unit.body.wounds:resize(0) -- memory leak here :/
unit.body.blood_count=unit.body.blood_max
--set flags for standing and grasping...
unit.status2.able_stand=4
unit.status2.able_stand_impair=4
unit.status2.able_grasp=4
unit.status2.able_grasp_impair=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
v[kk]=0
end
end
end
tools.menu:add("heal2",tools.heal2)
Logged

Bludragon

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3662 on: April 29, 2013, 10:10:12 pm »

Does anybody know how to change the number of dwarves we can embark with?  There seems to be ways to do with older versions of the game and mods but nothing recent that works. I would really like to be able to do this.
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3663 on: April 30, 2013, 12:10:50 am »

The DFusion commands in DFHack will allow it.  I can't remember the exact sequence, but it's under the DFusion menu inside DFHack.  Just remember to run it before you go to the embark screen.

Quote from: Imperator314
Sorry if this is a repeat or common question, but I poked around and couldn't find this anywhere. I made the mistake of locking my Legendary Siege Operator inside the control room for a little too long, and he starved to death. I'd really like to resurrect him. I found this script. This leaves me with 2 questions: how do I modify this to resurrect a dwarf, not just heal them, and how do I actually use the code? I've spend a good while trying to figure out how to use dfusion and just can't. Thanks in advance for any help.

It looks like that's supposed to be loaded as part of DFHack's startup scripts somehow, but I don't know how that works.  If you use the following code:

Code: [Select]
function heal2()
unit = getCreatureAtPos(getxyz())
unit.flags1.dead = false
if unit.caste == 0 then
unit.caste = 1
end
if unit.caste == 1 then
unit.caste = 0
end
end
heal2()

and paste that into a file called heal2.lua in your /hack/scripts directory, that should add a new command called heal2 that you can run directly from DFHack's command line.  In theory, putting the cursor over a wounded dwarf and running heal2 will heal them completely.  The theory here is that it would bring them back to life, if dead, then change their caste to the other dwarf caste.  This heals all wounds as per a werecreature curse.  The game realizes immediately that they're not suffering from a curse, and changes them back, however, but keeping their wounds healed.

This has some problems (and is untested and so maybe even has syntax errors), but should work.  I believe it may change physical stats when it runs, so be careful.

It also won't bring the dead back to life, I don't think, since the game won't recognize creatures if you mouse over their corpse.  To get around that, you'd need to get a reference to their unit through some other means.  If there's an easy way to do that, I don't know what it is.  In the past I've just done a manual search of the df.global.world.units.all list to find them, but I know there has to be a better way.
« Last Edit: April 30, 2013, 12:19:34 am by Telgin »
Logged
Through pain, I find wisdom.

Imperator314

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3664 on: April 30, 2013, 02:05:13 am »


Quote from: Imperator314
Sorry if this is a repeat or common question, but I poked around and couldn't find this anywhere. I made the mistake of locking my Legendary Siege Operator inside the control room for a little too long, and he starved to death. I'd really like to resurrect him. I found this script. This leaves me with 2 questions: how do I modify this to resurrect a dwarf, not just heal them, and how do I actually use the code? I've spend a good while trying to figure out how to use dfusion and just can't. Thanks in advance for any help.

It looks like that's supposed to be loaded as part of DFHack's startup scripts somehow, but I don't know how that works.  If you use the following code:

Code: [Select]
function heal2()
unit = getCreatureAtPos(getxyz())
unit.flags1.dead = false
if unit.caste == 0 then
unit.caste = 1
end
if unit.caste == 1 then
unit.caste = 0
end
end
heal2()

and paste that into a file called heal2.lua in your /hack/scripts directory, that should add a new command called heal2 that you can run directly from DFHack's command line.  In theory, putting the cursor over a wounded dwarf and running heal2 will heal them completely.  The theory here is that it would bring them back to life, if dead, then change their caste to the other dwarf caste.  This heals all wounds as per a werecreature curse.  The game realizes immediately that they're not suffering from a curse, and changes them back, however, but keeping their wounds healed.

This has some problems (and is untested and so maybe even has syntax errors), but should work.  I believe it may change physical stats when it runs, so be careful.

It also won't bring the dead back to life, I don't think, since the game won't recognize creatures if you mouse over their corpse.  To get around that, you'd need to get a reference to their unit through some other means.  If there's an easy way to do that, I don't know what it is.  In the past I've just done a manual search of the df.global.world.units.all list to find them, but I know there has to be a better way.

When I try to run the script, I get this error: \Dwarf Fortress\hack\scripts/heal2.lua:2: attempt to call global 'getxyz' (a nil value) stack traceback: \Dwarf Fortress\hack\scripts/heal2.lua2: in function 'heal2' \Dwarf Fortress\hack\scripts/heal2.lua:11: in main chunk (...tail calls...)   When I type ls in the DFhack console, heal2 does show up as a possible command, don't know if that's any help.
Logged

Trev_lite

  • Bay Watcher
  • Likes the forum for its helpful members
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3665 on: April 30, 2013, 02:09:02 am »

The DFusion commands in DFHack will allow it.  I can't remember the exact sequence, but it's under the DFusion menu inside DFHack.  Just remember to run it before you go to the embark screen.

i cannot find simple_embark in dfhack r3 anywhere.
i think it was removed. if it is still there can you tell me how to find it. its not simple_embark or under the dfusion menu

hope that some one can tell me were to find simple_embark for dfhack r3
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3666 on: April 30, 2013, 06:39:44 am »

The DFusion commands in DFHack will allow it.  I can't remember the exact sequence, but it's under the DFusion menu inside DFHack.  Just remember to run it before you go to the embark screen.

i cannot find simple_embark in dfhack r3 anywhere.
i think it was removed. if it is still there can you tell me how to find it. its not simple_embark or under the dfusion menu

hope that some one can tell me were to find simple_embark for dfhack r3
simple embark as in embark anywhere or the bit that allows you to alter how many units can spawn on the map simple embark?
because embark anywhere has been converted into a lua script called embark.
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

Trev_lite

  • Bay Watcher
  • Likes the forum for its helpful members
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3667 on: April 30, 2013, 06:41:23 am »

the old dfusion script simple_embark. the one that let you change how many units you start with.
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3668 on: April 30, 2013, 07:25:21 am »

When I try to run the script, I get this error: \Dwarf Fortress\hack\scripts/heal2.lua:2: attempt to call global 'getxyz' (a nil value) stack traceback: \Dwarf Fortress\hack\scripts/heal2.lua2: in function 'heal2' \Dwarf Fortress\hack\scripts/heal2.lua:11: in main chunk (...tail calls...)   When I type ls in the DFhack console, heal2 does show up as a possible command, don't know if that's any help.

Try this instead:

Code: [Select]
function heal2()
unit = dfhack.gui.getSelectedUnit()
unit.flags1.dead = false
if unit.caste == 0 then
unit.caste = 1
end
if unit.caste == 1 then
unit.caste = 0
end
end
heal2()

That will still require you to select a unit with the 'v' or 'k' keys in fort mode (no idea for adventure mode, but 'l' I think).  Again, this won't directly allow you to revive dead things without a reference to the dead unit instead of the dfhack.gui.getSelectedUnit() line.
Logged
Through pain, I find wisdom.

drayath

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3669 on: April 30, 2013, 07:47:46 am »

Maklak, try the following version. It definatly works on my machine at least but it has only been tested under windows. If you are getting error writing the file try just export:filename rather than export:c:\path\filename or export:\usr\me\filename, not quite sure how the ruby filename parsing works via wine.

--

Fix: stupid typo that prevented script running (note to self: stop making changes between testing and uploading!!!)
Enh: Various display improvements in html output
New: If only some effects in a syndrome are presently active, inactive effects are marked.

Spoiler (click to show/hide)

For example output www.brightsoft.net/examplesyndromereport.html (only good syndromes in this case which is why they are all green)
Logged
Drayath's Gem Splitting Workshop - Split large gems and gem trinkets into numbers of small gems.
Drayath's Seed Brewery - Convert bags of spare seeds into useful booze.

Mr S

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3670 on: April 30, 2013, 08:45:15 am »

The lack of proper capitalization!  It burns my eyes!   :P

Seriously though, that's an awesome script.  I'll have to start playing with it.  Thanks!
Logged

drayath

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3671 on: April 30, 2013, 12:18:42 pm »

People are never happy  :P

ShowUnitSyndromes.rb v6
Fix: Capitalization, spelling, missing commas and spaces
Fix: Quick code tidy up
Enh: Decode transformation race and caste to nice names.
Enh: Material force multiplier now shows material if the bonus if for a certain type (e.g. werewolf's vs silver)

Spoiler (click to show/hide)

New example showing all syndromes in the world so you can see some of the different types: www.brightsoft.net/examplesyndromereport2.html
« Last Edit: April 30, 2013, 12:43:01 pm by drayath »
Logged
Drayath's Gem Splitting Workshop - Split large gems and gem trinkets into numbers of small gems.
Drayath's Seed Brewery - Convert bags of spare seeds into useful booze.

Imperator314

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3672 on: April 30, 2013, 12:36:56 pm »


Try this instead:

Code: [Select]
function heal2()
unit = dfhack.gui.getSelectedUnit()
unit.flags1.dead = false
if unit.caste == 0 then
unit.caste = 1
end
if unit.caste == 1 then
unit.caste = 0
end
end
heal2()

That will still require you to select a unit with the 'v' or 'k' keys in fort mode (no idea for adventure mode, but 'l' I think).  Again, this won't directly allow you to revive dead things without a reference to the dead unit instead of the dfhack.gui.getSelectedUnit() line.

This script does run, thanks. Now where is df.global.world.units.all located?
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #3673 on: April 30, 2013, 01:37:47 pm »

New example showing all syndromes in the world so you can see some of the different types: www.brightsoft.net/examplesyndromereport2.html
These look familiar.. seems like I have some work cut out, giving all of them proper names... Would you be willing to write a short readme for this, so I can include it in MasterworkDF?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3674 on: April 30, 2013, 03:07:24 pm »


Try this instead:

Code: [Select]
function heal2()
unit = dfhack.gui.getSelectedUnit()
unit.flags1.dead = false
if unit.caste == 0 then
unit.caste = 1
end
if unit.caste == 1 then
unit.caste = 0
end
end
heal2()

That will still require you to select a unit with the 'v' or 'k' keys in fort mode (no idea for adventure mode, but 'l' I think).  Again, this won't directly allow you to revive dead things without a reference to the dead unit instead of the dfhack.gui.getSelectedUnit() line.

This script does run, thanks. Now where is df.global.world.units.all located?

I would recommend using the dead/missing units list to highlight the intended recipient as dfhack.gui.getSelectedUnit() works from there.  Also, I would change those if statements to
Code: [Select]
if unit.caste == 0 then
unit.caste = 1
else
unit.caste = 0
end
so that female dwarfs will be regenerated too.

Also, some way to make sure the unit is regenerated in a valid location might be useful as I think that using this script on a dwarf who went swimming in magma would just get incinerated again.  Also dwarfs who became encased in ice or obsidian might have problems if their position is still impassable.
« Last Edit: April 30, 2013, 03:19:25 pm by Kurik Amudnil »
Logged
Pages: 1 ... 243 244 [245] 246 247 ... 373