Types/DamageTypeFilters: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "Either a dictionary (Types/table) with the below properties, an array (Types/table) of names of Prototype/DamageTypes (Types/strings), or one name of a Proto...")
 
(Explanation for whitelist property)
Line 15: Line 15:


'''Default''': false
'''Default''': false
Whether this is a whitelist or a blacklist of damage types. Defaults to being a blacklist.


== Examples ==
== Examples ==
A single damage type filter can be specified in the following 4 different ways:
A single damage type filter to blacklist fire can be specified in the following 4 different ways:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
damage_type_filters = "fire"
damage_type_filters = "fire"

Revision as of 08:29, 22 June 2021

Either a dictionary (Types/table) with the below properties, an array (Types/table) of names of Prototype/DamageTypes (Types/strings), or one name of a Prototype/DamageType (Types/string).

Mandatory properties

types

Type: Types/string or Types/table (array) of Types/string

Default: false

Name or names of Prototype/DamageTypes.

Optional properties

whitelist

Type: Types/bool

Default: false

Whether this is a whitelist or a blacklist of damage types. Defaults to being a blacklist.

Examples

A single damage type filter to blacklist fire can be specified in the following 4 different ways:

damage_type_filters = "fire"
damage_type_filters = { "fire" } -- more damage types could be specified here
damage_type_filters = 
{
  whitelist = false, -- optional
  types = "fire"
}
damage_type_filters = 
{
  whitelist = false, -- optional
  types = { "fire" } -- more damage types could be specified here
}