Page 1 of 1
Intangible entities vulnerable to damage and biter attack
Posted: Thu Dec 21, 2017 3:39 am
by Reika
I have, between several of my mods, a number of "intangible" type entities, that is, they neither render, nor have collision, nor are selectable, nor are damageable.
As of 0.16, however, two things have become apparent. First is that the biters will attempt to attack (and can destroy) these entities, especially if its force is the player force. This is particularly problematic when the entity is used for targeting purposes. The other issue is that the entities are taking damage now, when previously they were immune to it (not just infinite health, but they outright ignored damage). This is most noticeable with my orbital strike system, where the dummy targeting entity is being wiped out by the orbital strike it calls, which triggers a "structure destroyed" alert as well as invalidating the entity before other logic that needs it has had a chance to run.
The entities are being made intangible with the following parameters in their prototypes:
Code: Select all
selectable_in_game = false,
destructible = false,
collision_mask = {},
Has 0.16 invalidated one or all of these? Can I still accomplish the goal of an entity that exists only "in the game engine"?
Re: Intangible entities vulnerable to damage and biter attack
Posted: Thu Dec 21, 2017 5:04 am
by Rseding91
This has no effect in the prototype. That's a runtime property you have to set on the entity after it's created in the world:
http://lua-api.factorio.com/latest/LuaE ... structible
Re: Intangible entities vulnerable to damage and biter attack
Posted: Thu Dec 21, 2017 5:45 am
by Reika
It
did work in 0.15, but fair enough.
Will that also prevent biters from aggroing on it?
Re: Intangible entities vulnerable to damage and biter attack
Posted: Thu Dec 21, 2017 6:01 am
by Rseding91
Reika wrote:It did work in 0.15, but fair enough.
No it didn't. That has never been a thing.
Relka wrote:Will that also prevent biters from aggroing on it?
Making it an entity type that doesn't have health. Otherwise nothing.
Re: Intangible entities vulnerable to damage and biter attack
Posted: Thu Dec 21, 2017 7:59 am
by Reika
Rseding91 wrote:Reika wrote:It did work in 0.15, but fair enough.
No it didn't. That has never been a thing.
Relka wrote:Will that also prevent biters from aggroing on it?
Making it an entity type that doesn't have health. Otherwise nothing.
Are there any entity types which do not have health but can have a force, and are not transient (eg explosions, which are deleted when the animation completes)?
Re: Intangible entities vulnerable to damage and biter attack
Posted: Thu Dec 21, 2017 9:40 am
by Bilka
Reika wrote:Are there any entity types which do not have health but can have a force, and are not transient (eg explosions, which are deleted when the animation completes)?
See
https://wiki.factorio.com/Prototype_definitions . I dont think you are going to get one which has a force, though corpse might work. Just set its deletetion time to very high and you are fine. Otherwise some entity types that
might work: Cliffs, though the correction logic might mess with them. Depending on use case flying-text might also work. You could also see if the game will let you use the old decoratives, I personally would use those. The only problem with them is that they get deleted when concrete is placed over them. You could also use smoke that you set to last a very long time. May I ask what you use an entity for that needs a force but is never rendered etc?
Re: Intangible entities vulnerable to damage and biter attack
Posted: Thu Dec 21, 2017 3:47 pm
by Ranakastrasz
This is particularly problematic when the entity is used for targeting purposes.
Presumably this reason.
Dummies in general, or entities you want to make invulnerable in general as well.
Re: Intangible entities vulnerable to damage and biter attack
Posted: Thu Dec 21, 2017 7:47 pm
by Reika
Bilka wrote:Reika wrote:Are there any entity types which do not have health but can have a force, and are not transient (eg explosions, which are deleted when the animation completes)?
See
https://wiki.factorio.com/Prototype_definitions . I dont think you are going to get one which has a force, though corpse might work. Just set its deletetion time to very high and you are fine. Otherwise some entity types that
might work: Cliffs, though the correction logic might mess with them. Depending on use case flying-text might also work. You could also see if the game will let you use the old decoratives, I personally would use those. The only problem with them is that they get deleted when concrete is placed over them. You could also use smoke that you set to last a very long time. May I ask what you use an entity for that needs a force but is never rendered etc?
Does simple-entity-with-force have health?
I have used it before, but previously it was unsuitable due to its lack of support for animations. However, that has been improved in 0.16: See post below
Code: Select all
simple-entity, simple-entity-with-owner and simple-entity-with-force can now define 'animations' instead of 'picture' or 'pictures'.
Re: Intangible entities vulnerable to damage and biter attack
Posted: Fri Dec 22, 2017 12:00 am
by Reika
Never mind, the entity is
already a simple-entity-with force:
Code: Select all
{
type = "simple-entity-with-force",
name = "orbital-manual-target-secondary",
icon = "__EndgameCombat__/graphics/icons/orbital-manual-target.png",
icon_size = 32,
flags = {"placeable-player", "player-creation", "not-on-map", "placeable-off-grid"},
selectable_in_game = false,
destructible = false,
collision_mask = {},
order = "z",
render_layer = "object",
--collision_box = {{-2.4, -2.4}, {2.4, 2.4}},
--selection_box = {{-2.5, -2.5}, {2.5, 2.5}},
pictures =
{
filename = "__EndgameCombat__/graphics/entity/orbital/target-secondary.png",
priority = "low",
width = 5,
height = 5,
apply_projection = false,
shift = {0, 0},
scale = 1,
blend_mode = "additive"
},
},
Re: Intangible entities vulnerable to damage and biter attack
Posted: Fri Dec 22, 2017 2:02 am
by Rseding91
You want simple-entity-with-owner. Simple-entity-with-force is "will be targeted by biters/turrets", simple-entity-with-owner is "has a force, but is only attacked if the biters get stuck on it".
Re: Intangible entities vulnerable to damage and biter attack
Posted: Fri Dec 22, 2017 2:09 am
by Reika
Rseding91 wrote:"has a force, but is only attacked if the biters get stuck on it".
Which will never happen with no collision set (ie an empty collision mask), yes?