Prototype/Accumulator: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Set prototype parent)
(Converted to SMW format)
Line 1: Line 1:
{{Prototype parent|Prototype/EntityWithHealth}}
{{Prototype parent|Prototype/EntityWithHealth}}
Entity with energy source with specialised animation for charging/decharging.


== Basics ==
{{Prototype TOC|accumulator}}
Prototype type: '''accumulator'''


Entity with energy source with specialised animation for charging/decharging.
Extends the [[Prototype/EntityWithHealth]]
== Usage in base==
== Usage in base==
*[[Accumulator]]
*[[Accumulator]]
== Mandatory properties ==
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].
This prototype inherits all the properties from [[Prototype/EntityWithHealth]].


=== energy_source ===
{{Prototype property|energy_source|[[Types/EnergySource|EnergySource]]}}
'''Type''': [[Types/EnergySource]]
 
The capacity of the energy source buffer specifies the capacity of the accumulator. Must be an electric energy source.
The capacity of the energy source buffer specifies the capacity of the accumulator. Must be an electric energy source.


=== picture ===
{{Prototype property|picture|[[Types/Sprite|Sprite]]}}
'''Type''': [[Types/Sprite]]


=== charge_cooldown ===
{{Prototype property|charge_cooldown|[[Types/uint16|uint16]]}}
'''Type''': [[Types/uint16]]
Count of ticks to preserve the animation even when the charging ends. Used to prevent rapid blinking of the accumulator with unstable need to use it.
 
Count of ticks to preserve the animation even when the charging ends.\n\nUsed to prevent rapid blinking of the accumulator with unstable need to use it.
 
=== discharge_cooldown ===
'''Type''': [[Types/uint16]]


{{Prototype property|discharge_cooldown|[[Types/uint16|uint16]]}}
How long (in ticks) the animation will last after discharge has been initialized.
How long (in ticks) the animation will last after discharge has been initialized.


== Optional properties ==
== Optional properties ==


=== charge_animation ===
{{Prototype property|charge_animation|[[Types/Animation|Animation]]|optional=true}}
'''Type''': [[Types/Animation]]
 
=== charge_light ===
'''Type''': [[Types/LightDefinition]]


=== discharge_animation ===
{{Prototype property|charge_light|[[Types/LightDefinition|LightDefinition]]|optional=true}}
'''Type''': [[Types/Animation]]


=== discharge_light ===
{{Prototype property|discharge_animation|[[Types/Animation|Animation]]|optional=true}}
'''Type''': [[Types/LightDefinition]]


=== circuit_wire_connection_point ===
{{Prototype property|discharge_light|[[Types/LightDefinition|LightDefinition]]|optional=true}}
'''Type''': [[Types/WireConnectionPoint]]


{{Prototype property|circuit_wire_connection_point|[[Types/WireConnectionPoint|WireConnectionPoint]]|optional=true}}
Defines how wires visually connect to this accumulator.
Defines how wires visually connect to this accumulator.


=== circuit_wire_max_distance ===
{{Prototype property|circuit_wire_max_distance|[[Types/double|double]]|0|optional=true}}
'''Type''': [[Types/double]]
 
'''Default''': 0
 
The maximum circuit wire distance for this entity.
The maximum circuit wire distance for this entity.


=== draw_copper_wires ===
{{Prototype property|draw_copper_wires|[[Types/bool|bool]]|true|optional=true}}
'''Type''': [[Types/bool]]
 
'''Default''': true


=== draw_circuit_wires ===
{{Prototype property|draw_circuit_wires|[[Types/bool|bool]]|true|optional=true}}
'''Type''': [[Types/bool]]
 
'''Default''': true
 
=== circuit_connector_sprites ===
'''Type''': [[Types/CircuitConnectorSprites]]


{{Prototype property|circuit_connector_sprites|[[Types/CircuitConnectorSprites|CircuitConnectorSprites]]|optional=true}}
The pictures displayed for circuit connections to this accumulator.
The pictures displayed for circuit connections to this accumulator.


=== default_output_signal ===
{{Prototype property|default_output_signal|[[Types/SignalIDConnector|SignalIDConnector]]|optional=true}}
'''Type''': [[Types/SignalIDConnector]]
The name of the signal that is the default for when an accumulator is connected to the circuit network.


The name of the signal that is the default for when an accumulator is connected to the circuit network.
== Example ==
== Example ==
<syntaxhighlight lang="lua">{
<syntaxhighlight lang="lua">{

Revision as of 11:40, 28 July 2019

Template:Prototype parent Entity with energy source with specialised animation for charging/decharging.

Template:Prototype TOC

Usage in base

Mandatory properties

This prototype inherits all the properties from Prototype/EntityWithHealth.

Template:Prototype property The capacity of the energy source buffer specifies the capacity of the accumulator. Must be an electric energy source.

Template:Prototype property

Template:Prototype property Count of ticks to preserve the animation even when the charging ends. Used to prevent rapid blinking of the accumulator with unstable need to use it.

Template:Prototype property How long (in ticks) the animation will last after discharge has been initialized.

Optional properties

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property

Template:Prototype property Defines how wires visually connect to this accumulator.

Template:Prototype property The maximum circuit wire distance for this entity.

Template:Prototype property

Template:Prototype property

Template:Prototype property The pictures displayed for circuit connections to this accumulator.

Template:Prototype property The name of the signal that is the default for when an accumulator is connected to the circuit network.

Example

{
    type = "accumulator",
    name = "accumulator",
    icon = "__base__/graphics/icons/accumulator.png",
    icon_size = 32,
    flags = {"placeable-neutral", "player-creation"},
    minable = {mining_time = 0.1, result = "accumulator"},
    max_health = 150,
    corpse = "accumulator-remnants",
    collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
    selection_box = {{-1, -1}, {1, 1}},
    drawing_box = {{-1, -1.5}, {1, 1}},
    energy_source =
    {
      type = "electric",
      buffer_capacity = "5MJ",
      usage_priority = "tertiary",
      input_flow_limit = "300kW",
      output_flow_limit = "300kW"
    },
    picture = accumulator_picture(),
    charge_animation = accumulator_charge(),

    charge_cooldown = 30,
    charge_light = {intensity = 0.3, size = 7, color = {r = 1.0, g = 1.0, b = 1.0}},
    discharge_animation = accumulator_discharge(),
    discharge_cooldown = 60,
    discharge_light = {intensity = 0.7, size = 7, color = {r = 1.0, g = 1.0, b = 1.0}},
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
    working_sound =
    {
      sound =
      {
        filename = "__base__/sound/accumulator-working.ogg",
        volume = 1
      },
      idle_sound =
      {
        filename = "__base__/sound/accumulator-idle.ogg",
        volume = 0.4
      },
      max_sounds_per_type = 5
    },

    circuit_wire_connection_point = circuit_connector_definitions["accumulator"].points,
    circuit_connector_sprites = circuit_connector_definitions["accumulator"].sprites,
    circuit_wire_max_distance = default_circuit_wire_max_distance,

    default_output_signal = {type = "virtual", name = "signal-A"}
  }