Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Masterwork and autofarm.rb  (Read 1397 times)

theit8514

  • Escaped Lunatic
    • View Profile
Masterwork and autofarm.rb
« on: March 16, 2014, 01:43:30 pm »

I started out my embark with a ton of seeds from my local dwarf store, and when I got to the embark autofarm.rb was freaking out. I started investigating and found out that it was trying to assign plots with seeds which couldn't be planted because the biome was incorrect.

So, I'm pretty rusty at ruby and I'm sure my code is horrible, but I present the updated autofarm.rb with biome support. Yay.

https://github.com/theit8514/dfhack/commit/1e5bca087f4e68eb8f807b9569c986858e412cc2

This should detect any [BIOME] tag in plant raws, except for underground plants which seem to be hard coded to SUBTERRANEAN_WATER and not the actual biome the farm plot is in. Theoretically, the map_designation_at should return SUBTERRANEAN_WATER if the plot is underground, but it's not. Anyways, all the underground plants in vanilla are SUBTERRANEAN_WATER, and I checked several for Masterwork and couldn't find any different. If any bugs show up with that, let me know.
Logged