Schall Tank Woodcutting (Autodrive fix)

by Pi-C

Harvest wood on the way of vehicles driving over trees, or stone and coal when driving over rocks. Harvested items will be loaded directly into the trunk of Autodrive-controlled vehicles if the items can be used by the vehicle or equipment in its grid..

Utilities
a month ago
1.1 - 2.0
44
Transportation Mining

g [Implemented] SA port?

2 months ago

Could this be ported to SA/2.0 and made to work with modded rocks and trees? This could simply trigger a mining event of the respective entity instead of giving the player a fixed amount of stone (which isn't even the amount you'd normally get).

2 months ago

Could this be ported to SA/2.0 and made to work with modded rocks and trees?

I'll see about this. Schallfalke has updated the original mod, but I still haven't tried it yet as I'm still fixing bugs to get Autodrive working again. To be honest, I'd prefer if the necessary changes were integrated into the original mod, so that I'd just have to take care of the Autodrive end. :-)

2 months ago

Ah okay, I'll repost it to Schall's page.

2 months ago

Actually, I'll contact Schallfalke myself when I've figured out what exactly I need on the other end. There was a reason I made the fork: IIRC, I needed Autodrive to depend on Tank Woodcutting for the data stage, and a dependency from Tank Woodcutting on Autodrive during control. I'll get around to that when I've fixed Autodrive, so please be patient. :-)

2 months ago

No worries! If you want to add a little note to the reposted thread I opened on the original, it's here: https://mods.factorio.com/mod/SchallTankWoodcutting/discussion/6865d2c41dd6df4496944b24

2 months ago

Could this be […] made to work with modded rocks and trees?

I've reviewed the code yesterday. Both mods should consider modded trees because they are checking for LuaEntity::type == 'tree'.

While the original mod only recognizes simple-entity prototypes with a name containing the string "rock" as rocks, my fork considers all simple-entity prototypes that have the flag count_as_rock_for_filtered_deconstruction set as rock. Therefore, the original mod should recognize some modded rocks (if they are properly named), and my fork should recognize all modded rocks.

Do you have an example for modded rocks/trees that are not recognized by my fork? I'd need to know the mod and name of the rock/tree.

2 months ago

They are recognized, but when driving over Vulcanus (SA) rocks, I get only stone as if destroying a normal rock.
It also is not random – it doesn't trigger a mining event, it simply adds +20 stone to your inventory. Instead of the random 18 to 25 or whatever stone, and instead of the stone, iron, copper and tungsten from vulcanus rocks.

Additionally, Gleba trees (various plants) and rocks (stromatholites) neither count_as_rock_for_filtered_deconstruction nor do they contain "tree" or "rock" substrings.

2 months ago

I've joined the discussion on the original mod's board and outlined a way to implement mining. Seems to work so far, but I haven't added the necessary code on the Autodrive end yet.

Additionally, Gleba trees (various plants) and rocks (stromatholites) neither count_as_rock_for_filtered_deconstruction nor do they contain "tree" or "rock" substrings.

I don't have SA, so it's a bit like poking around in the dark. :-)

What type do the Gleba trees have? You can find out by hovering your cursor over such a tree and running this on the console:

/c game.print(game.player.selected.type)

Do they have mining products? What do you get when you mine such a tree or rock?

a month ago

Hi! It seems Schallfalke hasn't been active for some months, so I've updated my mod. :-)

It should find all trees. Are stromatholites the only kind of rock that isn't recognized? Haven't handled them yet. But trees and rocks are mined now, so you should get whatever mining products they leave.

Also, if a vehicle has both driver and passenger (both players), we will now try to give items to the driver first. Remaining items are then given to the passenger, and anything remaining after that is spilled on the ground. Autodrive (and any other mods that care) will have a chance to remove items for the refueling. This will only work if the vehicle has a fuel sensor, and has fuel preferences set. (To set fuel-prefs, open the GUI, modify items or amounts, then close the GUI to confirm the changes!)

a month ago

Haven't been in the game for the last month, but will test it out when I get back (could be a while). Until then, thanks in advance! :D

New response