Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 0.34.11 r3  (Read 1452865 times)

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2115 on: July 05, 2012, 01:45:07 pm »

Oh ok... I have no idea what to do with it, though. I am not good with scripting :P
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 #2116 on: July 05, 2012, 03:39:06 pm »

Code: [Select]
printall(df.global); //many things, world looks useful
printall(df.global.world); //world_data looks promising: could be about global map stuff (hint: it is)
printall(df.global.world.world_data); //sites is a variable!
printall(df.global.world.world_data.sites)

Just letting you know how I figured it out so that you can figure out similar things in the future.

Ah, but of course, hadn't thought about it that way. Thanks for this.
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Cardinal

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2117 on: July 05, 2012, 03:41:21 pm »

Any ideas about forcing these dorfs to become proper members of my fort? Sounds like cardinal is working on something similar...

You can force merchants and Friendly dwarves into becoming Civilized by setting their flags1.merchant tag to false, their flags2.resident tag to false, and their civ_id to the civ_id of the site. I have some stranded dwarf merchants hauling lumber right now. If you want to be picky, you can also change their occupation designation, but that's a bit more involved.
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Cardinal

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2118 on: July 05, 2012, 04:02:13 pm »

Oh ok... I have no idea what to do with it, though. I am not good with scripting :P

Me neither, but you'll have to do a bit if you want to fix this. I'll try to give it to you step by step, and keep in mind that the way I do it may be less convenient than some of the guys here who are more familiar with DFHack.

First, type 'lua' and you should be switched from DFHack to the lua scripting interface in DFHack.

Now, enter the following six lines of code, the code won't run until you type 'end' and hit enter, so you can add them line by line:
Code: [Select]
for k,v in pairs(df.global.world.units.active) do
print("**")
print(v.name.first_name)
print(v.civ_id)
print(v.flags2.resident)
end

This is going to give you a giant list of data, which will basically look like this:
**
Urist
283
false
**
etc..

What you're trying to do is find the numerical identifier for the proper civ_id of your site, because what you're going to do is set the civ_id of your Friendly dwarves to this number. You're also looking for the civ_id of your Friendly dwarves, because you need to know the number you're replacing. How can you tell the civ_id of your site (or your "civilized" dwarves)? Well, it's kind of a pain in the ass, but you should see a block of 7 (or however many civilized dwarves you have) with the same civ_id and a "false" resident tag and first names that you recognize. Ignore all the -1 civ_id creatures, that's just wild animals. How can you tell the civ_id of your Friendly dwarves? It'll be the number that's repeated 117 (or however many you said there were) times. Once you have these two ids (did I mention you should make a copy of your save before you do this? you really should) then you can run the following:

Code: [Select]
for k,v in pairs(df.global.world.units.active) do
if v.civ_id==999 then
v.civ_id=111
v.flags2.resident=false
v.flags1.merchant=false
end
end

Notice there are two 'end' commands, because you have to end the if statement as well as end the for loop. Replace 999 with the number of the civ_id of your FRIENDLY dwarves. Replace 111 with the number of the civ_id of your CIVILIZED dwarves. I added the merchant reset just in case you had any on the map.

I know it seems like a pain, but you just need to dive in and get accustomed to writing a little code. First off, it makes you wealthier. Second, there's a lot of cool stuff you can do with it in Dwarf Fortress, and we can't leave it all to the stuffed shirt, pocket protector-wearing, nerdy LISP wizards (no offense, guys, thanks for building this, really, but you have to admit, those pocket protectors do make you look a little dorky).
« Last Edit: July 05, 2012, 06:09:17 pm by Cardinal »
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Eric Blank

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

When i try to enter the second set of code it gives me an error like this:

Code: [Select]
(interactive):3: syntax error near '=='

after entering the line

Code: [Select]
v.civ_id==5630
5630 being my civ's number. it is identical to the number of all the previous residents because I reclaimed under the same flag i did when I embarked.
« Last Edit: July 05, 2012, 05:22:40 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.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2120 on: July 05, 2012, 05:34:42 pm »

That should be just "=". "=" is for assignment, "==" is for comparison.
Logged

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2121 on: July 05, 2012, 06:04:02 pm »

Thanks. They're all on the "citizens" tab of the unit screen now. I guess just keep going as per normal from here?
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 #2122 on: July 05, 2012, 06:09:48 pm »

Thanks. They're all on the "citizens" tab of the unit screen now. I guess just keep going as per normal from here?

Yup.

Thanks for catching the ==, expwnent.
Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2123 on: July 05, 2012, 07:16:06 pm »

Problem:

None of the old dwarves can be appointed to military/noble positions. I have a lot of good soldiers, and not a lot of replacements for them at the moment. With the population being 155 (I don't even know where the extra ~20 came from) I'm concerned that goblins will show up before the first spring. :o

Any idea how to get over that hurdle as well?
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.

Corai

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2124 on: July 05, 2012, 07:31:08 pm »

Problem:

None of the old dwarves can be appointed to military/noble positions. I have a lot of good soldiers, and not a lot of replacements for them at the moment. With the population being 155 (I don't even know where the extra ~20 came from) I'm concerned that goblins will show up before the first spring. :o

Any idea how to get over that hurdle as well?

You cant get attacked until year2, only risk you have will be a necromancer.
Logged
Jacob/Lee: you have a heart made of fluffy
Jeykab/Bee: how the fuck do you live your daily life corai
Jeykab/Bee: you seem like the person who constantly has mini heart attacks because cuuuute

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2125 on: July 05, 2012, 07:44:16 pm »

Well, I actually expect them to show up with the elven caravan in spring... And I do ahvea  necromancer tower right next door, so that's a concern too.
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 #2126 on: July 05, 2012, 08:40:57 pm »

Problem:

None of the old dwarves can be appointed to military/noble positions. I have a lot of good soldiers, and not a lot of replacements for them at the moment. With the population being 155 (I don't even know where the extra ~20 came from) I'm concerned that goblins will show up before the first spring. :o

Any idea how to get over that hurdle as well?

What's the "profession" of your soldiers? Are they listed as civilian professions or military professions? I've been playing around with things and I found I needed to transform all my merchants into peasants and so you may need to do that to your swordsdwarf/macedwarf/etc. They still aren't available for assignment to noble positions, though, so I'm not sure what's causing that.

Logged
Engraved is an image of a Human and a video game. The Human is making a plaintive gesture.

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2127 on: July 05, 2012, 09:47:59 pm »

Actually it would seem that I can indeed make any of the old troops soldiers, just not in their captain/commander positions. Looks like I didn't have any active soldiers when I abandoned. Problem solved, I suppose.
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.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2128 on: July 05, 2012, 10:02:40 pm »

I've found that dwarves who are in the military, then die, then are resurrected with an interaction (not raised, resurrected), cannot join the military or become nobles. Is there any fix to this?
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2129 on: July 05, 2012, 10:08:24 pm »

what I learn from retired sites and switching back to them is that any military you assign will more or less still be able to control when you return, the only issue I can see form this is using reclaim.
you also get control over your military dwarves if you don't alter the is resident flag. which means you can set up patrol points on your retired fort. the noble issue has plague us way back when we found retiring forts. I guess it has to do with either fort mode being desync. Though you should be able to stick them in as recruits just not captains.  But this is kinda back then and toady did update military so could be he made a "failsafe" to prevent any other who not apart of the civ fully.

I've found that dwarves who are in the military, then die, then are resurrected with an interaction (not raised, resurrected), cannot join the military or become nobles. Is there any fix to this?
Check your interactions to see if it doesn't change their race or remove a tag.
« Last Edit: July 05, 2012, 10:10:11 pm 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
Pages: 1 ... 140 141 [142] 143 144 ... 373