Prototype/Car: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎working_sound: inherited from entity)
(format guns type less weirdly)
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Basics==
{{Prototype parent|Prototype/Vehicle}}
Entity with specialized properties for acceleration, braking, and turning.
Entity with specialized properties for acceleration, braking, and turning.
Extends the [[Prototype/EntityWithHealth]]
 
== Usage in base==
{{Prototype TOC|car}}
 
== Usage in base ==
*[[Car]]
*[[Car]]
*[[Tank]]
*[[Tank]]
== Properties ==


=== animation ===
== Mandatory properties ==
'''Type''': [[Types/RotatedAnimation]]
This prototype inherits all the properties from [[Prototype/Vehicle]].


'''Since''': 0.11.0
{{Prototype property|animation|[[Types/RotatedAnimation|RotatedAnimation]]}}
Animation speed 1 means 1 frame per tile.


Default animation speed is 1 frame / tile.
{{Prototype property|effectivity|[[Types/double|double]]}}
 
=== turret_animation ===
'''Type''': [[Types/RotatedAnimation]]
 
'''Since''': 0.11.0
 
Optional. Default animation speed is 1 frame / tile.
 
=== render_layer ===
'''Type''': [[Types/RenderLayer]]
 
'''Since''': 0.15.0
 
=== effectivity ===
'''Type''': [[Types/double]]
 
'''Since''': 0.11.0
 
Same meaning as the old acceleration_per_energy.
Modifies the efficiency of energy transfer from burner output to wheels.
Modifies the efficiency of energy transfer from burner output to wheels.


=== braking_power ===
{{Prototype property|consumption|[[Types/Energy|Energy]]}}
'''Type''': [[Types/EnergyAmount]]
 
'''Since''': 0.11.0
 
=== consumption ===
'''Type''': [[Types/EnergyAmount]]
 
=== friction ===
'''Type''': [[Types/double]](?)
 
=== terrain_friction_modifier ===
'''Type''': Unknown (float or double?)
 
=== rotation_speed ===
'''Type''': [[Types/double]]
 
=== turret_rotation_speed ===
'''Type''': [[Types/double]]
 
'''Since''': 0.11.0
 
'''Default''': 0.01


=== turret_return_timeout ===
{{Prototype property|rotation_speed|[[Types/double|double]]}}
'''Type''': [[Types/uint]]


'''Since''': 0.11.0
{{Prototype property|burner or energy_source|[[Types/EnergySource|EnergySource]]}}
Must be a burner energy source when using "burner", otherwise it can also be a void energy source.


'''Default''': 60
{{Prototype property|inventory_size|[[Types/ItemStackIndex|ItemStackIndex]]}}
Size of the car inventory.


Timeout in ticks specifying how long the turret must be inactive to return to the default position.
== Optional properties ==


=== guns ===
{{Prototype property|turret_animation|[[Types/RotatedAnimation|RotatedAnimation]]|optional=true}}
'''Type''': [[Types/table]] of [[Types/string]]s of prototype names
Animation speed 1 means 1 frame per tile.


The guns this car prototype uses.
{{Prototype property|light_animation|[[Types/RotatedAnimation|RotatedAnimation]]|optional=true}}
Must have the same frame count as <code>animation</code>.


=== stop_trigger_speed ===
{{Prototype property|render_layer|[[Types/RenderLayer|RenderLayer]]|"object"|optional=true}}
'''Type''': Unknown (float or double?)
 
=== stop_trigger ===
'''Type''': [[Types/table]] of a [[Types/Sound]] and <code>type = "play-sound"</code>
 
inherited from [[Prototype/Vehicle]]?
 
=== crash_trigger ===
'''Type''': [[Types/table]] of a [[Types/Sound]] and <code>type = "play-sound"</code>
 
inherited from [[Prototype/Vehicle]]?
 
=== tank_driving ===
'''Type''': [[Types/bool]]


{{Prototype property|tank_driving|[[Types/bool|bool]]|false|optional=true}}
If this car prototype uses tank controls to drive.
If this car prototype uses tank controls to drive.


=== sound_minimum_speed ===
{{Prototype property|has_belt_immunity|[[Types/bool|bool]]|false|optional=true}}
'''Type''': Unknown (float or double?)
If this car is immune to movement by belts.


inherited from [[Prototype/Vehicle]]?
{{Prototype property|immune_to_tree_impacts|[[Types/bool|bool]]|false|optional=true}}
If this car gets damaged by driving over/against [[Prototype/Tree]]s.


=== sound_no_fuel ===
{{Prototype property|immune_to_rock_impacts|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/Sound]]
If this car gets damaged by driving over/against [[Prototype/SimpleEntity#count_as_rock_for_filtered_deconstruction|rocks]].


=== mined_sound ===
{{Prototype property|turret_rotation_speed|[[Types/double|double]]|0.01|optional=true}}
'''Type''': [[Types/Sound]]


=== open_sound ===
{{Prototype property|turret_return_timeout|[[Types/uint32|uint32]]|60|optional=true}}
'''Type''': [[Types/Sound]]
Timeout in ticks specifying how long the turret must be inactive to return to the default position.
 
=== close_sound ===
'''Type''': [[Types/Sound]]
 
=== energy_per_hit_point ===
'''Type''': Unknown (uint?)
 
inherited from [[Prototype/Vehicle]]?
 
=== light ===
'''Type''': [[Types/Light]]
 
=== burner ===
'''Type''': [[Types/EnergySource]]-Burner
 
=== inventory_size ===
'''Type''': [[Types/InventorySize]]
 
== Removed properties ==
 
=== breaking_speed ===
'''Type''': [[Types/double]]
 
'''Until''': 0.10.12


=== pictures ===
{{Prototype property|light|[[Types/LightDefinition|LightDefinition]]|optional=true}}
'''Type''': [[Types/RotatedSprite]]


'''Until''': 0.10.12
{{Prototype property|sound_no_fuel|[[Types/Sound|Sound]]|optional=true}}


=== acceleration_per_energy ===
{{Prototype property|darkness_to_render_light_animation|[[Types/float|float]]|0.3|optional=true}}
'''Type''': [[Types/double]]


'''Until''': 0.10.12
{{Prototype property|track_particle_triggers|[[Types/FootstepTriggerEffectList|FootstepTriggerEffectList]]|optional=true}}


== Example ==
{{Prototype property|guns|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
    {
The names of the [[Prototype/Gun]]s this car prototype uses.
    type = "car",
    name = "car",
    icon = "__base__/graphics/icons/car.png",
    flags = {"pushable", "placeable-neutral", "player-creation"},
    minable = {mining_time = 1, result = "car"},
    max_health = 500,
    corpse = "medium-remnants",
    resistances =
    {
      {
        type = "fire",
        percent = 50
      }
    },
    collision_box = {{-0.7, -1}, {0.7, 1}},
    selection_box = {{-0.7, -1}, {0.7, 1}},
    acceleration_per_energy = 0.001,
    breaking_speed = 0.01,
    burner =
    {
      effectivity = 1,
      fuel_inventory_size = 1,
      smoke =
      {
        {
          name = "smoke",
          deviation = {0.25, 0.25},
          frequency = 50,
          position = {0, 1.5},
          slow_down_factor = 0.9,
          starting_frame = 3,
          starting_frame_deviation = 5,
          starting_frame_speed = 0,
          starting_frame_speed_deviation = 5
        }
      }
    },
    consumption = 10,
    friction = 0.02,
    light = {intensity = 0.4, size = 25},
    pictures =
    {
      filename = "__base__/graphics/entity/car/car-sheet.png",
      line_length = 8,
      frame_width = 130,
      frame_height = 93,
      shift = {0.5, 0},
      axially_symmetrical = false,
      direction_count = 64
    },
    rotation_speed = 0.015,
    weight = 50,
    inventory_size = 12
  }

Revision as of 10:31, 13 October 2021

Prototype definitions » PrototypeBase » Prototype/Entity » Prototype/EntityWithHealth » Prototype/EntityWithOwner » Prototype/Vehicle » Prototype/Car


Entity with specialized properties for acceleration, braking, and turning.


Prototype/Car — car
animation::RotatedAnimation
burner or energy_source::EnergySource
consumption::Energy
effectivity::double
inventory_size::ItemStackIndex
rotation_speed::double
darkness_to_render_light_animation::float (optional)
guns::table of string (optional)
has_belt_immunity::bool (optional)
immune_to_cliff_impacts::bool (optional)
immune_to_rock_impacts::bool (optional)
immune_to_tree_impacts::bool (optional)
light::LightDefinition (optional)
light_animation::RotatedAnimation (optional)
render_layer::RenderLayer (optional)
sound_no_fuel::Sound (optional)
tank_driving::bool (optional)
track_particle_triggers::FootstepTriggerEffectList (optional)
turret_animation::RotatedAnimation (optional)
turret_return_timeout::uint32 (optional)
turret_rotation_speed::double (optional)
Inherited from Prototype/Vehicle
braking_power or braking_force::Energy or double
energy_per_hit_point::double
friction or friction_force::double
weight::double
allow_passengers::bool (optional)
crash_trigger::TriggerEffect (optional)
equipment_grid::string (optional)
minimap_representation::Sprite (optional)
selected_minimap_representation::Sprite (optional)
sound_minimum_speed::double (optional)
sound_scaling_ratio::double (optional)
stop_trigger::TriggerEffect (optional)
stop_trigger_speed::double (optional)
terrain_friction_modifier::float (optional)
Inherited from Prototype/EntityWithOwner
allow_run_time_change_of_is_military_target::bool (optional)
is_military_target::bool (optional)
Inherited from Prototype/EntityWithHealth
alert_when_damaged::bool (optional)
attack_reaction::AttackReaction (optional)
corpse::string or table of strings (optional)
create_ghost_on_death::bool (optional)
damaged_trigger_effect::TriggerEffect (optional)
dying_explosion::ExplosionDefinition or table of ExplosionDefinition (optional)
dying_trigger_effect::TriggerEffect (optional)
healing_per_tick::float (optional)
hide_resistances::bool (optional)
integration_patch::Sprite4Way (optional)
integration_patch_render_layer::RenderLayer (optional)
loot::Loot (optional)
max_health::float (optional)
random_corpse_variation::bool (optional)
repair_sound::Sound (optional)
repair_speed_modifier::float (optional)
resistances::Resistances (optional)
Inherited from Prototype/Entity
icons, icon, icon_size (IconSpecification)::IconSpecification
additional_pastable_entities::table of string (optional)
alert_icon_scale::float (optional)
alert_icon_shift::vector (optional)
allow_copy_paste::bool (optional)
autoplace::AutoplaceSpecification (optional)
build_base_evolution_requirement::double (optional)
build_grid_size::uint8 (optional)
build_sound::Sound (optional)
close_sound::Sound (optional)
collision_box::BoundingBox (optional)
collision_mask::CollisionMask (optional)
created_effect::Trigger (optional)
created_smoke::CreateTrivialSmokeEffectItem (optional)
drawing_box::BoundingBox (optional)
emissions_per_second::double (optional)
enemy_map_color::Color (optional)
fast_replaceable_group::string (optional)
flags::EntityPrototypeFlags (optional)
friendly_map_color::Color (optional)
hit_visualization_box::BoundingBox (optional)
map_color::Color (optional)
map_generator_bounding_box::BoundingBox (optional)
minable::MinableProperties (optional)
mined_sound::Sound (optional)
mining_sound::Sound (optional)
next_upgrade::string (optional)
open_sound::Sound (optional)
placeable_by::ItemToPlace or table of ItemToPlace (optional)
protected_from_tile_building::bool (optional)
radius_visualisation_specification::RadiusVisualisationSpecification (optional)
remains_when_mined::string or table of string (optional)
remove_decoratives::string (optional)
rotated_sound::Sound (optional)
selectable_in_game::bool (optional)
selection_box::BoundingBox (optional)
selection_priority::uint8 (optional)
shooting_cursor_size::double (optional)
sticker_box::BoundingBox (optional)
subgroup::string (optional)
tile_height::uint32 (optional)
tile_width::uint32 (optional)
trigger_target_mask::TriggerTargetMask (optional)
vehicle_impact_sound::Sound (optional)
water_reflection::WaterReflectionDefinition (optional)
working_sound::WorkingSound (optional)
Inherited from PrototypeBase
name::string
type::string
localised_description::LocalisedString (optional)
localised_name::LocalisedString (optional)
order::Order (optional)

Usage in base

Mandatory properties

This prototype inherits all the properties from Prototype/Vehicle.

animation

Type: RotatedAnimation
Animation speed 1 means 1 frame per tile.

effectivity

Type: double
Modifies the efficiency of energy transfer from burner output to wheels.

consumption

Type: Energy

rotation_speed

Type: double

burner or energy_source

Type: EnergySource
Must be a burner energy source when using "burner", otherwise it can also be a void energy source.

inventory_size

Type: ItemStackIndex
Size of the car inventory.

Optional properties

turret_animation

Type: RotatedAnimation
Animation speed 1 means 1 frame per tile.

light_animation

Type: RotatedAnimation
Must have the same frame count as animation.

render_layer

Type: RenderLayer
Default: "object"

tank_driving

Type: bool
Default: false
If this car prototype uses tank controls to drive.

has_belt_immunity

Type: bool
Default: false
If this car is immune to movement by belts.

immune_to_tree_impacts

Type: bool
Default: false
If this car gets damaged by driving over/against Prototype/Trees.

immune_to_rock_impacts

Type: bool
Default: false
If this car gets damaged by driving over/against rocks.

turret_rotation_speed

Type: double
Default: 0.01

turret_return_timeout

Type: uint32
Default: 60
Timeout in ticks specifying how long the turret must be inactive to return to the default position.

light

Type: LightDefinition

sound_no_fuel

Type: Sound

darkness_to_render_light_animation

Type: float
Default: 0.3

track_particle_triggers

Type: FootstepTriggerEffectList

guns

Type: table of string
The names of the Prototype/Guns this car prototype uses.