Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 141 142 [143] 144 145 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1459331 times)

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2130 on: July 05, 2012, 10:13:58 pm »

Oh! I've got a thought!

I just reviewed the profile of my old manager, who is apparently still a manager. My manager, however, is the expedition leader of my reclaim team.

Anyway, the old manager is manager of "The Granite Citadels," while my reclaim team are members of "The Bent Plank." These are local government names. Can't recall if the Granite Citadels was the original local government of my fortress, or if it is the government installed after I abandoned, but I'd wager that's the reason the dwarves can't be assigned noble positions, but still hold noble positions seemingly of their own accord. They're actually part of a different government entity, outside the player's jurisdiction.

It's almost as if Toady secretly updated my game to 34.12... :P

Edit: Actually, a lot of the old dwarves are members of both "The Crypt of Weavers" and "The Granite Citadel."
« Last Edit: July 05, 2012, 10:18:43 pm by Eric Blank »
Logged
I make Spellcrafts!
I have no idea where anything is. I have no idea what anything does. This is not merely a madhouse designed by a madman, but a madhouse designed by many madmen, each with an intense hatred for the previous madman's unique flavour of madness.

Cardinal

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2131 on: July 05, 2012, 10:32:44 pm »

Oh! I've got a thought!

I just reviewed the profile of my old manager, who is apparently still a manager. My manager, however, is the expedition leader of my reclaim team.

Anyway, the old manager is manager of "The Granite Citadels," while my reclaim team are members of "The Bent Plank." These are local government names. Can't recall if the Granite Citadels was the original local government of my fortress, or if it is the government installed after I abandoned, but I'd wager that's the reason the dwarves can't be assigned noble positions, but still hold noble positions seemingly of their own accord. They're actually part of a different government entity, outside the player's jurisdiction.

It's almost as if Toady secretly updated my game to 34.12... :P

Edit: Actually, a lot of the old dwarves are members of both "The Crypt of Weavers" and "The Granite Citadel."

I think you're onto something. I still haven't figured out what determines "membership". There's a "civ_id" trait and a "population_id" trait, and I've set these to the same values for my merchants but that just affects citizenship. I'm not sure what affects membership and have yet to see some trait in the units or the flags that seems to hold that value.
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2132 on: July 06, 2012, 02:56:02 am »

Wait did someone in SA just figure out how to switch from fort mode to adventure mode using the old way of switching?

Eric try messing with the reclaim modes my guess is one of them will reclaim as the same group from before, and the other is reclaiming as a different group of dwarves. Also you can use a pointer and lua to set someone as an adventurer in fort mode so that when you switch over you don't have to jump as many hoops.
« Last Edit: July 06, 2012, 03:06:33 am by Rumrusher »
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

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r1
« Reply #2133 on: July 06, 2012, 07:30:39 am »

I think you're onto something. I still haven't figured out what determines "membership". There's a "civ_id" trait and a "population_id" trait, and I've set these to the same values for my merchants but that just affects citizenship. I'm not sure what affects membership and have yet to see some trait in the units or the flags that seems to hold that value.
The "population_id" trait is only for wild animals. What you're looking for is within the unit's historical_figure record: entity links.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Cardinal

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2134 on: July 06, 2012, 12:19:36 pm »

The "population_id" trait is only for wild animals. What you're looking for is within the unit's historical_figure record: entity links.

It seems like civilized dwarves have population_id values, though, any idea why?

Also, I'm looking at the df.global.world.history.figures.entity_links, is that what you mean? The dwarves that are members of local government have two entity_link values, whereas my newly civilized merchant has only one, but the values are unique, they are not simple integers like civ_id. How are they handled?
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2135 on: July 06, 2012, 01:11:52 pm »

It seems like civilized dwarves have population_id values, though, any idea why?

Also, I'm looking at the df.global.world.history.figures.entity_links, is that what you mean? The dwarves that are members of local government have two entity_link values, whereas my newly civilized merchant has only one, but the values are unique, they are not simple integers like civ_id. How are they handled?

There are entity populations too - no idea what are they used for; maybe that's where the 'hill dwarves' will be handled in the future, and whatever similar there is already in legends & adventure modes (like maybe all the nameless citizens in towns, etc). That population_id field is actually entity populations - animals use a whole structure with multiple fields to select one of the many possible populations they can come from (see unit.unknown4.population).

Links are objects - they have fields and methods.
« Last Edit: July 06, 2012, 01:14:48 pm by ag »
Logged

Cardinal

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2136 on: July 06, 2012, 01:48:56 pm »

Links are objects - they have fields and methods.

Could you give me quick tutorial or point me at something that describes how to work with them?
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Miskav

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2137 on: July 06, 2012, 04:11:27 pm »

After reading some posts here having the same problem, I haven't found a solution yet.

I put the DFhack stuff together with the corresponding DF version and upon starting DF a second screen doesn't popup.
This is on win7 64x.

Any ideas?
Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2138 on: July 07, 2012, 12:17:07 am »

I found out how to reset patrol anger to zero for individual dorfs, and thought it would be nice to make a script to do it to all dorfs.  Not sure how to cycle through just the units in one's fortress though.

This might be running before I've learned to walk, but a true fix for this would be to trigger the function whenever they go from active to inactive status.  Is that possible?

Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

mordrax

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2139 on: July 07, 2012, 07:42:20 am »

i'm at a loss on how to set the dyer to dye all my dimple cups using workflow. i've been crawling through the object and entity files but haven't found how to set a watch on the dye. anyone know? or can direct me on where to look?
Logged

Mr S

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2140 on: July 07, 2012, 01:57:59 pm »

A walkthrough of workflow would be handy.  As detailed or generalized as can be.  I'll be trying it out for the first time on the fortress I'm just getting going.  Haven't used workflow before, just been abusing the Manager, lol.  As I understand it, it "suspends" then "un-suspends" work orders set to repeat in a workshop?  Will the un-suspension be put back to the workshop it was taken from?  If so, what about the case where said workshop is removed, destroyed, inaccessible, covered in magma, etc.?  Handy for cases such as glass works where you have a couple next to the surface for gathering, then a magma glass works at the sea for actually making things.

The README give syntax, but no real detail about Theory of Operation, which is what I really need for all of these Hax.
Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2141 on: July 07, 2012, 02:12:40 pm »

Alright, I think I might have something:


Code: [Select]
local index = 0
local total = #(df.global.world.units.active)
local max = total-1

for index=0,max do

unit=df.global.world.units.active[index]

if dfhack.units.isCitizen(unit) then

unit.military.patrol_timer=0

end

This will (I hope) get the list of active units, check each one to see if it's a live, sane member of your fort.  If so, it resets their patrol timer to 0.  It's my attempt to counteract the long patrol duty bug.

This is my first real script, and I'm not sure if there's something I don't know that could cause memory leaks or some sort of data corruption here if I was clumsy, though it seems like it should work.  Could someone please verify that for me?

How much trouble can I create for myself by using the lua console anyway?  Is it limited to corrupting my save files or can I actually cause permanent damage to my operating system or PC?  How hard is that to do and what sort of things would lead to that?
« Last Edit: July 07, 2012, 02:15:06 pm by Makbeth »
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

Hesuchia

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2142 on: July 07, 2012, 02:38:50 pm »

The worst I've ever done with the lua console is crash my game. It's probably best to quicksave beforehand (though sometimes I'm lazy and reckless :P).

you could also do something like

Code: [Select]
for k, v in pairs(df.global.world.units.active) do
if dfhack.units.isCitizen(v) then
v.military.patrol_timer=0

so you won't have to worry about an index value.  You could also do "units.all" instead of "units.active" so you don't have to worry about what "active" might mean. It'll still just iterate through your own civs.

The for k, v in pairs(blah) splits "blah" into a table of key/value pairs. In this case an index number and a pointer to a specific unit, so the index would already be accounted for.  It's a handy shortcut that I use for pretty much everything :P.
Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2143 on: July 07, 2012, 02:50:11 pm »

I've seen that a lot of places but had no idea what it does.  Thanks!
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

Hesuchia

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2144 on: July 07, 2012, 03:07:58 pm »

No problem. If you want to actually see the pairs it'll split into, you can use the "printall" command.  printall(df.global.world.units.active) will show the k and the v for the units in that last example.  Really, really useful for exploring code structures.
Logged
Pages: 1 ... 141 142 [143] 144 145 ... 373