Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 276 277 [278] 279 280 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1119962 times)

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4155 on: April 22, 2016, 08:07:51 pm »

warmist and I kinda found a better solution to this issue by using the 'get creature at pointer' function to grab the dead unit where they Last died at.
it saved a many lives when you need to rez someone who body kinda burn up but you remember where they died at.
sadly the issue that pops up from this is if there's more than one dead guy ...which could be solved by healing and pushing the folks off the spot til you get the right person.

Code: [Select]
function getxyz() -- this will return pointers x,y and z coordinates.
local x=df.global.cursor.x
local y=df.global.cursor.y
local z=df.global.cursor.z
return x,y,z -- return the coords
end
function getCreatureAtPos(x,y,z) -- gets the creature index @ x,y,z coord
--local x,y,z=getxyz() --get 'X' coords
local vector=df.global.world.units.all -- load all creatures
for i = 0, #vector-1 do -- look into all creatures offsets
local curpos=vector[i].pos --get its coordinates
local cx=curpos.x
local cy=curpos.y
local cz=curpos.z
if cx==x and cy==y and cz==z then --compare them
return vector[i] --return index
end
end
--print("Creature not found!")
return nil

end
--heal unit from all wounds and damage
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
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

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4156 on: April 22, 2016, 08:42:29 pm »

You could just select the dead unit in the units list (under the dead/missing tab) and run full-heal without arguments.

If you want the unit ID, there are several ways to get that, including:
- Run ":lua ~dfhack.gui.getSelectedUnit().id" with the unit selected (or ":lua !dfhack.gui.getSelectedUnit().id", or ":lua print(dfhack.gui.getSelectedUnit().id)", etc.). This won't work for dead units unless you select them in the list, which is kind of pointless since full-heal works from that list too.
- Run "gui/gm-editor unit" with the unit selected and look for the "id" field.

Thanks but I still don't understand how am I supposed to select a dead unit.
Like I said, you can select it in the Dead/Missing tab of the units list (unless it's been cleared somehow).


Are you making sure to include the -r argument?

You can use -help to get argument help. If that doesn't work for any command, make an issue of it.
This only works for some commands. Most commands that are part of plugins use "help command-name" instead, and some also recognize "command-name help", but not "command-name -help".
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Dozebôm Lolumzalìs

  • Bay Watcher
  • what even is truth
    • View Profile
    • test
Re: DFHack 0.40.24-r5
« Reply #4157 on: April 22, 2016, 09:10:15 pm »

I think the problem with multi-story buildings is that most buildings need to be completely supported by floors.
Logged
Quote from: King James Programming
...Simplification leaves us with the black extra-cosmic gulfs it throws open before our frenzied eyes...
Quote from: Salvané Descocrates
The only difference between me and a fool is that I know that I know only that I think, therefore I am.
Sigtext!

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4158 on: April 22, 2016, 11:25:54 pm »

I've noticed that the df-structures have a ton of description in them that I can't seem to access from Lua.  In particular I'm looking at tile types.

dfhack.maps.getTileType(pos) will return a number like 403, which turns out to be pebbles.  That is enumerated in the XML with a nice human-friendly name attribute, but I can't figure out how to access it.  I suppose with enough Notepad++ I could morph the XML into a Lua array, but I'd rather not re-invent the wheel if I don't have to.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4159 on: April 22, 2016, 11:31:44 pm »

df.tiletype[num]

<enum-type type-name='tiletype' base-type='int16_t'>

you want df.type-name there

Code: [Select]
        <enum-attr name='caption'/>
        <enum-attr name='shape' type-name='tiletype_shape' default-value='NONE'/>
        <enum-attr name='material' type-name='tiletype_material' default-value='NONE'/>
        <enum-attr name='variant' type-name='tiletype_variant' default-value='NONE'/>
        <enum-attr name='special' type-name='tiletype_special' default-value='NONE'/>
        <enum-attr name='direction' default-value='--------'/>

to access these you use (for example) df.tiletype.attrs[num].shape
« Last Edit: April 22, 2016, 11:34:18 pm by Putnam »
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4160 on: April 22, 2016, 11:42:01 pm »

Thanks!  I was looking under dfhack.* not df.*
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4161 on: April 23, 2016, 12:57:28 am »

Wow that turned out to be much easier than I expected.

df.tiletype_material[df.tiletype.attrs[tile_type].material] .. " " .. df.tiletype_shape[df.tiletype.attrs[tile_type].shape]

gives you a nice terse description of the tile, with only a couple oddities like a TREE RAMP at the top of a trunk.  Thanks again Putnam!
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4162 on: April 23, 2016, 08:16:44 am »

I think the problem with multi-story buildings is that most buildings need to be completely supported by floors.
True. Also, floors can't be supported by buildings, so creating floors on demand wouldn't work (unless we could create a wall for support, but it would have to extend outside of the building). It's possible that the building-hacks plugin could help with this, but I don't remember everything it's capable of.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4163 on: April 23, 2016, 08:48:41 am »

Would it work by making them mechanics?
Logged

Droggarth

  • Bay Watcher
  • Ischrotaur Axe Lord [SUPERNATURAL][STRANGE_MOODS]
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4164 on: April 23, 2016, 09:37:20 pm »

Like I said, you can select it in the Dead/Missing tab of the units list (unless it's been cleared somehow).

Ah, my reasons for the full-heal resurrect was for my own adventurer but I already found out that it's best to avoid getting killed.

Anyhow, I made an alternate version of my ischrotaur, one who is damageable by regular means. Just wondering how can I use DFhack to update my current adventurer with the new file in the raws?
Logged
"I'll make my own way." - Max Rockatansky

baldamundo

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4165 on: April 24, 2016, 04:12:52 pm »

What's the stability of the 0.42.06 version like? I've been getting a few crashes and wondering if the beta DFhack version's behind it.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4166 on: April 24, 2016, 04:40:13 pm »

Here's r1! https://github.com/DFHack/dfhack/releases/tag/0.42.06-r1
Thanks to everyone who helped test the pre-releases and reported back.

What's the stability of the 0.42.06 version like? I've been getting a few crashes and wondering if the beta DFhack version's behind it.
Hopefully not. Some crashes in 0.42 have been attributed to TwbT, so try disabling that first and see if it helps. Otherwise, it would help if you could test without DFHack entirely and see if it's reproducible.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4167 on: April 24, 2016, 04:43:29 pm »

I'll edit the front post next time I'm not on mobile.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4168 on: April 24, 2016, 04:45:21 pm »

Here's r1! https://github.com/DFHack/dfhack/releases/tag/0.42.06-r1
Thanks to everyone who helped test the pre-releases and reported back.
A big thank you to everyone on the team!  A weapon trap with masterwork silver serrated discs and mechanisms for each of your rooms :)
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Droggarth

  • Bay Watcher
  • Ischrotaur Axe Lord [SUPERNATURAL][STRANGE_MOODS]
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #4169 on: April 24, 2016, 08:39:35 pm »

Here's r1! https://github.com/DFHack/dfhack/releases/tag/0.42.06-r1
Thanks to everyone who helped test the pre-releases and reported back.

Awesome!

A big thank you to everyone on the team!  A weapon trap with masterwork silver serrated discs and mechanisms for each of your rooms :)

Can I have one of the levers? So when the dire hour comes we can in unison pull at least 2-3 levers and then there goes the dev team.. the de- uhhh. Has anyone even thought this through? :-\ I mean DFHack sorcery workers/devs should be protected from the angry dwarven mob instead.

Heheh, joking aside. You folks have my thanks too!
Logged
"I'll make my own way." - Max Rockatansky
Pages: 1 ... 276 277 [278] 279 280 ... 360