Prototype/ResourceEntity: Difference between revisions
(Set prototype parent) |
(Converted to SMW format) |
||
Line 1: | Line 1: | ||
{{Prototype parent|Prototype/Entity}} | {{Prototype parent|Prototype/Entity}} | ||
A mineable/gatherable entity. | |||
{{Prototype TOC|resource}} | |||
Prototype | |||
== Mandatory properties == | == Mandatory properties == | ||
This prototype inherits all the properties from [[Prototype/Entity]]. | This prototype inherits all the properties from [[Prototype/Entity]]. | ||
{{Prototype property|stages|[[Types/AnimationVariations|AnimationVariations]]}} | |||
Entity's graphics, using a graphic sheet, with variation and depletion. At least one stage must be defined. | Entity's graphics, using a graphic sheet, with variation and depletion. At least one stage must be defined. | ||
{{Prototype property|stage_counts|[[Types/table|table]] of [[Types/uint32|uint32]]}} | |||
Number of stages the animation has. | Number of stages the animation has. | ||
== Optional properties == | == Optional properties == | ||
{{Prototype property|infinite|[[Types/bool|bool]]|false|optional=true}} | |||
If the ore is infinitely minable, or if it will eventually run out of resource. | If the ore is infinitely minable, or if it will eventually run out of resource. | ||
{{Prototype property|highlight|[[Types/bool|bool]]|false|optional=true}} | |||
If the resource should be highlighted when holding a mining drill that can mine it (holding a pumpjack highlights crude-oil in the base game). | If the resource should be highlighted when holding a mining drill that can mine it (holding a pumpjack highlights crude-oil in the base game). | ||
{{Prototype property|randomize_visual_position|[[Types/bool|bool]]|true|optional=true}} | |||
= | |||
{{Prototype property|minimum|[[Types/uint32|uint32]]|0|optional=true}} | |||
Must be not 0 when <code>infinite = true</code>. | Must be not 0 when <code>infinite = true</code>. | ||
{{Prototype property|normal|[[Types/uint32|uint32]]|1|optional=true}} | |||
Must be not 0 when <code>infinite = true</code>. | Must be not 0 when <code>infinite = true</code>. | ||
{{Prototype property|infinite_depletion_amount|[[Types/uint32|uint32]]|1|optional=true}} | |||
''Every time an infinite-type resource "ticks" lower it's lowered by that amount.'' -- [https://forums.factorio.com/viewtopic.php?t=47093&p=271243#p271115 Rseding91] | ''Every time an infinite-type resource "ticks" lower it's lowered by that amount.'' -- [https://forums.factorio.com/viewtopic.php?t=47093&p=271243#p271115 Rseding91] | ||
{{Prototype property|category|[[Types/string|string]]|"basic-solid"|optional=true}} | |||
The category for the resource. Available categories in vanilla can be found here: [[Data.raw#resource-category]] | The category for the resource. Available categories in vanilla can be found here: [[Data.raw#resource-category]] | ||
{{Prototype property|map_grid|[[Types/bool|bool]]|true|optional=true}} | |||
= | |||
{{Prototype property|resource_patch_search_radius|[[Types/uint32|uint32]]|3|optional=true}} | |||
When hovering over this resource in the map view: How far to search for other resource patches of this type to display as one (summing amount, white outline). | When hovering over this resource in the map view: How far to search for other resource patches of this type to display as one (summing amount, white outline). | ||
{{Prototype property|stages_effect|[[Types/AnimationVariations|AnimationVariations]]|optional=true}} | |||
An effect that can be overlayed above the normal ore graphics. Used in the base game to make [[uranium ore]] glow. | An effect that can be overlayed above the normal ore graphics. Used in the base game to make [[uranium ore]] glow. | ||
{{Prototype property|effect_animation_period|[[Types/float|float]]|0.0|optional=true}} | |||
How long it takes <code>stages_effect</code> to go from <code>min_effect_alpha</code> to <code>max_effect_alpha</code>. | How long it takes <code>stages_effect</code> to go from <code>min_effect_alpha</code> to <code>max_effect_alpha</code>. | ||
{{Prototype property|effect_animation_period_deviation|[[Types/float|float]]|0.0|optional=true}} | |||
How much <code>effect_animation_period</code> can deviate from its original value. Used to make the stages effect alpha change look less uniform. | How much <code>effect_animation_period</code> can deviate from its original value. Used to make the stages effect alpha change look less uniform. | ||
{{Prototype property|effect_darkness_multiplier|[[Types/float|float]]|1.0|optional=true}} | |||
How much the surface darkness should affect the alpha of <code>stages_effect</code>. | How much the surface darkness should affect the alpha of <code>stages_effect</code>. | ||
{{Prototype property|min_effect_alpha|[[Types/float|float]]|0.0|optional=true}} | |||
Minimal alpha value of <code>stages_effect</code>. | Minimal alpha value of <code>stages_effect</code>. | ||
{{Prototype property|max_effect_alpha|[[Types/float|float]]|1.0|optional=true}} | |||
Maximal alpha value of <code>stages_effect</code>. | Maximal alpha value of <code>stages_effect</code>. | ||
{{Prototype property|tree_removal_probability|[[Types/double|double]]|0|optional=true}} | |||
Must be positive. | Must be positive. | ||
{{Prototype property|tree_removal_max_distance|[[Types/double|double]]|0|optional=true}} | |||
Must be positive when <code>tree_removal_probability</code> is set. | Must be positive when <code>tree_removal_probability</code> is set. | ||
Revision as of 21:20, 5 August 2019
Template:Prototype parent A mineable/gatherable entity.
Mandatory properties
This prototype inherits all the properties from Prototype/Entity.
Template:Prototype property Entity's graphics, using a graphic sheet, with variation and depletion. At least one stage must be defined.
Template:Prototype property Number of stages the animation has.
Optional properties
Template:Prototype property If the ore is infinitely minable, or if it will eventually run out of resource.
Template:Prototype property If the resource should be highlighted when holding a mining drill that can mine it (holding a pumpjack highlights crude-oil in the base game).
Template:Prototype property
Must be not 0 when infinite = true
.
Template:Prototype property
Must be not 0 when infinite = true
.
Template:Prototype property Every time an infinite-type resource "ticks" lower it's lowered by that amount. -- Rseding91
Template:Prototype property The category for the resource. Available categories in vanilla can be found here: Data.raw#resource-category
Template:Prototype property When hovering over this resource in the map view: How far to search for other resource patches of this type to display as one (summing amount, white outline).
Template:Prototype property An effect that can be overlayed above the normal ore graphics. Used in the base game to make uranium ore glow.
Template:Prototype property
How long it takes stages_effect
to go from min_effect_alpha
to max_effect_alpha
.
Template:Prototype property
How much effect_animation_period
can deviate from its original value. Used to make the stages effect alpha change look less uniform.
Template:Prototype property
How much the surface darkness should affect the alpha of stages_effect
.
Template:Prototype property
Minimal alpha value of stages_effect
.
Template:Prototype property
Maximal alpha value of stages_effect
.
Template:Prototype property Must be positive.
Template:Prototype property
Must be positive when tree_removal_probability
is set.
Example
{
type = "resource",
name = "crude-oil",
icon = "__base__/graphics/icons/crude-oil.png",
icon_size = 32,
flags = {"placeable-neutral"},
category = "basic-fluid",
order="a-b-a",
infinite = true,
highlight = true,
minimum = 60000,
normal = 300000,
infinite_depletion_amount = 10,
resource_patch_search_radius = 12,
tree_removal_probability = 0.7,
tree_removal_max_distance = 32 * 32,
minable =
{
mining_time = 1,
results =
{
{
type = "fluid",
name = "crude-oil",
amount_min = 10,
amount_max = 10,
probability = 1
}
}
},
collision_box = {{ -1.4, -1.4}, {1.4, 1.4}},
selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
autoplace = resource_autoplace.resource_autoplace_settings{
name = "crude-oil",
order = "c", -- Other resources are "b"; oil won't get placed if something else is already there.
base_density = 8.2,
base_spots_per_km2 = 1.8,
random_probability = 1/48,
random_spot_size_minimum = 1,
random_spot_size_maximum = 1, -- don't randomize spot size
additional_richness = 220000, -- this increases the total everywhere, so base_density needs to be decreased to compensate
has_starting_area_placement = false,
resource_index = resource_autoplace.resource_indexes["crude-oil"],
regular_rq_factor_multiplier = 1
},
stage_counts = {0},
stages =
{
sheet =
{
filename = "__base__/graphics/entity/crude-oil/crude-oil.png",
priority = "extra-high",
width = 75,
height = 61,
frame_count = 4,
variation_count = 1
}
},
map_color = {r=0.78, g=0.2, b=0.77},
map_grid = false
}