Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: Wheelbarrows !!SCIENCE!! aka working Proof of Concept - now with more fun  (Read 8162 times)

bdog

  • Bay Watcher
    • View Profile

One image is more than a thousand words:



At the moment this is just a proof of concept (that is working actually).
Basically the whole idea was to have containers that would help with hauling jobs - instead of 10 hauling jobs over long distance a dwarf would pack items on a wheelbarrow and do one hauling job and then unpack those items when he reached the destination.

How does it work?
- build loading station near items that you want to haul (A)
- build unloading station (B) somewhere far away
- queue "Load stone" job in (A)
- dwarf will look for an empty wheelbarrow and 5 stones and load them on it
- unloading station will automatically queue unload job (when it will find a boulder containing wheelbarrow)
- another dwarf will move wheelbarrow full of stones to unloading station (B) and begin to unload one stone at a time

To improve this one could put a burrow on loading station so loader will not look for items outside of designated area.

Raws:
1. Copy this and save as "item_bdog.txt":
Code: [Select]
item_bdog

[OBJECT:ITEM]

[ITEM_TOOL:WHEELBARROW]
[NAME:Wheelbarrow:Wheelbarrows]
[SIZE:20000]
[HARD_MAT]
[UNIMPROVABLE] remove this if you want to have wheelbarrows with quality
[CONTAINER_CAPACITY:100000]
[TILE:229]
[VALUE:10]

2. Copy this and save it as "building_bdog.txt" (it's just copypasta from screw press so one would want to customize it a bit; for example build_labor, tile or color):
Code: [Select]
building_bdog

[OBJECT:BUILDING]

[BUILDING_WORKSHOP:STATION_LOADING]
[NAME:Loading station]
[NAME_COLOR:7:0:1]
[DIM:1:1]
[WORK_LOCATION:1:1]
[BUILD_LABOR:MECHANIC]
[BUILD_KEY:CUSTOM_L]
[BLOCK:1:0]
[TILE:0:1:207]
[COLOR:0:1:0:7:0]
[TILE:1:1:207]
[COLOR:1:1:MAT]
[BUILD_ITEM:1:NONE:NONE:NONE:NONE][BUILDMAT][WORTHLESS_STONE_ONLY][CAN_USE_ARTIFACT]

[BUILDING_WORKSHOP:STATION_UNLOADING]
[NAME:Unloading station]
[NAME_COLOR:7:0:1]
[DIM:1:1]
[WORK_LOCATION:1:1]
[BUILD_LABOR:MECHANIC]
[BUILD_KEY:CUSTOM_U]
[BLOCK:1:0]
[TILE:0:1:207]
[COLOR:0:1:0:7:0]
[TILE:1:1:207]
[COLOR:1:1:MAT]
[BUILD_ITEM:1:NONE:NONE:NONE:NONE][BUILDMAT][WORTHLESS_STONE_ONLY][CAN_USE_ARTIFACT]

3. Copy this and save it as "reaction_bdog.txt" (this is where magic happens ;) ):
Code: [Select]
reaction_bdog

[OBJECT:REACTION]

[REACTION:LOAD_STONE]
[NAME:Load stone]
[BUILDING:STATION_LOADING:CUSTOM_S]
[REAGENT:container:1:TOOL:WHEELBARROW:NONE:NONE]
[EMPTY]
[NOT_CONTAIN_BARREL_ITEM]
[PRESERVE_REAGENT]
[REAGENT:B:1:BOULDER:NONE:NONE:NONE]
[REAGENT:C:1:BOULDER:NONE:NONE:NONE]
[REAGENT:D:1:BOULDER:NONE:NONE:NONE]
[REAGENT:E:1:BOULDER:NONE:NONE:NONE]
[REAGENT:F:1:BOULDER:NONE:NONE:NONE]

[PRODUCT:100:1:BOULDER:NONE:GET_MATERIAL_FROM_REAGENT:B:NONE][PRODUCT_TO_CONTAINER:container]
[PRODUCT:100:1:BOULDER:NONE:GET_MATERIAL_FROM_REAGENT:C:NONE][PRODUCT_TO_CONTAINER:container]
[PRODUCT:100:1:BOULDER:NONE:GET_MATERIAL_FROM_REAGENT:D:NONE][PRODUCT_TO_CONTAINER:container]
[PRODUCT:100:1:BOULDER:NONE:GET_MATERIAL_FROM_REAGENT:E:NONE][PRODUCT_TO_CONTAINER:container]
[PRODUCT:100:1:BOULDER:NONE:GET_MATERIAL_FROM_REAGENT:F:NONE][PRODUCT_TO_CONTAINER:container]
[SKILL:ALCHEMY]

[REACTION:UNLOAD_STONE]
[NAME:Unload stone]
[BUILDING:STATION_UNLOADING:CUSTOM_S]
[REAGENT:boulder:1:BOULDER:NONE:NONE:NONE]
[REAGENT:container:1:TOOL:WHEELBARROW:NONE:NONE]
[CONTAINS:boulder]
[PRESERVE_REAGENT]

[PRODUCT:100:1:BOULDER:NONE:GET_MATERIAL_FROM_REAGENT:boulder:NONE]
[SKILL:ALCHEMY]
[AUTOMATIC]

4. Copy this and ADD it to "entity_default.txt" after [ENTITY:MOUTAIN] tag:
Code: [Select]
bdog
[TOOL:WHEELBARROW]
[PERMITTED_BUILDING:STATION_LOADING]
[PERMITTED_BUILDING:STATION_UNLOADING]
[PERMITTED_REACTION:LOAD_STONE]
[PERMITTED_REACTION:UNLOAD_STONE]
/bdog

What will just not work:
- items are destroyed in loading station and recreated when unloading at the end so theres no way (that I know) to preserve item quality. It's just not possible to have wheelbarrow full of masterwork goblinite spears... well it is possible but upon unloading one will get spears without quality ;)
- I don't know if there is a GET_TYPE_FROM_REAGENT tag or something similar so most of items needs separate reaction (stone, wood etc)

What could be done but I don't have time ;) :
- if one doesn't care for goblinite (because it will be melted anyway) there could be reaction that loads wheelbarrow with "steel junk", "iron junk" etc ("junk" would need to be a separate item created in reaction that no entity have permission for) and when unloading one would get junk that could be melted
- same thing could be done with clothes and other trash that is piled in battle zone

Note:
- skill used for reaction is alchemy I did choose it just because it is not used anywhere else and can be toggled from dwarf therapist
- if you build loading and unloading station too close (and you wont set a burrow to lock loading dwarf) don't be surprised that he will haul unloaded stones from unloading station to load them again... remember that dwarfs are stupid sometimes
« Last Edit: November 10, 2011, 05:48:50 am by bdog »
Logged

bdog

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #1 on: November 08, 2011, 05:51:12 am »

Reserved for reactions made by others (hint hint ;) )


Made by bdog (me):
Reaction loading and unloading wood:
Spoiler (click to show/hide)
Dont forget to add [PERMITED_REACTION:LOAD_WOOD] and [PERMITED_REACTION:UNLOAD_WOOD] in entity_default

Loading junk and trash
How does it work?
- it gathers reagents that have special REACTION_CLASS and changes them to trash/junk then loads on wheelbarrow, this process works in only one way so be sure to lock your dwarf in a burrow or don't be surprised that he will with smile on his face destroy your masterwork items.
- reactions looks for reagents that have special [REACTION_CLASS:JUNKABLE] and [REACTION_CLASS:TRASHABLE] so one need to modify other raw files to add them in various places ;)

Note: due to my laziness trash/junk are tools so unfortunately they do gain quality (upon testing I had few masterwork junks that I had to melt... which didn't make my loading dwarf very happy)
I don't know how to do this (I tried modding in plants with name 'trash/junk' but they just didn't work) so here is a question: is there some tag that won't allow quality modifiers on generated items?

Anyway, here goes raws:
Spoiler (click to show/hide)
« Last Edit: November 10, 2011, 05:40:19 am by bdog »
Logged

Trapezohedron

  • Bay Watcher
  • No longer exists here.
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #2 on: November 08, 2011, 08:42:24 am »

Nice! Is there a way to make creatures load meat and bone products, or in short, items with stacks, and preserve the amount of items in each stack loaded in the cart? I'm planning to include this in my as-of-yet planned Patapon mod (if I get around to it) and use it to simplify cart deliveries.
Logged
Thank you for all the fish. It was a good run.

Nidokoenig

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #3 on: November 08, 2011, 10:26:41 am »

Oh, this is awesome.

For stacking items, the main issue is what kind of items. AFAIK, it's difficult to get custom reactions to treat bodyparts and ammunition as "true" stacks, but stacks of plants would work, though you'd need one reaction per species. Though, because this would strip quality modifiers, it's only strictly useful rocks, logs, blocks, bars, plants, and goblinite that's getting melted down anyway. Might be interesting to include a reaction to convert scrap clothing into rags that can be burned to make ashes. I'll give that a go later.
Logged

bdog

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #4 on: November 08, 2011, 03:01:34 pm »

Thanks.

I did some tests with plants to see what would happen with items that have stacks and well... it's kind of buggy.
I didn't need separate reaction for plump helmets, pickle berries etc since [PRODUCT:100:1:PLANT:NONE:GET_MATERIAL_FROM_REAGENT:F:NONE][PRODUCT_TO_CONTAINER:container] seemed to be working (I don't know why but it was)
BUT I did get some random results like merged stacks at the end (plump helmets [15]) or no stacks at all (played with [DOES_NOT_DETERMINE_PRODUCT_AMOUNT] here and there).
Another thing is that a wheelbarrow with 'Load plants' reaction did take 5 stacks but only 3 of them was loaded, this could be related to [SIZE:] and/or [CONTAINER_CAPACITY:] tag in ITEM_TOOL

This definitely needs more testing. Sad thing is that I don't really have much time to do this alone (rl, job, gf etc)

Ah, and I added new reaction in second post for wood ;) it's just a copypasta with little replacements but have fun
Logged

Krantz86

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #5 on: November 08, 2011, 05:44:55 pm »

interesting, keep up with your researches!
Logged
Re: 1000 sgins that you play Dwarf fortress (way) too much
154. When you get the word "adamantine" on your LA vocab, you quickly cross it out and replace it with "cotton candy" and spend the next 10 minutes in fetal position rocking back and forth in fear. (Yes, I actually did this.)
...Wait. Adamantine is real?...
...155. You are no longer sure what metals are real or fictional.

Stronghammer

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #6 on: November 09, 2011, 08:39:56 am »

keep up the good work, and i have to say great idea as i like to have my maps rather deep so its hard to collect all that ore and stone efficiently.
Logged

Geneoce

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #7 on: November 09, 2011, 09:22:55 am »

bdog would you kindly marry me and accept me as your slave forever?

For too long i've been looking for WISHING for something like this. Now that you've made it I can intergrate it into every DF mod I play.

Thank you!
Logged
I don't care that the vacuum people are promising a blowjob machine in the future. I'll buy it then if they ever deliver.

Mechanixm

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #8 on: November 09, 2011, 03:45:17 pm »

This is awesome!  Much testing needs to be done!

bdog

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #9 on: November 10, 2011, 05:42:46 am »

Thanks :D

For those that are interested I added JUNK and TRASH reactions in second post. They still needs some polishing so junks won't get quality but hey, they work so have !!fun!!  ;)
Logged

Trapezohedron

  • Bay Watcher
  • No longer exists here.
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept - now with more fun
« Reply #10 on: November 10, 2011, 06:26:34 am »

I shall make a reaction to rip a few pieces of junk into scrap, which can be thrown by power gloves, just for kicks.

Spoiler (click to show/hide)
« Last Edit: November 10, 2011, 06:28:14 am by New Guy »
Logged
Thank you for all the fish. It was a good run.

Roses

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept
« Reply #11 on: November 10, 2011, 02:51:16 pm »

Note: due to my laziness trash/junk are tools so unfortunately they do gain quality (upon testing I had few masterwork junks that I had to melt... which didn't make my loading dwarf very happy)
I don't know how to do this (I tried modding in plants with name 'trash/junk' but they just didn't work) so here is a question: is there some tag that won't allow quality modifiers on generated items?

Couldn't you make the Junk and Trash items be "stones" or blocks? They wouldn't have qualities associated with them I don't think.
Logged

bdog

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept - now with more fun
« Reply #12 on: November 10, 2011, 06:50:46 pm »

I shall make a reaction to rip a few pieces of junk into scrap, which can be thrown by power gloves, just for kicks.

Spoiler (click to show/hide)
Nice! Great idea to make some recycling reactions!
Hmm... you know, your reaction to salvage scraps is almost the same as unloading - df could fight which one should be queued and you'll never know what you'll get (without micromanagement)
As I see this it could be like this:
Spoiler (click to show/hide)

Note: due to my laziness trash/junk are tools so unfortunately they do gain quality (upon testing I had few masterwork junks that I had to melt... which didn't make my loading dwarf very happy)
I don't know how to do this (I tried modding in plants with name 'trash/junk' but they just didn't work) so here is a question: is there some tag that won't allow quality modifiers on generated items?

Couldn't you make the Junk and Trash items be "stones" or blocks? They wouldn't have qualities associated with them I don't think.

You see, stones (or boulders as the game defines them) are a built-in type - you can only define material for them. Same with blocks.
It could be done of course but you'll end with stones/blocks/bars with material type of junk/trash AND there would be no way to know what material that junk had before (no more iron, steel or copper junk... just junk that probably couldn't be melted or could be but only to one predefined metal bar)
If I'm wrong please someone correct me ;)

When I was writing this I was struck with a crazy idea - what would happen if we set high junk/trash value and trade them to Elves? Let those fools do proper recycling and pay US for a job that they're doing. That would be soooo dwarvenly (and masterwork junks/trash wouldn't be a big problem anymore).

Edit:
Also: some modding here and there, some custom reaction and imagine what face would an elf trader make when he would get "This is a masterful iron junk created by Urist McDwarf. Item menaces with spikes of trash."
« Last Edit: November 10, 2011, 07:00:39 pm by bdog »
Logged

GaxkangtheUnbound

  • Bay Watcher
  • To the skies!
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept - now with more fun
« Reply #13 on: November 10, 2011, 08:31:00 pm »

I think making scrap a boulder or something similar means we could make scrap cities.
Got a load of useless junk from sieges? Turn it into scrap and build houses for your subjects!
Logged
Proud of my heritage.
Prepare to lose your sanity.

Nidokoenig

  • Bay Watcher
    • View Profile
Re: Wheelbarrows !!SCIENCE!! aka working Proof of Concept - now with more fun
« Reply #14 on: November 10, 2011, 08:49:08 pm »

Or build catapults and lob it at the next lot.
Logged
Pages: [1] 2 3