Tank Immune to Trees?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Tank Immune to Trees?

Post by Ranakastrasz »

Does anyone know how this works? Did they change the damage mechanic, such that instead of dropping damage to 1/(armor-Damage) or whatever it was, to (max(Armor-damage,0)) or something?
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Tank Immune to Trees?

Post by Bilka »

The added a property (immune_to_tree_impacts = true). If it's enabled and the tank hits a tree it doesnt take damage. Simple as that.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Tank Immune to Trees?

Post by Ranakastrasz »

Bilka wrote:The added a property (immune_to_tree_impacts = true). If it's enabled and the tank hits a tree it doesnt take damage. Simple as that.
Wow. That.... Thats kinda a hack, honestly, but I suppose that works

Shame it isn't more mutable, but at least my robots will stop commiting suicide or hang back where I ran through a forest....

Also I don't have to use the tank flamer anymore, aside from avoiding the slowdown from trees.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Tank Immune to Trees?

Post by Rseding91 »

Ranakastrasz wrote:
Bilka wrote:The added a property (immune_to_tree_impacts = true). If it's enabled and the tank hits a tree it doesnt take damage. Simple as that.
Wow. That.... Thats kinda a hack, honestly, but I suppose that works.
Why's it a hack? We didn't want the tank to take damage from hitting trees so we made it not take damage from hitting trees.
If you want to get ahold of me I'm almost always on Discord.

BlakeMW
Filter Inserter
Filter Inserter
Posts: 950
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: Tank Immune to Trees?

Post by BlakeMW »

I think the "non-hack" approach would be to give a "hardened armor" property that shrugs off small amounts of damage (for a given damage type) regardless of the source.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Tank Immune to Trees?

Post by Bilka »

BlakeMW wrote:I think the "non-hack" approach would be to give a "hardened armor" property that shrugs off small amounts of damage (for a given damage type) regardless of the source.
That seems like more of a hack than the 2 if lines Rseding added:

Code: Select all

if (!this->getPrototype()->immuneToTreeImpacts || !entity->isTree())
In front of the damageReceived code and that was it.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

BlakeMW
Filter Inserter
Filter Inserter
Posts: 950
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: Tank Immune to Trees?

Post by BlakeMW »

I'm not talking about in terms of code, but in terms of game rules. There's no particular reason why a small amount of damage from running over a tree should be shrugged off, whereas say the damage from running over a small biter shouldn't be shrugged of.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Tank Immune to Trees?

Post by Ranakastrasz »

BlakeMW wrote:I'm not talking about in terms of code, but in terms of game rules. There's no particular reason why a small amount of damage from running over a tree should be shrugged off, whereas say the damage from running over a small biter shouldn't be shrugged of.
Exactly. Exceptions like that are a bad idea. If it were a specific filter for entities flaged as trees, sure, but having a trait that specifically ignores tree collision damage isnt.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Tank Immune to Trees?

Post by Rseding91 »

Think what you want. We decided we didn't want the tank to take damage from hitting trees so I made it not take damage from hitting trees. Just like how cars don't take any damage from hitting cliffs.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Tank Immune to Trees?

Post by Ranakastrasz »

Rseding91 wrote:Think what you want. We decided we didn't want the tank to take damage from hitting trees so I made it not take damage from hitting trees. Just like how cars don't take any damage from hitting cliffs.
Hey, it works, but it still feels like a hack. Not objecting.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Post Reply

Return to “Modding discussion”