Auto target trees as hostiles

This is the place to request new mods or give ideas about what could be done.
Post Reply
Krimsonkiler
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Apr 08, 2019 8:50 pm
Contact:

Auto target trees as hostiles

Post by Krimsonkiler »

I know we all dislike trees and wish our automated defenses shared our disdain for these arboreal abominations.

What I have in mind is making trees targetable entities for things like turrets and personal defenses.

I have tried in the past but didn't know enough about lua or factorio modding to get it done myself at the time.

Not sure if this is even feasible, but really hope it is...

Qon
Smart Inserter
Smart Inserter
Posts: 2158
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Auto target trees as hostiles

Post by Qon »

I was Qonsidering making a mod that lets artillery auto target trees as well if loaded with poison capsules. That way you also don't destroy your own base if any trees are trying to get their grubby roots on your precious metallic factory. But I haven't really prioritised it.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser

mrvn
Smart Inserter
Smart Inserter
Posts: 5766
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Auto target trees as hostiles

Post by mrvn »

My first idea would be to mark tress as enemy forces. But could you still chop them down for wood then?

Krimsonkiler
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Apr 08, 2019 8:50 pm
Contact:

Re: Auto target trees as hostiles

Post by Krimsonkiler »

I had that idea as well but didn't know how to do that

Krimsonkiler
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Apr 08, 2019 8:50 pm
Contact:

Re: Auto target trees as hostiles

Post by Krimsonkiler »

mrvn wrote:
Thu Apr 11, 2019 1:36 pm
My first idea would be to mark tress as enemy forces. But could you still chop them down for wood then?
How is that done? Is it some kind of inheritance? I am familiar with coding, just not Lua.

mrvn
Smart Inserter
Smart Inserter
Posts: 5766
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Auto target trees as hostiles

Post by mrvn »

Krimsonkiler wrote:
Thu Apr 11, 2019 2:15 pm
mrvn wrote:
Thu Apr 11, 2019 1:36 pm
My first idea would be to mark tress as enemy forces. But could you still chop them down for wood then?
How is that done? Is it some kind of inheritance? I am familiar with coding, just not Lua.
Iirc the prototype has a setting for how entitites are placed. Some are neutral, some not. Compare the prototypes for trees, chests and worms.

Krimsonkiler
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Apr 08, 2019 8:50 pm
Contact:

Re: Auto target trees as hostiles

Post by Krimsonkiler »

mrvn wrote:
Thu Apr 11, 2019 3:14 pm
Krimsonkiler wrote:
Thu Apr 11, 2019 2:15 pm
mrvn wrote:
Thu Apr 11, 2019 1:36 pm
My first idea would be to mark tress as enemy forces. But could you still chop them down for wood then?
How is that done? Is it some kind of inheritance? I am familiar with coding, just not Lua.
Iirc the prototype has a setting for how entitites are placed. Some are neutral, some not. Compare the prototypes for trees, chests and worms.
Ooooooh, I was not aware of that part, I was fiddling with the tree prototype directly, didnt know there were placement settings...

Krimsonkiler
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Apr 08, 2019 8:50 pm
Contact:

Re: Auto target trees as hostiles

Post by Krimsonkiler »

So I think "all" I would have to do is make Trees inherit from Prototype/SimpleEntityWithForce instead of Prototype/EntityWithHealth. Then they can be added to "Enemy" force, I don't think that will have any other effect. Now I just have to figure out HOW to do that...

(Biters MAY not attack them if they get stuck anymore, but am not sure.)

Qon
Smart Inserter
Smart Inserter
Posts: 2158
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Auto target trees as hostiles

Post by Qon »

Here is a BP for automated deforestation! A constant combinator (in the bp: value 1000) sends the distance to scan for trees. The scanner scans one tile randomly within this distance so set it to whetever you want but extremely high values means close by trees will take a while to find. Only scans a single tile/tick so isn't very CPU intensive.


Mod list:
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser

Post Reply

Return to “Ideas and Requests For Mods”