Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Minecart Fall Loading! [v1.1] -- Minecarts pick up things that fall onto them  (Read 1961 times)

bloop_bleep

  • Bay Watcher
    • View Profile

DFFD for source file and Windows binaries: http://dffd.bay12games.com/file.php?id=14917
GitHub repository: https://github.com/bloop-bleep-b12/minecart_fall_loading

This is a plugin that allows items OR units that fall on top of a minecart to be a loaded into that minecart, if they can fit within the minecart. This, I believe, is an important addition, because it allows automatic minecart loading without direct dwarf interaction, in a simple way, without making it TOO easy =P. In the base game, only automatic minecart unloading is possible.

Think of the possibilities! We could have minecarts passing items from one to another, with a dumping track stop next to a hole over another minecart. Imagine dwarves dumping finished items down chutes right outside their workshops, to be spirited away by a waiting minecart, without the need for the stockpile walk after the job is done. I have considered constructing a horrifying recursive goblin grinder, where goblins are pelted from afar with the corpses of their previously fallen comrades, until the ground underneath them gives way, allowing a minecart below to scoop up their own cadavers. The efficiency is exponential! :D All with minimal dwarf interaction, and a relatively simple mechanic.

Please tell me what you think, and provide any bug reports or comments! Thank you!

NOTE: Currently only one unit at a time may be loaded into a minecart this way. This restriction is artificially created by me, so could be easily changed if people feel against it. Also make sure to pit units from at least 2 z-levels above minecarts in order for them to loaded.

EDIT: Also I would appreciate any technical advice on how to search for items (which may be in the air) in a specific tile? Currently I'm looping through all active items, which I assume is not the most efficient way. Is it true that if an item is not a projectile, then it is recorded in the df::map_block* in which it is located?
« Last Edit: March 19, 2020, 09:23:30 pm by bloop_bleep »
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile

DFFD for source file: http://dffd.bay12games.com/file.php?id=14917

This is a plugin that allows items that fall on top of a minecart to be a loaded into that minecart, if it can fit within the minecart. This, I believe, is an important addition, because it allows automatic minecart loading without direct dwarf interaction, in a simple way, without making it TOO easy =P. In the base game, only automatic minecart unloading is possible.

Think of the possibilities! We could have minecarts passing items from one to another, with a dumping track stop next to a hole over another minecart. Imagine dwarves dumping finished items down chutes right outside their workshops, to be spirited away by a waiting minecart, without the need for the stockpile walk after the job is done. I have considered constructing a horrifying recursive goblin grinder, where goblins are pelted from afar with the corpses of their previously fallen comrades, until the ground underneath them gives way, allowing a minecart below to scoop up their own cadavers. The efficiency is exponential! :D All with minimal dwarf interaction, and a relatively simple mechanic.

Please tell me what you think, and provide any bug reports or comments! Thank you!

EDIT: Also I would appreciate any technical advice on how to search for items (which may be in the air) in a specific tile? Currently I'm looping through all active items, which I assume is not the most efficient way. Is it true that if an item is not a projectile, then it is recorded in the df::map_block* in which it is located?

Non-script solution is that you need to interpose ALL item type place vmethod (IIRC looked into it for anti-quantum-stockpile), maybe it's enough to use eventful('?)s projectile hit event?

FantasticDorf

  • Bay Watcher
    • View Profile

Wow excellent.

But does this catch and fit pitted invaders to run on a infinite loop? Because high velocity goblin minecart circuitry with pressure plates or semi-pernament ridden minecart trap would revolutionize dwarf-computing.
Logged

bloop_bleep

  • Bay Watcher
    • View Profile

Wow excellent.

But does this catch and fit pitted invaders to run on a infinite loop? Because high velocity goblin minecart circuitry with pressure plates or semi-pernament ridden minecart trap would revolutionize dwarf-computing.

Not as of now, but it seems possible. I'll work on that when I can...
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

bloop_bleep

  • Bay Watcher
    • View Profile

Wow excellent.

But does this catch and fit pitted invaders to run on a infinite loop? Because high velocity goblin minecart circuitry with pressure plates or semi-pernament ridden minecart trap would revolutionize dwarf-computing.

It's done now. Committed to github repository and updated the DFFD listing. This constitutes version 1.1.

Currently have it so that only one unit at a time may be loaded this way. Also, important note: if pitting units into minecarts, make sure to do it from at least 2 z-levels above, since I'm pretty sure when a unit is pitted it is transferred directly to the z-level below the one of the pitting zone. I realize I am also not entirely sure how to get units out of a minecart once they are in... maybe I should try to do that with my testing save.

EDIT:

Also testing of all of your own would be greatly appreciated!

Non-script solution is that you need to interpose ALL item type place vmethod (IIRC looked into it for anti-quantum-stockpile), maybe it's enough to use eventful('?)s projectile hit event?

I'm sorry, I didn't find any virtual methods in the df item struct with "place" in their name? Could you explain what you mean? Thanks anyway!
« Last Edit: March 13, 2020, 01:02:51 am by bloop_bleep »
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile


Non-script solution is that you need to interpose ALL item type place vmethod (IIRC looked into it for anti-quantum-stockpile), maybe it's enough to use eventful('?)s projectile hit event?

I'm sorry, I didn't find any virtual methods in the df item struct with "place" in their name? Could you explain what you mean? Thanks anyway!
Sorry it's "moveToGround"

GreyGoldFish

  • Bay Watcher
    • View Profile

This sounds fantastic! Does anyone know if this works with 47.04? I've been trying to compile DFHack without success these past few days, something to do with Cmake not being able to find my VS 2015 build tools, so if anyone was able to successfully compile DFHack with this plugin would you kindly send me a copy?

Cheers!  :D
Logged

Ziusudra

  • Bay Watcher
    • View Profile

https://dfhack.org/builds/ hmm, that seems to be having troubles. You can try using the dfhack from one of the packs http://dffd.bay12games.com/category.php?id=18
« Last Edit: March 17, 2020, 09:11:57 pm by Ziusudra »
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

GreyGoldFish

  • Bay Watcher
    • View Profile

https://dfhack.org/builds/ hmm, that seems to be having troubles. You can try using the dfhack from one of the packs http://dffd.bay12games.com/category.php?id=18

Thanks! I couldn't find any packages that were compiled with the plugin, though. My problem is that I need to compile the plugin with DFHack, since it's not just plug and play like TWBT, for example.
Logged

bloop_bleep

  • Bay Watcher
    • View Profile

Hey, if you have a 64-bit Windows system, I could upload my plugin binary! Then you could just stick it in the DF plugins folder without having to build DFHack (just requires installing DFHack in its pre-built form).

Also, I have managed, through great effort, to compile DFHack on both 64-bit Windows and openSUSE Linux, so if you need some help you can send me a PM! There were certainly a few obstacles along the way.
« Last Edit: March 18, 2020, 01:34:35 am by bloop_bleep »
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

bloop_bleep

  • Bay Watcher
    • View Profile

Added 0.47.03 and 0.47.04 binaries to DFFD.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile

Okay, so i've looke over your plugin code... And i'm very impressed! Very nice and tidy code with easy to understand comments! Btw i feel like something like this should be in vanilla DF.

bloop_bleep

  • Bay Watcher
    • View Profile

Why thank you!  :D

And yes, I think that this feels like something that should be in vanilla DF. That's what I like about this mechanic, it's not too far-out or intrusive. In fact, I might've written something on the Suggestions forum about this at some point, though I'm not sure...
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.