Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 249 250 [251] 252 253 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1008708 times)

gchristopher

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3750 on: May 16, 2013, 12:20:05 am »

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.
Logged

scriver

  • Bay Watcher
  • City streets ain't got much pity
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3751 on: May 16, 2013, 04:20:02 am »

or use this: https://github.com/jjyg/dfhack/blob/master/scripts/startdwarf.rb
(paste it into startdwarf.rb in scripts dir)

Thanks, I'll try that.
Logged
Love, scriver~

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3752 on: May 16, 2013, 09:38:20 pm »

There was some interest in a lua script that would make the player's civ (dwarven civ) bring barrels of clean water. This also allows you to embark with barrels of water[5]. Dwarves WON'T drink the water directly from the barrel, so modders have to write a reaction for a workshop (say, the still) which transfers the water from the barrels to buckets. Possibly useful for some harsh embarks.

Code: [Select]
local my_entity=df.historical_entity.find(df.global.ui.civ_id)
my_entity.resources.misc_mat.extracts.mat_type:insert(#my_entity.resources.misc_mat.extracts.mat_type,6)
my_entity.resources.misc_mat.extracts.mat_index:insert(#my_entity.resources.misc_mat.extracts.mat_index,0)

Attempting to embark with barrels of magma didn't work, as all I got were barrels full of cold solid material. It appears that all embark materials appear at room temperature.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #3753 on: May 16, 2013, 10:25:43 pm »

Urist Da Vinci: I once tried adding poisonous giant mushrooms to the first cavern. You cant distinguish them from the other giant mushroom trees, but when felled they generated an evaporating log that had a slightly-harmful syndrome attached.

In short, cutting mushrooms in the caverns had a little danger attached to it.

The problem I encountered is that the wagon, any wooden embark item, and any wooden caravan item has a chance to consist of this wood. The caravan appears on the map, the wood evaporates, caravans is affected and turns around. Or you wagon deconstructs at embark, same for barrels holding your booze.

Question: Can your script remove this specific wood from a civs embark/trading, so that I can add poisonous mushrooms back into the caverns?
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 :::

Hommit

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3754 on: May 17, 2013, 08:37:52 am »

can someone make script (or point me to tutorial and example) to make hotkey actions on gem stockpile to allow|forbid only certain types of gems according to their value (Ornamental/Semi-Precious/Precious/Rare according to http://dwarffortresswiki.org/index.php/DF2012:Gem) ?
(not really sire if belongs here, point me if i wrong plz, thx)
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #3755 on: May 17, 2013, 10:01:36 am »

There isn't actually any in-game designation for ornamental/semi/precious/rare - all you have is the material value, which is enough for the stock raws (all ornamental gems are value 2-10, semi-precious are value 15-30, precious are value 40, and rare are value 60).

Those categories actually existed back in the old 2D versions (0.23.130.23a and earlier), where they were used to determine how deep into the mountain they were placed and were also the only way to restrict stockpiling of them (i.e. it was impossible to have a stockpile which only stored rock crystals - no matter what, you would also get turquoises, aventurines, and rose quartzes).
« Last Edit: May 17, 2013, 10:04:25 am by Quietust »
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.

Hommit

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3756 on: May 17, 2013, 12:37:49 pm »

So there isn't any easy way to designate stockpile to certain value-types of gems? this is really sucks(
Logged

Mr S

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3757 on: May 17, 2013, 01:28:18 pm »

Value type, no.  But you can assign only specific precious stones by name.

So, you could have the nice ones go to the stockpile linked to the gem cutting workshop that only allows Skilled and above gem cutters/setters.  Then another stockpile that takes all the crumby gems linked to the "training" gem shop.
Logged

Hommit

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3758 on: May 17, 2013, 02:11:32 pm »

So, you could have the nice ones go to the stockpile linked to the gem cutting workshop that only allows Skilled and above gem cutters/setters.  Then another stockpile that takes all the crumby gems linked to the "training" gem shop.
That was the idea, yes.. but checking about a hundred of gems, unsorted alphabetically/by value/in any way, in small interface window, for atleast 3 piles... uhhh, no. just no
maybe only rares for artifacts...

hmm... is plugin for sorting gem list by material value possible?
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3759 on: May 17, 2013, 02:59:00 pm »

hmm... is plugin for sorting gem list by material value possible?

Look at the gem stockpile list. Then open up inorganic_stone_gem.txt. What you should notice is that the list is arranged in the exact same order that they are in the file. Just shuffle them around to your liking and voilą.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #3760 on: May 17, 2013, 04:27:54 pm »

It probably wouldn't be too difficult to write a script to do it - it would just require iterating across all inorganics, filtering out which ones are gems, and further filtering their "category" according to their value.
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.

drayath

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3761 on: May 17, 2013, 06:52:24 pm »

A quick helper script for cleaning up fired ammo.
Useful both for map cleaning, and destroying fired ammo so that workflow will replace it.
Sets all ammo in stack sizes of 1 for dumping and unforbids it. Use 'autodump'/'autodump destroy' afterwards to move/destroy marked ammo.

nb/ If you are using a mod that create a single unit of some special ammo type, this will also get marked for dumping.

Spoiler (click to show/hide)
Logged
Drayath's Gem Splitting Workshop - Split large gems and gem trinkets into numbers of small gems.
Drayath's Seed Brewery - Convert bags of spare seeds into useful booze.

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #3762 on: May 17, 2013, 07:48:28 pm »

Is there anything in this that we can use to force them to put an injured dwarf back in bed or diagnose one?
Logged

drayath

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #3763 on: May 17, 2013, 09:47:14 pm »

crossmr, try the following script. Marks the selected dwarf (main game or unit list) as needing diagnosis and requiring someone to carry them to hospital.

This should force re-diagnosis of an injury and get dwarf to a valid bed, it does nothing special to force an injured dwarf to stay in bed.


Spoiler (click to show/hide)
Logged
Drayath's Gem Splitting Workshop - Split large gems and gem trinkets into numbers of small gems.
Drayath's Seed Brewery - Convert bags of spare seeds into useful booze.

crossmr

  • Bay Watcher
    • View Profile
    • Jeonsa
Re: DFHack 0.34.11 r3
« Reply #3764 on: May 18, 2013, 12:49:29 am »

crossmr, try the following script. Marks the selected dwarf (main game or unit list) as needing diagnosis and requiring someone to carry them to hospital.

This should force re-diagnosis of an injury and get dwarf to a valid bed, it does nothing special to force an injured dwarf to stay in bed.


Spoiler (click to show/hide)

I've never used a script before... is there a guide somewhere on how to set this up?
Logged
Pages: 1 ... 249 250 [251] 252 253 ... 373