Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 0.34.11 r3  (Read 1456586 times)

Imperator314

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3675 on: April 30, 2013, 03:29:28 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.


This script did work. Since she (turns out it was a female dwarf, thanks for that fix) starved to death, location wasn't a problem. However, all of her body parts are gone. Could this have something to do with the fact that her body is sitting in a stockpile, but she resurrected on top of the spot that she died? Right now, all of her body parts are grayed out (missing), and her health status says winded, ability to breathe lost, vision lost, ability to stand lost, ability to grasp lost. Is there a script to replace all of her body parts?
« Last Edit: April 30, 2013, 03:34:25 pm by Imperator314 »
Logged

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3676 on: April 30, 2013, 03:46:49 pm »

.. snip ..
Code: [Select]
if unit.caste == 0 then
unit.caste = 1
else
unit.caste = 0
end
so that female dwarfs will be regenerated too.

This script did work. Since she (turns out it was a female dwarf, thanks for that fix) starved to death, location wasn't a problem. However, all of her body parts are gone. Could this have something to do with the fact that her body is sitting in a stockpile, but she resurrected on top of the spot that she died? Right now, all of her body parts are grayed out (missing), and her health status says winded, ability to breathe lost, vision lost, ability to stand lost, ability to grasp lost. Is there a script to replace all of her body parts?

The missing body parts are the reason for the change to the if statements since the second if statement undid the change of the first one.  what changing the caste here does is make it so that they go through the magical transformation back to themselves like a were creature and regenerate everything.  run the script again with her unit selected and with the if fix and she should regenerate her missing parts.

Another thing I have noticed is that units brought back from the dead with this script won't show up in dwarf therapist
« Last Edit: April 30, 2013, 03:49:28 pm by Kurik Amudnil »
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3677 on: April 30, 2013, 03:55:39 pm »

Good catch on the if statement, I didn't test it and sure enough that would have caused a problem.

I don't know if the game updates a unit's position as their corpse is hauled around (probably not), and if it doesn't that would mean she'd pop up back where she kicked the bucket.  Having random body parts lying around shouldn't matter, so far as I know.
Logged
Through pain, I find wisdom.

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3678 on: April 30, 2013, 04:05:04 pm »

Good catch on the if statement, I didn't test it and sure enough that would have caused a problem.

I don't know if the game updates a unit's position as their corpse is hauled around (probably not), and if it doesn't that would mean she'd pop up back where she kicked the bucket.  Having random body parts lying around shouldn't matter, so far as I know.

True, unit position is not updated by corpse movement.  I tested this on two deaths, one was a military dwarf that wandered too far from the station point and stepped on the rising bridge and was atomized.  He retained his position.  The other was a female baby (the only female death I could test on) who had been stabbed by a snatcher.  Interestingly, her position when resurrected was not where she died, and not at her coffin, but with her mother.  Apparently babies follow their mothers in death as well as in life.

Imperator314

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


The missing body parts are the reason for the change to the if statements since the second if statement undid the change of the first one.  what changing the caste here does is make it so that they go through the magical transformation back to themselves like a were creature and regenerate everything.  run the script again with her unit selected and with the if fix and she should regenerate her missing parts.

Another thing I have noticed is that units brought back from the dead with this script won't show up in dwarf therapist

Ah, found the problem. When I modified the script, I pasted the new code in without deleting the old section, so it stopped running before it got to the second part. As for Dwarf Therapist, you were right. Oh well. All she does is sit around in the control room waiting to pull levers and shoot the ballista. Thanks for the help, guys  :)
Logged

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3680 on: April 30, 2013, 06:21:34 pm »


The missing body parts are the reason for the change to the if statements since the second if statement undid the change of the first one.  what changing the caste here does is make it so that they go through the magical transformation back to themselves like a were creature and regenerate everything.  run the script again with her unit selected and with the if fix and she should regenerate her missing parts.

Another thing I have noticed is that units brought back from the dead with this script won't show up in dwarf therapist

Ah, found the problem. When I modified the script, I pasted the new code in without deleting the old section, so it stopped running before it got to the second part. As for Dwarf Therapist, you were right. Oh well. All she does is sit around in the control room waiting to pull levers and shoot the ballista. Thanks for the help, guys  :)

I found why they don't show up in Dwarf Therapist.  DT filters out dwarfs who have flags2.killed == true , therefore we can revise the script to add flags2.killed = false so that DT won't filter them.

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

Maklak

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3681 on: May 01, 2013, 08:09:55 pm »

Thanks Drayath, 6th version of your script works for me and displays stuff in the dfhack console. This is just something from a new fort, testing shotguns that fire 8 pellets at once by material emissions: http://www.bay12forums.com/smf/index.php?topic=118893.msg4218316#msg4218316

[DFHack]# ShowUnitSyndromes
Dwarves
wheat seedplot
 - Shotgun battle saddle [196 of 300]
 -  - Add interaction [0-300] ability=Reload shotguns, delay=600, actionType=TODO, range=TODO, maxTargets=TODO
 - Shotgun battle saddle [46 of 300]
 -  - Add interaction [0-300] ability=Reload shotguns, delay=600, actionType=TODO, range=TODO, maxTargets=TODO
blaze blotbud
 - Shotgun battle saddle [196 of 300]
 -  - Add interaction [0-300] ability=Reload shotguns, delay=600, actionType=TODO, range=TODO, maxTargets=TODO
 - Shotgun battle saddle [46 of 300]
 -  - Add interaction [0-300] ability=Reload shotguns, delay=600, actionType=TODO, range=TODO, maxTargets=TODO

EDIT:
v6 works once, then spits a bunch of errors when I run it again. There isn't even anything in line 43 that could cause an error.
[DFHack]# ShowUnitSyndromes
E: Errno::ENOSPC: ./hack/scripts/ShowUnitSyndromes.rb:43:in `write': No space left on device
 ./hack/scripts/ShowUnitSyndromes.rb:43
 ./hack/scripts/ShowUnitSyndromes.rb:43
 (eval):2:in `load'
 (eval):2
 (eval):2:in `catch'
 (eval):2

I also have a feature request: Give me an option to print just one dwarf, filtered by name "ShowUnitSyndromes -u Urist" or something similar. Yes, I can generate a html, then reload it, then search in that, but it would be really convenient to have that info in the dfhack console, frame by frame.
« Last Edit: May 02, 2013, 08:09:52 am by Maklak »
Logged
Quote from: Omnicega
Since you seem to criticize most things harsher than concentrated acid, I'll take that as a compliment.
On mining Organics
Military guide for FoE mod.
Research: Crossbow with axe and shield.
Dropbox referral

Ashery

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3682 on: May 02, 2013, 10:20:28 pm »

Spoiler (click to show/hide)
You could always just iterate through the first however-many-you-want with remove_all_skills and then use a modified armoks_blessing on the same however many.

If you don't want to pick them manually or automatically, pick the first 18 or 90.

On the other hand, whatever your goal is, the Object Testing Arena may help?

Sorry about the slow response.

The first suggestion would technically work, but it'd require a substantial increase in the amount of time I spend setting up each trial. If I can automate the script around numeric nicknames, it'd take all of thirty seconds to get an entire new trial up and running (Barring using non-standard training numbers, which I'll definitely be doing a few of).

Object testing arena won't help as I'm going to be looking at the rate of skill gain in training.

I suppose the most succinct way to solve my problem is this: What other ways, beyond the gui bit, are there to select dwarves?
« Last Edit: May 02, 2013, 10:29:22 pm by Ashery »
Logged

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3683 on: May 03, 2013, 09:08:45 am »

If you know how many you need you could make it an argument passed to the script, and it would only adjust exactly that many dwarves. (from first to n)

One command, 18 modified, done.  Or, one command, 90 modified, done.  Or any quantity you want.  No extra time required.

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3684 on: May 03, 2013, 11:35:43 am »

Will we get dfusion embark back in the next version?
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

Ashery

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3685 on: May 03, 2013, 11:36:54 am »

If you know how many you need you could make it an argument passed to the script, and it would only adjust exactly that many dwarves. (from first to n)

One command, 18 modified, done.  Or, one command, 90 modified, done.  Or any quantity you want.  No extra time required.

Yup. Something like that was my primary backup if the nickname method didn't work (And the nickname method is only a slightly more fancy version of it. The main advantage with the nicknames being that each squad would be clustered together in the spreadsheet so spotting trends would be easier. Ie, I'd modify all dwarves with a nickname equal to 0 mod 9 and group the dwarves 0-8 in the first squad and so on. Not necessary by any means, but it'd allow squads that are constantly over/under performing across multiple trials to be easily picked out and allow me to get a bit of extra information out of the testing beyond the main point on training. The nicknames would also allow me to just exclude the military dwarves from the test outright and get a more accurate representation of the stats of an untrained dwarf).

The problem is that I still don't know how to select a dwarf beyond the gui method, as that's both easily understandable and the only method I've seen used.

You want the dwarf manipulator to have a abililty to edit the skills of a unit? I think someone here made a morul script.

This the script you're talking about? http://dwarffortresswiki.org/index.php?title=Utility:DFusion#How_to

It's more useful in terms of teaching me a bit about how the scripting functions, but it still relies entirely on the gui method of selection.
Logged

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3686 on: May 03, 2013, 02:46:23 pm »

--snip--

I suppose the most succinct way to solve my problem is this: What other ways, beyond the gui bit, are there to select dwarves?

scripts/siren.lua in the stop rest loop, finds all citizens.  It also has some in checks for units that are currently in a burrow by position or something.

some possibilities:

by id:
Spoiler (click to show/hide)

active units who have a numeric custom profession:
Spoiler (click to show/hide)

In my personal experience, I have noticed nicknames to be a little flaky in that they sometimes get lost, so I would recommend using custom professions instead.

CLA

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3687 on: May 03, 2013, 03:50:30 pm »

I have some requests/suggestions for the Dwarf Manipulator:
I think generally the plugins would benefit from a little less information, or less exact information. It makes the plugins feel so exploity in some cases.

Specifically, I think it would be great if you could see Happiness not as numerical value, but only as the 5-tiered color code already in place. I think Dwarf Therapist already has a similar setting. Similarly, I propose switching off the exact experience numbers and just showing the general level of expertise (dabbling, legendendary, etc). Basically - don't show more exact information that the game would present the player without DFhack.

It sounds trivial, and I'd do it myself, but I literally have absolutely no experience with this kind of thing.
Logged
CLA - an ASCII-like Graphic Pack with simplified letter-like creature graphics. The simple and clean looks of ASCII with distinct creature graphics - best of both worlds!

http://www.bay12forums.com/smf/index.php?topic=105376.0

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #3688 on: May 03, 2013, 03:58:40 pm »

Speaking of the dwarf manipulator, which I hear and see about the very first time (I vaguely knew of its existence somewhere in its beta stages, but never realized it was finished and released) I do have a question about it:

Would it be possible if it reads out the professions from the raws? It does get the correct creatures sprites using the graphic-raws, but the profession games are vanilla. That is a bit unfitting if your "blowgunner" is actually a "gundwarf" and a "lye maker" is a "chemist".
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 :::

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3689 on: May 05, 2013, 10:30:21 am »

so I just finish 2 modifications on companion order and advfort though companion order script kinda broke on me after I publish this so I need to dive into it some more...
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
Pages: 1 ... 244 245 [246] 247 248 ... 373