Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 368 369 [370] 371 372 373

Author Topic: DFHack 0.34.11 r3  (Read 1019028 times)

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5535 on: June 03, 2014, 08:28:16 pm »

Thank you Urist DaVinci, Expwnent and Quietust. I did do some testruns with the pet, minions, puller/packer/wagons that are added by script. It works as advertised and allows many new features. Gnomish steamtanks as wagons, pulled by steamengine creatures... or orc sieges that suddenly bring squads of ogres, cyclops and minotauri along, just like goblins bring trolls. It is all very, very neat. :)

It occurred to me that they would be missing animal products - all your meats, leathers, cheeses, wool, etc. is tracked elsewhere in the entity resources structure (so it doesn't have to be recalculated after worldgen).

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5536 on: June 04, 2014, 03:08:49 am »

Thank you Urist DaVinci, Expwnent and Quietust. I did do some testruns with the pet, minions, puller/packer/wagons that are added by script. It works as advertised and allows many new features. Gnomish steamtanks as wagons, pulled by steamengine creatures... or orc sieges that suddenly bring squads of ogres, cyclops and minotauri along, just like goblins bring trolls. It is all very, very neat. :)

It occurred to me that they would be missing animal products - all your meats, leathers, cheeses, wool, etc. is tracked elsewhere in the entity resources structure (so it doesn't have to be recalculated after worldgen).
I checked the embark, the leathers, meat, cheese, wool... its all still there. No issues.
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 :::

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #5537 on: June 04, 2014, 03:07:31 pm »

It occurred to me that they would be missing animal products - all your meats, leathers, cheeses, wool, etc. is tracked elsewhere in the entity resources structure (so it doesn't have to be recalculated after worldgen).
I checked the embark, the leathers, meat, cheese, wool... its all still there. No issues.
If the civilization already had access to the creature by other means, then you'll be fine, but if you were adding a special creature (e.g. no biomes) to pack/pull/mount/pet/minion then its products will NOT be automatically included - I just checked the code, and I can't find evidence of that being done afterwards, so you do need to add those yourself, and doing it correctly is a bit complicated:

Code: [Select]
* If the civilization has USE_ANIMAL_PRODUCTS:
** if the creature/caste lacks CAN_LEARN or the civ's ethic for EAT_SAPIENT_OTHER is set to ACCEPTABLE, REQUIRED, or PERSONAL_MATTER:
*** add to fish_races/fish_castes if it has FISHITEM
*** add to egg_races/egg_castes if it has LAYS_EGGS
*** for each entry in caste_raw.unknown2.materials where the entry in caste_raw.unknown2.unk_2f30 is zero:
**** for every reaction product that the material has:
***** if the reaction product ID matches any reaction that produces SKIN_TANNED (e.g. TAN_A_HIDE), add the product material to resources.organic.leather
**** if the material has the MEAT flag, add it to resources.misc_mat.meat
**** if the material has the LEATHER flag, add it to resources.misc_mat.leather and resources.misc_mat.crafts
**** if the material has the BONE flag, add it to resources.misc_mat.crafts and resources.refuse.bone
**** if the material has the SHELL flag, add it to resources.misc_mat.crafts and resources.refuse.shell
**** if the material has the PEARL flag, add it to resources.misc_mat.crafts and resources.refuse.pearl
**** if the material has the HORN flag, add it to resources.misc_mat.crafts and resources.refuse.horn
**** if the material has the TOOTH flag, add it to resources.misc_mat.crafts and resources.refuse.ivory
*** add caste_raw.unknown2.mat_type/mat_index to resources.misc_mat.meat
** add each material from caste_raw.extracts.extract_mat/matidx to resources.misc_mat.extracts
** if caste.extracts.milkable_mat/matidx is valid, add it to resources.misc_mat.extracts if valid
** if the entity has PERMITTED_JOB:SHEARER and PERMITTED_JOB:SPINNER:
*** for each entry in caste_raw.shearable_tissue_layer, add all shearable YARN tissue materials to resources.organic.wool (part_idx/unk_8 into body_info.body_parts[], then layer_idx/unk_18 into body_part_raw.tissue_id, then that tissue_id into creature_raw.tissue[] to get the mat_type/index)
** if caste.extracts.blood_mat/matidx is valid, add it to resources.misc_mat.extracts if valid
** if caste.extracts.webber_mat/matidx is valid and made of SILK, add it to resources.misc_mat.crafts and resources.organic.silk
** for each entry in caste_raw.body_info.attacks
*** add each value for specialattack_mat_type/index to resources.misc_mat.extracts, though to avoid bug #1044 you should first make sure the corresponding specialattack_type is equal to INJECT_EXTRACT (0) and the matter state is not equal to GAS (2)
** for each entry in caste_raw.secretion, add mat_type/index to resources.misc_mat.extracts if the matter_state is not equal to GAS (2)
** if you added an entry to resources.misc_mat.extracts that has a CHEESE_MAT reaction product, add that product material to resources.misc_mat.cheese
« Last Edit: June 04, 2014, 03:09:19 pm 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.

Quarterblue

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5538 on: June 04, 2014, 03:59:08 pm »

https://github.com/DFHack/dfhack/blob/develop/NEWS
I see a lot of scripts such as what was made by Urist Da Vinci (or forumdwarves or "text will be text") are not included. Will they be compatible?
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5539 on: June 04, 2014, 07:37:26 pm »

If they're just little ruby or Lua scripts, most likely. If they're actual plugins in .dll form, no.
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5540 on: June 04, 2014, 10:08:02 pm »

https://github.com/DFHack/dfhack/blob/develop/NEWS
I see a lot of scripts such as what was made by Urist Da Vinci (or forumdwarves or "text will be text") are not included. Will they be compatible?

If the lua scripts used game data which was named "unk_*" or "anon*" or similar, it may have been renamed in r5. This would happen if we had discovered recently what the data does, and gave it a proper name. This would break the script temporarily until the new name was used.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5541 on: June 04, 2014, 11:58:32 pm »

is there a way to resize farms using dfhack.  Kind of like how I can cut away pieces of zones and/or stockpile areas.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5542 on: June 05, 2014, 10:08:31 am »

is there a tree array in the df structures I can cycle through?

I'm hoping to type up a script that applies a chance of upgrading saplings to trees.

I'd also like a small chance to spawn saplings at a nearby radius (say a 2 step distance from the source tree, I would have to check if the destination tile is currently on map and a conditional check if it's a soil based tile with no existing tree/sapling).  The second question is a little more difficult, however... if the trees had stored x,y coordinates in the array (if not, then I would need a way to extract x,y cordinates after being able to identify trees in some structure, and create my own array, say trees[], that has member variables {sapling/tree status, x,y coordinates}.

I was looking at the structures...

has trees and saplings defined

https://github.com/DFHack/df-structures/blob/master/df.plant-raws.xml

and soil is defined here
https://github.com/DFHack/df-structures/blob/master/df.tile-types.xml

now just need to be able to do a get x,y function.

« Last Edit: June 05, 2014, 11:05:18 am by thistleknot »
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r3
« Reply #5543 on: June 05, 2014, 12:30:57 pm »

is there a tree array in the df structures I can cycle through?

I'm hoping to type up a script that applies a chance of upgrading saplings to trees.

I'd also like a small chance to spawn saplings at a nearby radius (say a 2 step distance from the source tree, I would have to check if the destination tile is currently on map and a conditional check if it's a soil based tile with no existing tree/sapling).  The second question is a little more difficult, however... if the trees had stored x,y coordinates in the array (if not, then I would need a way to extract x,y cordinates after being able to identify trees in some structure, and create my own array, say trees[], that has member variables {sapling/tree status, x,y coordinates}.

I was looking at the structures...

has trees and saplings defined

https://github.com/DFHack/df-structures/blob/master/df.plant-raws.xml

and soil is defined here
https://github.com/DFHack/df-structures/blob/master/df.tile-types.xml

now just need to be able to do a get x,y function.
The actual "tree" structure is in https://github.com/DFHack/df-structures/blob/master/df.plants.xml, but it's also used for shrubs so you'll need to take that into account.

The global list of all plants is here, but creating new trees from scratch requires following certain steps exactly or you will corrupt your savegame. For reference, those steps are correctly followed in this plugin command.
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.

Nopenope

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5544 on: June 05, 2014, 01:11:26 pm »

Is there a manual of some kind to write plugins/scripts or a repository that keeps track of all of them?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5545 on: June 05, 2014, 01:30:12 pm »

Nopenope

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5546 on: June 05, 2014, 01:55:06 pm »

It doesn't contain all the scripts, far from it, and it only provides documentation for lua (no ruby/python/c++).
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5547 on: June 05, 2014, 02:10:30 pm »

It doesn't contain all the scripts, far from it, and it only provides documentation for lua (no ruby/python/c++).
It's the official repo. See the develop branch for new stuff. Also there is no python bindings (afaik) and c++ part is mostly comment-documented and i learned by examples/hanging out in the irc and bugging the people that know stuff. As for ruby bindings (I forget who wrote it) they are really similar to lua.
Biggest problem is that you need to know df very intimately to do stuff. And there is just so much to know... I mean here is the data structures but still there are strange ways df is doing stuff. AFAIK there is no easy way. Also i should have written many tutorials and maybe someday i will until then i'll repeat myself: check other people scripts (especially the official repo ones, they might be nicer, more correct, etc...), bug people (especially in irc, though remeber timezones, and patience), play with gui/gm-editor - that is the thing i made for myself to check stuff out, and edit df on the fly and soon you'll be writing next great total conversion that allows you to build rockets and crash moons into enemy forts.

PeridexisErrant

  • Bay Watcher
  • Dai stihˇ, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5548 on: June 05, 2014, 05:36:16 pm »

It doesn't contain all the scripts, far from it,

If there are scripts that you think should be there, open an issue and it should happen eventually. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5549 on: June 05, 2014, 06:10:30 pm »

is there a way to show the raw entry for a workshop job?  Often I'm wondering what skill/labor does a job (in a mod).
Pages: 1 ... 368 369 [370] 371 372 373