Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 344 345 [346] 347 348 ... 360

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

xordae

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5175 on: January 31, 2017, 01:39:35 pm »

The auto-melt for stockpiles doesn't seem to do anything.. I let it run for a month or two. Auto-trade works though. I'm on alpha 4.
Logged

Artemiuz28

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5176 on: January 31, 2017, 02:40:26 pm »

Hello. I want to know how to use furnaces in gui/adv-fort. All other workshops work fine, but I can't figure out how furnaces work. I'm using DFHack 43.05 alpha 3. Thanks

Edit: After an hour of browsing throufg wiki, I saw that furnaces have to be built in two steps. Solved
« Last Edit: January 31, 2017, 03:38:03 pm by Artemiuz28 »
Logged

than402

  • Bay Watcher
  • DF2014:we all knew it was inevitable
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5177 on: January 31, 2017, 03:26:32 pm »

you probably need to change their civ ids and remove the resident flag on them if  you end up spawning friendlies
which might mean digging around the unit's data through gui/gm-editor.

so... I manually changed the civId and the resident flag is off, but I still can't assign jobs on him (DT considers him a non citizen). Which flags determine if he's a citizen?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5178 on: January 31, 2017, 04:18:15 pm »

you probably need to change their civ ids and remove the resident flag on them if  you end up spawning friendlies
which might mean digging around the unit's data through gui/gm-editor.

so... I manually changed the civId and the resident flag is off, but I still can't assign jobs on him (DT considers him a non citizen). Which flags determine if he's a citizen?

Citizenship should be tied to civ_id and pop_id as well as having a correct hist_fig. I would look at the unit you spawned and a civ member with gui/gm-editor and see what differences there are. If none pop out at you you may need to change the values in the hist_fig as well.
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5179 on: February 01, 2017, 10:15:33 am »

you probably need to change their civ ids and remove the resident flag on them if  you end up spawning friendlies
which might mean digging around the unit's data through gui/gm-editor.

so... I manually changed the civId and the resident flag is off, but I still can't assign jobs on him (DT considers him a non citizen). Which flags determine if he's a citizen?

Citizenship should be tied to civ_id and pop_id as well as having a correct hist_fig. I would look at the unit you spawned and a civ member with gui/gm-editor and see what differences there are. If none pop out at you you may need to change the values in the hist_fig as well.

I tried to clear relevant data off some intelligent pets (gremlins, i had heard rumours that freshly tamed gremlins could apply for residencies and citizenships, also playing as a goblin civ so keeping them was fine) the creature had the correct same civ, but no population information or additional data in those fields. Generally no luck though i could tone down its tameness in gm-editor to see if it has any effect or wait it out for a little while for it to do actions on its own (if inclined to residency petition at all)

I will try messing with the historical data, thanks for the nugget of guidance, and i hope it helps you too in understanding more about (something about meeting structure MEET_WORKERS, mixed in with locking onto a target = the noble & place being pre-determined when they prompt to apply) the mutual behaviours so that one day we could have a script where we simply click a target and they apply for citizenship/residency.


On another note, forgive my ignorance but on which edition of DFhack was the stockpile manager ([ i ] over stockpile) added? I've identified a bug which the stockpile manager helps to fix in this issue report about refuse materials not releasing rotted goods it percieves to be teeth/ivory & horns because they have no meat content. Just by using the stockpile controls to stop discriminating rotted goods ([CTRL] + [X])

0010130: Refuse stockpile disallows 'rotted' items from being used in reactions - teeth/ivory, horn (hotfix included)

its a good addition, and i'd personally like to know for reference how far back into DFhack it goes so it can help combat this bug further by applying the adjustment.
« Last Edit: February 01, 2017, 10:18:14 am by FantasticDorf »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5180 on: February 01, 2017, 11:02:07 am »

Gremlins apply for citizenship after a while (about a year or possibly two?), probably the same time as visitor residents apply for citizenship. They don't apply for residence, though, as that has already been forced upon them. It seems to happen slightly after they change "profession" to hunter, but that can be a coincidence.
Given their dual status as both animals and sapient members, they're fairly quirky to work with.
- You can give them regular work task through DT (but not DF itself).
- They need to be retrained regularly, but when citizens they generally work rather than show up for training -> recommend hacking their tameness to fully tame when accepting them as citizens.
- They're too small to wear any clothes, and they don't have any clothing size of their own. I modify them to twice their vanilla size so they fit into kobold clothed.
- If appointed as nobles, they can issue demands, and probably mandates as well, but you can't see what these are, as you can't view their thoughts.

Given their general quirkiness, I would avoid using gremlins as any kind of model to base citizen progression on.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5181 on: February 01, 2017, 11:43:15 am »

you probably need to change their civ ids and remove the resident flag on them if  you end up spawning friendlies
which might mean digging around the unit's data through gui/gm-editor.

so... I manually changed the civId and the resident flag is off, but I still can't assign jobs on him (DT considers him a non citizen). Which flags determine if he's a citizen?

Citizenship should be tied to civ_id and pop_id as well as having a correct hist_fig. I would look at the unit you spawned and a civ member with gui/gm-editor and see what differences there are. If none pop out at you you may need to change the values in the hist_fig as well.

I tried to clear relevant data off some intelligent pets (gremlins, i had heard rumours that freshly tamed gremlins could apply for residencies and citizenships, also playing as a goblin civ so keeping them was fine) the creature had the correct same civ, but no population information or additional data in those fields. Generally no luck though i could tone down its tameness in gm-editor to see if it has any effect or wait it out for a little while for it to do actions on its own (if inclined to residency petition at all)

I will try messing with the historical data, thanks for the nugget of guidance, and i hope it helps you too in understanding more about (something about meeting structure MEET_WORKERS, mixed in with locking onto a target = the noble & place being pre-determined when they prompt to apply) the mutual behaviours so that one day we could have a script where we simply click a target and they apply for citizenship/residency.


I know I've created units that function as full members of a civ, but I can't remember all the things that needed to be changed. Unfortunately I recently lost many of my test scripts of which that was one, but it is definitely possible and I think it only involved changing some tags on the unit and then in the unit's hist_fig entry
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5182 on: February 01, 2017, 12:01:35 pm »

Good News! I have figured out how to butcher a corpse using a script. All you need is the corpse id (or unit id). unfortunately my only access to the internet for the next month or so is through work, and I can't put any files on these computers which means I can't upload anything. So I won't be able to upload my script, but I can give a walkthrough here of the steps and if someone else is adventurous they can upload a script (it's really pretty simple). Note that this is just an outline and the variables are from memory, so they might not be exactly right;
  • change df.global.gametype to DWARF_ARENA
  • change df.global.ui.main.mode to LOOK_AROUND
  • change df.global.cursor.x/y/z to the x/y/z of the corpse (if given a unit id, find it's corpse first)
  • iterate through df.global.ui_look_list until you find the corpse item id
  • change df.global.ui_look to the index from df.global.ui_look_list
  • simulate the input for butchering
  • return df.ui.main.mode and df.global.gametype to what they were when you started
And there you have it, a butchered creature with a script. Now I haven't fully tested the behavior or even the outputs of butchering an animal this way vs the normal way, so that may throw a wrench in things.

On a related note, is there a script for creating trees? Because I realized when I was doing this that you could create trees the same way we create units with modtools/create-unit. You can even specify the age of the tree and a few other things (like type). Wasn't sure if we could already do this, but if not then a simple edit of create-unit will give you create-tree.

On an unrelated note, I have a lua programming question. Say I have a table, Table.A.B.C.D.E, if I want to check if the last entry is there I can simply do if Table.A.B.C.D.E then ... But if I want to check if the last entry is there and I'm not sure if the others are there I have to do a nested if, (i.e.
Code: [Select]
if Table.A then
 if Table.A.B then
  if Table.A.B.C then
   if Table.A.B.C.D then
    if Table.A.B.C.D.E then ...
Is there a simpler way of doing this? Can I do, if Table.A and Table.A.B and Table.A.B.C and Table.A.B.C.D and Table.A.B.C.D.E then ...?
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5183 on: February 01, 2017, 12:10:14 pm »

You could write a function to do the checks, I'll post one here in a few seconds.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5184 on: February 01, 2017, 12:14:40 pm »

On a related note, is there a script for creating trees? Because I realized when I was doing this that you could create trees the same way we create units with modtools/create-unit. You can even specify the age of the tree and a few other things (like type). Wasn't sure if we could already do this, but if not then a simple edit of create-unit will give you create-tree.
I don't believe anyone has done this, but it could work.

On an unrelated note, I have a lua programming question. Say I have a table, Table.A.B.C.D.E, if I want to check if the last entry is there I can simply do if Table.A.B.C.D.E then ... But if I want to check if the last entry is there and I'm not sure if the others are there I have to do a nested if, (i.e.
Code: [Select]
if Table.A then
 if Table.A.B then
  if Table.A.B.C then
   if Table.A.B.C.D then
    if Table.A.B.C.D.E then ...
Is there a simpler way of doing this? Can I do, if Table.A and Table.A.B and Table.A.B.C and Table.A.B.C.D and Table.A.B.C.D.E then ...?

Yes: safe_index(Table, "A", "B", "C", "D", "E"). It will return nil if any keys are not found.




On another note, forgive my ignorance but on which edition of DFhack was the stockpile manager ([ i ] over stockpile) added? I've identified a bug which the stockpile manager helps to fix in this issue report about refuse materials not releasing rotted goods it percieves to be teeth/ivory & horns because they have no meat content. Just by using the stockpile controls to stop discriminating rotted goods ([CTRL] + [X])

0010130: Refuse stockpile disallows 'rotted' items from being used in reactions - teeth/ivory, horn (hotfix included)

its a good addition, and i'd personally like to know for reference how far back into DFhack it goes so it can help combat this bug further by applying the adjustment.
That looks like the "stocks" plugin, which has been around in some form since 0.34.11. I don't know when the "i" option was added. Incidentally, that option is apparently buggy in 0.43.05 - see this issue.
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.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5185 on: February 01, 2017, 12:18:18 pm »

Code: [Select]
function CheckTable(tbl, keys)
    for _, key in ipairs(keys) do
        if tbl[key] == nil then return false end
        tbl = tbl[key]
    end
    return true
end

-- Usage:
local a = {a = {b = {c = 1}}}
CheckTable(a, {"a", "b", "c"}) -- returns true
CheckTable(a, {"x", "y", "z"}) -- returns false

Ninja!
Yes: safe_index(Table, "A", "B", "C", "D", "E"). It will return nil if any keys are not found.

Where does this function come from? (Google says dfhack.safe_index(), I must have missed it...)
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5186 on: February 01, 2017, 12:55:16 pm »

It's defined in hack/lua/dfhack.lua (or library/lua/dfhack.lua in the source tree), but it is not nested under "dfhack", so you need "safe_index", not "dfhack.safe_index".
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.

FantasticDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5187 on: February 01, 2017, 12:57:06 pm »

On another note, forgive my ignorance but on which edition of DFhack was the stockpile manager ([ i ] over stockpile) added? I've identified a bug which the stockpile manager helps to fix in this issue report about refuse materials not releasing rotted goods it percieves to be teeth/ivory & horns because they have no meat content. Just by using the stockpile controls to stop discriminating rotted goods ([CTRL] + [X])

0010130: Refuse stockpile disallows 'rotted' items from being used in reactions - teeth/ivory, horn (hotfix included)

its a good addition, and i'd personally like to know for reference how far back into DFhack it goes so it can help combat this bug further by applying the adjustment.
That looks like the "stocks" plugin, which has been around in some form since 0.34.11. I don't know when the "i" option was added. Incidentally, that option is apparently buggy in 0.43.05 - see this issue.

Interesting, i've personally not experienced any bugs like this myself but then again i only used a limited range & amount of active stockpiles between testing (also tried said hotfix on elephants hunted animals for ivory, works like a charm). If it's any other valuable information dead_dwarf=true objects are not listed at all upon a relevant corpse (/graveyard) stockpile for citizens until they are unset from dead_dwarf true and changed to false (EI - dead_dwarf=false troll tripe as the FoTF derail thread shows)

Dead_dwarf=true was active in previous version with no noticable effect on item usage, (as shown by Max's research on version 40.24 travelling around the world as a adventuerer eating the people who live on different sites for different dead_dwarf=true self set on citizens) so checking with a 40.24 linux version (the only availible version of that i've seen) whether stocks manager 'sees' the object might help.
Logged

TheFlame52

  • Bay Watcher
  • Master of the randomly generated
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5188 on: February 01, 2017, 02:05:09 pm »

Whatever happened to the drainaquifers script? Any way we could get it back?

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5189 on: February 01, 2017, 02:16:27 pm »

It was renamed to drain-aquifer.

Also, it's mentioned in http://dfhack.readthedocs.io/en/stable/docs/History.html. If you ever have similar questions, http://dfhack.readthedocs.io/en/stable/NEWS.html and that page are good places to look.
« Last Edit: February 01, 2017, 02:19:10 pm by lethosor »
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.
Pages: 1 ... 344 345 [346] 347 348 ... 360