Intangible entities vulnerable to damage and biter attack

Place to get help with not working mods / modding interface.
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Intangible entities vulnerable to damage and biter attack

Post 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"?
Image
Rseding91
Factorio Staff
Factorio Staff
Posts: 16015
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post by Rseding91 »

Code: Select all

destructible = false
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
If you want to get ahold of me I'm almost always on Discord.
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post by Reika »

Rseding91 wrote:

Code: Select all

destructible = false
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
It did work in 0.15, but fair enough.

Will that also prevent biters from aggroing on it?
Image
Rseding91
Factorio Staff
Factorio Staff
Posts: 16015
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post 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)?
Image
Bilka
Factorio Staff
Factorio Staff
Posts: 3470
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post 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?
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: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post 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.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post 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'.
Last edited by Reika on Fri Dec 22, 2017 12:01 am, edited 1 time in total.
Image
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post 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"
    },
  },
Image
Rseding91
Factorio Staff
Factorio Staff
Posts: 16015
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post 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".
If you want to get ahold of me I'm almost always on Discord.
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Intangible entities vulnerable to damage and biter attack

Post 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?
Image
Post Reply

Return to “Modding help”