Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 269 270 [271] 272 273 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1399262 times)

Askot Bokbondeler

  • Bay Watcher
  • please line up orderly
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4050 on: June 15, 2013, 10:35:37 am »

stuff starting to creep me out. you sure you guys should be playing with that?

Brilliand

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4051 on: June 15, 2013, 01:02:55 pm »

I recently put someone soul back in his body (he was floating around as a ghost, and his body was standing around soulless).  Here's a script that's basically the steps I took to do it:

Code: [Select]
body = dfhack.gui.getSelectedUnit()
histfig = df.historical_figure.find(body.hist_figure_id2)
ghost = df.unit.find(histfig.unit_id)

body.name.first_name = ghost.name.first_name
body.name.nickname = ghost.name.nickname
for a,b in pairs(ghost.name.words) do
body.name.words[a] = b
end
for a,b in pairs(ghost.name.parts_of_speech) do
body.name.parts_of_speech[a] = b
end
body.name.language = ghost.name.language
body.name.unknown = ghost.name.unknown
body.name.has_name = ghost.name.has_name

body.status.current_soul = ghost.status.current_soul
body.status.souls:insert("#", body.status.current_soul)
body.hist_figure_id = ghost.hist_figure_id
body.relations.birth_year = ghost.relations.birth_year
body.relations.birth_time = ghost.relations.birth_time
body.relations.old_year = ghost.relations.old_year
body.relations.old_time = ghost.relations.old_time
body.relations.last_attacker_id = ghost.relations.last_attacker_id
body.flags1.important_historical_figure = ghost.flags1.important_historical_figure
body.flags2.important_historical_figure = ghost.flags2.important_historical_figure

ghost.status.current_soul = nil
ghost.status.souls = {}
ghost.hist_figure_id = -1
ghost.flags1.important_historical_figure = false
ghost.flags2.important_historical_figure = false
ghost.relations.ghost_info = nil
ghost.corpse_parts = {}
ghost.flags1.dead = true

histfig.unit_id = body.id
histfig.flags.ghost = false
histfig.flags[15] = false

I also did some extra stuff to restore his outpost liaison position (which he had lost at death), and he promptly left unhappy.  All well and good... now I don't have that stupid nameless peasant and foreign ghost wandering around my fortress. :P He was never my dwarf anyway, just an unfortunate diplomat.

This situation arose in the first place from a dwarf being killed, animated as an undead, killed again, then properly resurrected.  The upshot of this is that there's a lot of stuff that's lost at animation, not just the soul.  I didn't even catch everything - just the stuff that happened to be different for this particular dwarf.
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4052 on: June 15, 2013, 01:11:13 pm »

stuff starting to creep me out. you sure you guys should be playing with that?

Dwarf Fortress is all about doing what you shouldn't.
Logged

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4053 on: June 15, 2013, 01:16:34 pm »

If only we could change the error to say "Unknown and unknowable." Then we could leave something very creepy for adventurers to find...
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

scamtank

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4054 on: June 15, 2013, 01:23:30 pm »

If only we could change the error to say "Unknown and unknowable." Then we could leave something very creepy for adventurers to find...

You could!

Well, only with the DF localization string patching utility (that Masterwork is currently using to alter existing job titles and such), but it should be possible. I checked one of the string dumps and it's right there, in the open.
« Last Edit: June 15, 2013, 01:25:31 pm by scamtank »
Logged

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4055 on: June 15, 2013, 02:11:17 pm »

I'm sorry, but do I just add 'fix/growthbug enable' to dfhack.init? I didn't quite get what days/months are for.

EDIT: After placing the script to the fix folder, of course.

Sorry for the slow reply, my Internet was down for a few days.

yes, 'fix/growthbug enable' in dfhack.init will work.  That defaults to one month of game time between checks for new units to fix.  If you feel like that is too long, you can give it some number of weeks 'fix/growthbug enable 2w', or some number of days 'fix/growthbug enable 5d', to have it check more often. Or if you want it to check less often 'fix/growthbug enable 3m' would have it check once per season or every 3 months.

I'm back. I haven't had any trouble back in moltenchannels, and I'm still using that code. Is there something I can use to get the actual sizes of dwarves?

you can use my unit-info-viewer (link in sig), it displays actual size and other things.  However, with a growth fix now available, I need to updated it to drop the calculated expectation.
« Last Edit: June 15, 2013, 02:15:09 pm by Kurik Amudnil »
Logged

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #4056 on: June 15, 2013, 07:27:47 pm »

Anyone have any ideas about how to "fix" a dwarf you've used "makeown" to get? Makeown seems to create a dwarf who is "missing" something. I wonder if there is someway to copy stuff from an existing fort dwarf into a dwarf you've acquired via make-own to turn them into a dwarf you can use for everything.
Logged

Brilliand

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4057 on: June 15, 2013, 07:51:48 pm »

Anyone have any ideas about how to "fix" a dwarf you've used "makeown" to get? Makeown seems to create a dwarf who is "missing" something. I wonder if there is someway to copy stuff from an existing fort dwarf into a dwarf you've acquired via make-own to turn them into a dwarf you can use for everything.

What are the indicators that something is missing?
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.

danaris

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4058 on: June 15, 2013, 08:05:18 pm »

Anyone have any ideas about how to "fix" a dwarf you've used "makeown" to get? Makeown seems to create a dwarf who is "missing" something. I wonder if there is someway to copy stuff from an existing fort dwarf into a dwarf you've acquired via make-own to turn them into a dwarf you can use for everything.

What are the indicators that something is missing?

IIRC, dwarves snagged through makeown are not histfigs, and thus cannot be put in armies or have a few other things happen to them.
Logged

Kurik Amudnil

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #4059 on: June 15, 2013, 09:46:11 pm »

Anyone have any ideas about how to "fix" a dwarf you've used "makeown" to get? Makeown seems to create a dwarf who is "missing" something. I wonder if there is someway to copy stuff from an existing fort dwarf into a dwarf you've acquired via make-own to turn them into a dwarf you can use for everything.

What are the indicators that something is missing?

IIRC, dwarves snagged through makeown are not histfigs, and thus cannot be put in armies or have a few other things happen to them.

This post from a while back had something to say about that:

Question about makeown:

I used it on a dwarven caravan guard, but he's not listed as a citizen or member of anything (no blue text in his description). I can force him into a squad using DT and he'll follow station orders, but he won't go and train or put on a uniform, or in fact any clothes at all. He was wearing them at one point, but then dropped everything when I forced him into a squad. Removing him from the squad via DT doesn't make him wear anything either.

Is there any way of making him a full member of the fortress, or does makeown only work for making civilians?
We were trying to make this work over in the ☼Masterwork Succession Fortress: Exultationhexxed☼ game, because migration never started beyond the hardcoded waves. 

Here's my current attempt to supplement tweak makeown by creating a new historical figure record. It's still clearly incomplete.

Code: [Select]
function find_entity(id)
  for ii = 0,#df.global.world.entities.all - 1 do
    if df.global.world.entities.all[ii].id == id then
      return ii
    end
  end
  return -1
end

function create_hist_fig(unit)
  if unit.flags1.important_historical_figure == true then
    print("Already a historical figure.")
    return
  end
 
  new_fig_id = df.global.hist_figure_next_id

  new_hist_fig = df.historical_figure:new()
  new_hist_fig.profession = unit.profession
  new_hist_fig.race = unit.race
  new_hist_fig.caste = unit.caste
  new_hist_fig.sex = unit.sex
  new_hist_fig.appeared_year = unit.relations.birth_year
  new_hist_fig.born_year = unit.relations.birth_year
  new_hist_fig.born_seconds = unit.relations.birth_time
  new_hist_fig.curse_year = unit.relations.curse_year
  new_hist_fig.curse_seconds = unit.relations.curse_time
  new_hist_fig.anon_1 = unit.relations.anon_2
  new_hist_fig.anon_2 = unit.relations.anon_3
  new_hist_fig.old_year = unit.relations.old_year
  new_hist_fig.old_seconds = unit.relations.old_time
  new_hist_fig.died_year = -1
  new_hist_fig.died_seconds = 1
  new_hist_fig.name:assign(unit.name)
  new_hist_fig.civ_id = unit.civ_id
  new_hist_fig.population_id  = unit.population_id
  new_hist_fig.breed_id = -1
  new_hist_fig.unit_id = unit.id
  new_hist_fig.id = new_fig_id
 
  civ_link = df.histfig_entity_link_memberst:new()
  civ_link.entity_id = df.global.ui.civ_id
  civ_link.link_strength =  100
 
  fort_link = df.histfig_entity_link_memberst:new()
  fort_link.entity_id = df.global.ui.group_id
  fort_link.link_strength =  100
 
  new_hist_fig.entity_links:insert('#', civ_link)
  new_hist_fig.entity_links:insert('#', fort_link)
 
  df.global.world.history.figures:insert('#', new_hist_fig)
  df.global.hist_figure_next_id = df.global.hist_figure_next_id + 1
 
  unit.flags1.important_historical_figure = true
  unit.flags2.important_historical_figure = true
  unit.hist_figure_id = new_fig_id
  unit.hist_figure_id2 = new_fig_id
 
  newhist_loc = df.global.world.history.figures[#df.global.world.history.figures - 1]
 
  df.global.ui.main.fortress_entity.histfig_ids:insert('#', new_fig_id)
  df.global.ui.main.fortress_entity.hist_figures:insert('#', newhist_loc)
 
  civ_index = find_entity(df.global.ui.main.fortress_entity.entity_links[0].target)
  df.global.world.entities.all[civ_index].histfig_ids:insert('#', new_fig_id)
  df.global.world.entities.all[civ_index].hist_figures:insert('#', newhist_loc)
end

unit = dfhack.gui.getSelectedUnit()
create_hist_fig(unit)
The guards, when converted, will:
- show up in Dwarf Therapist (because their histfig's are listed for the fortress entity)
- can set and will obey labor preferences
- claim bedrooms
- have strange moods
- join squads (not lead them)
- equip uniforms and weapons as soldiers
- go to training
- obey squad orders to attack, move, etc.

The game doesn't seem to break, and in particular, it will keep creating more historical entities without complaint. (Thanks, Ag!)

The biggest problem is noble assignments and squad leadership. They show up in the list to be made a noble, but once you exit the window, the position remains unfilled.

I think that's an improvement over just tweak makeown, but doesn't do everything necessary to truly add the dwarf to the fortress.

Hommit

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4060 on: June 16, 2013, 01:54:55 am »

Is it possible to make workflow forge steel armor until i have exactly 10 masterwork ones? Can someone give me an asample? thx

edit: i think i got it, but... it seems that workflow manages free items, on top of that in use. any way to disable it after production is done?

edit2:
workflow count ITEM_ARMOR:ITEM_ARMOR_MAIL_SHIRT//INORGANIC:STEEL/LOCAL,MASTERWORK 10 0
Cannot find item type: ITEM_ARMOR:ITEM_ARMOR_MAIL_SHIRT
whats wrong?
« Last Edit: June 16, 2013, 03:00:34 am by Hommit »
Logged

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #4061 on: June 16, 2013, 03:08:48 am »

Kurik, thanks. That looks like a script I can just run, I don't have to hunt down the unit I used the command on?

Also..how do I know to make it a .rb or .lua script? Does it matter?
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #4062 on: June 16, 2013, 07:49:22 am »

Kurik, thanks. That looks like a script I can just run, I don't have to hunt down the unit I used the command on?

Also..how do I know to make it a .rb or .lua script? Does it matter?
It absolutely does matter - in this case, it must be a .lua script.
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.

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #4063 on: June 16, 2013, 08:37:10 am »

Kurik, thanks. That looks like a script I can just run, I don't have to hunt down the unit I used the command on?

Also..how do I know to make it a .rb or .lua script? Does it matter?
It absolutely does matter - in this case, it must be a .lua script.

Is there a way to tell from the code which one I should make? I often find code pasted in a message somewhere with no mention as to whether it should be an rb or a lua script (luckily I chose lua and this script ran fine)
Logged

Brilliand

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4064 on: June 16, 2013, 12:49:44 pm »

Kurik, thanks. That looks like a script I can just run, I don't have to hunt down the unit I used the command on?

Also..how do I know to make it a .rb or .lua script? Does it matter?
It absolutely does matter - in this case, it must be a .lua script.

Is there a way to tell from the code which one I should make? I often find code pasted in a message somewhere with no mention as to whether it should be an rb or a lua script (luckily I chose lua and this script ran fine)

Well, looking through the ruby and lua scripts in my copy of DFHack, ruby scripts have the word "def" dotted around, while lua scripts use "function".  You can also check the comments - comments in lua start with "--", while comments in ruby start with "#".
Logged
The blood of our enemies is but a symbol.  The true domain of Armok is magma - mountain's blood.
Pages: 1 ... 269 270 [271] 272 273 ... 373