Types/EntityPrototypeFlags: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
No edit summary
 
(25 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Array ([[Types/table]]) of strings. The possible strings are listed below.
== "not-rotatable" ==
Can't be rotated before or after placing.
== "placeable-[force]" ==
== "placeable-[force]" ==
*"placeable-player"
*"placeable-player"
*"placeable-neutral"
*"placeable-neutral"
*"placeable-enemy"
*"placeable-enemy"
placeable neutral/player/enemy will add the entities to the screens in the map editor. For example, the biter-spawner has the placable-player and placeable-enemy flags. If you go into the map editor and use 'f' to switch between player entities and enemy entities you will see that both have a creeper spawner. If you were to place one of each in the map (along with a player) and then save/play it, you would see the creepers attacking each other since they are on opposing forces. On the other hand, if you were to add the "placeable-neutral" flag and (after restarting factorio if you left it running) place one next to the two previous spawners, the neutral creepers would neither attack the other creepers nor be attacked by them.
placeable neutral/player/enemy determine the default force when placing entities in the map editor and using the *AUTO* option for the force.
 
== "placeable-off-grid" ==
placeable-off-grid refers to the fact that most entities are placed on an invisible 'grid' within the world, entities with the placeable-off-grid flag do not have to line up with this grid (like trees and land-mines)


=="placeable-off-grid"==
== "player-creation" ==
placeable-off-grid refers to the fact that most entities are placed on an invisible 'grid' within the world, entities with the placeable-off-grid flag do not have to line up with this grid (like trees, players, creepers, and land-mines)
Makes it possible for the biter AI to target the entity as a distraction in distraction mode [https://lua-api.factorio.com/latest/defines.html#defines.distraction <code>by_anything</code>]. Makes it possible to blueprint, deconstruct, and repair the entity (can be turned off again using the specific flags). Enables smoke to be created automatically when building the entity. If the entity does not have [[Prototype/Entity#map_color]] set, "player-creation" makes the entity appear on the map/minimap with the default color specified in the [[Prototype/UtilityConstants]].


=="pushable"==
Entities that are [https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.is_building buildings] and have the player-creation flag set are considered for multiple enemy/unit behaviors:
Pushable means that the entity can be 'pushed' by the car.
* Autonomous enemy attacks (usually triggered by pollution) can only attack within chunks that contain at least one entity that is both a building and a player-creation.
* Enemy expansion considers entities that are both buildings and player-creations as "enemy" entities that may block expansion.


=="player-creation"==
== "building-direction-8-way" ==
This is not currently used, but adding this flag will make creepers destroy everything they encounter that is a "player-creation", depending on their priority (they would probably attack the turrets first and then other items) when instead of the freeplay using distraction=defines.distraction.byenemy it uses distraction=defines.distraction.byanything
Uses 45 degree angle increments when selecting direction.


=="breaths-air"==
== "filter-directions" ==
This is used to specify that the entity breaths air, and so is affected by poison (currently [[Poison_capsule|Poison Capsules]] are the only source).
Used to automatically detect the proper direction, if possible. Used by base with the pump, train stop, and train signal.


=="not-repairable"==
== "fast-replaceable-no-build-while-moving" ==
Used to specify that the entity can not be 'healed' by repair-packs (or construction robots with repair packs)
Fast replace will not apply when building while moving.


=="building-direction-8-way"==
== "breaths-air" ==
Uses 45 degree angle increments when selecting direction (also, 8 point compass North-NorthEast-East-SouthEast-South-SouthWest-West-NorthWest). I think, correct this if know otherwise :) [[User:FreeER|~FreeER]] ([[User talk:FreeER|talk]])
This is used to specify that the entity breathes air, and so is affected by poison (currently [[Poison_capsule|poison capsules]] are the only source).


=="filter-directions"==
== "not-repairable" ==
Used to automatically detect the proper direction, if possible. Used by base with the pump, train stop, and train signal.
Used to specify that the entity can not be 'healed' by repair-packs (or construction robots with repair packs)


=="fast-replaceable-no-rotate-only"==
== "not-on-map" ==
Used to prevent fast replacement of objects with the same name. Currently only used by base with the basic underground transport belts.
The entity does not get drawn on the map.


=="not-blueprintable"==
== "not-blueprintable" ==
The entity can't be used in blueprints.
The entity can't be used in blueprints.


=="not-deconstructable"==
== "not-deconstructable" ==
The entity can't be deconstructed.
The entity can't be deconstructed.
== "hidden" ==
Hides the entity from the bonus GUI (button above the map) and from the made in property of recipe tooltips.
== "hide-alt-info" ==
Hides the alt-info of an entity in alt-mode, for example the recipe icon.
== "fast-replaceable-no-cross-type-while-moving" ==
Do not fast replace over other entity types when building while moving.
== "no-gap-fill-while-building" ==
== "not-flammable" ==
Do not apply fire stickers to the entity.
== "no-automated-item-removal" ==
Prevents inserters and loaders from taking items from this entity.
== "no-automated-item-insertion" ==
Prevents inserters and loaders from inserting items into this entity.
== "no-copy-paste" ==
This flag does nothing when set in the data stage because it gets overridden by [[Prototype/Entity#allow_copy_paste]]. Thus, it must be set on the entity via [[Prototype/Entity#allow_copy_paste]].
== "not-selectable-in-game" ==
Disallows selection of the entity even when a selection box is specified for other reasons. For example, selection boxes are used to determine the size of outlines to be shown when highlighting entities inside electric pole ranges.
This flag does nothing when set in the data stage because it gets overridden by [[Prototype/Entity#selectable_in_game]]. Thus, it must be set on the entity via [[Prototype/Entity#selectable_in_game]].
== "not-upgradable" ==
The entity can't be selected by the [[upgrade planner]].
== "not-in-kill-statistics" ==
The entity is not shown in the kill statistics.
== "not-in-made-in" ==
The entity is not shown in the made in property of recipe tooltips.


== Example ==
== Example ==
    flags = {"placeable-neutral", "player-creation"}
<syntaxhighlight lang="lua">
flags = {"placeable-neutral", "player-creation"}
</syntaxhighlight>

Latest revision as of 09:40, 23 September 2022

Array (Types/table) of strings. The possible strings are listed below.

"not-rotatable"

Can't be rotated before or after placing.

"placeable-[force]"

  • "placeable-player"
  • "placeable-neutral"
  • "placeable-enemy"

placeable neutral/player/enemy determine the default force when placing entities in the map editor and using the *AUTO* option for the force.

"placeable-off-grid"

placeable-off-grid refers to the fact that most entities are placed on an invisible 'grid' within the world, entities with the placeable-off-grid flag do not have to line up with this grid (like trees and land-mines)

"player-creation"

Makes it possible for the biter AI to target the entity as a distraction in distraction mode by_anything. Makes it possible to blueprint, deconstruct, and repair the entity (can be turned off again using the specific flags). Enables smoke to be created automatically when building the entity. If the entity does not have Prototype/Entity#map_color set, "player-creation" makes the entity appear on the map/minimap with the default color specified in the Prototype/UtilityConstants.

Entities that are buildings and have the player-creation flag set are considered for multiple enemy/unit behaviors:

  • Autonomous enemy attacks (usually triggered by pollution) can only attack within chunks that contain at least one entity that is both a building and a player-creation.
  • Enemy expansion considers entities that are both buildings and player-creations as "enemy" entities that may block expansion.

"building-direction-8-way"

Uses 45 degree angle increments when selecting direction.

"filter-directions"

Used to automatically detect the proper direction, if possible. Used by base with the pump, train stop, and train signal.

"fast-replaceable-no-build-while-moving"

Fast replace will not apply when building while moving.

"breaths-air"

This is used to specify that the entity breathes air, and so is affected by poison (currently poison capsules are the only source).

"not-repairable"

Used to specify that the entity can not be 'healed' by repair-packs (or construction robots with repair packs)

"not-on-map"

The entity does not get drawn on the map.

"not-blueprintable"

The entity can't be used in blueprints.

"not-deconstructable"

The entity can't be deconstructed.

"hidden"

Hides the entity from the bonus GUI (button above the map) and from the made in property of recipe tooltips.

"hide-alt-info"

Hides the alt-info of an entity in alt-mode, for example the recipe icon.

"fast-replaceable-no-cross-type-while-moving"

Do not fast replace over other entity types when building while moving.

"no-gap-fill-while-building"

"not-flammable"

Do not apply fire stickers to the entity.

"no-automated-item-removal"

Prevents inserters and loaders from taking items from this entity.

"no-automated-item-insertion"

Prevents inserters and loaders from inserting items into this entity.

"no-copy-paste"

This flag does nothing when set in the data stage because it gets overridden by Prototype/Entity#allow_copy_paste. Thus, it must be set on the entity via Prototype/Entity#allow_copy_paste.

"not-selectable-in-game"

Disallows selection of the entity even when a selection box is specified for other reasons. For example, selection boxes are used to determine the size of outlines to be shown when highlighting entities inside electric pole ranges.

This flag does nothing when set in the data stage because it gets overridden by Prototype/Entity#selectable_in_game. Thus, it must be set on the entity via Prototype/Entity#selectable_in_game.

"not-upgradable"

The entity can't be selected by the upgrade planner.

"not-in-kill-statistics"

The entity is not shown in the kill statistics.

"not-in-made-in"

The entity is not shown in the made in property of recipe tooltips.

Example

flags = {"placeable-neutral", "player-creation"}