Prototype/Car: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Added prototype changes in 0.11.0)
(1.1.74: immune_to_cliff_impacts added)
 
(14 intermediate revisions by 3 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]]
* Since 0.11.0: [[Tank]]
*[[Tank]]
== Properties ==
=== pictures ===
'''Type''': [[Types/RotatedSprite]]
'''Until''': 0.10.12


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


Default animation speed is 1 frame / tile.
{{Prototype property|animation|[[Types/RotatedAnimation|RotatedAnimation]]}}
Animation speed 1 means 1 frame per tile.


=== turret_animation ===
{{Prototype property|effectivity|[[Types/double|double]]}}
'''Type''': [[Types/RotatedAnimation]]
Modifies the efficiency of energy transfer from burner output to wheels.
'''Since''': 0.11.0


Optional. Default animation speed is 1 frame / tile.
{{Prototype property|consumption|[[Types/Energy|Energy]]}}


=== acceleration_per_energy ===
{{Prototype property|rotation_speed|[[Types/double|double]]}}
'''Type''': [[Types/double]]
'''Until''': 0.10.12


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


Same meaning as the old acceleration_per_energy.
{{Prototype property|inventory_size|[[Types/ItemStackIndex|ItemStackIndex]]}}
Modifies the efficiency of energy transfer from burner output to wheels.
Size of the car inventory.
 
== Optional properties ==
 
{{Prototype property|turret_animation|[[Types/RotatedAnimation|RotatedAnimation]]|optional=true}}
Animation speed 1 means 1 frame per tile.
 
{{Prototype property|light_animation|[[Types/RotatedAnimation|RotatedAnimation]]|optional=true}}
Must have the same frame count as <code>animation</code>.


=== breaking_speed ===
{{Prototype property|render_layer|[[Types/RenderLayer|RenderLayer]]|"object"|optional=true}}
'''Type''': [[Types/double]]
'''Until''': 0.10.12


=== braking_power ===
{{Prototype property|tank_driving|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/Energy]]
If this car prototype uses tank controls to drive.
'''Since''': 0.11.0


=== consumption ===
{{Prototype property|has_belt_immunity|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/Energy]]
If this car is immune to movement by belts.


=== friction ===
{{Prototype property|immune_to_tree_impacts|[[Types/bool|bool]]|false|optional=true}}
'''Type''': [[Types/double]]
If this car gets damaged by driving over/against [[Prototype/Tree]]s.


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


=== turret_rotation_speed ===
{{Prototype property|immune_to_cliff_impacts|[[Types/bool|bool]]|true|optional=true}}
'''Type''': [[Types/double]]
If this car gets damaged by driving against [[Prototype/Cliff]]s.
'''Since''': 0.11.0
'''Default''': 0.01


=== turret_return_timeout ===
{{Prototype property|turret_rotation_speed|[[Types/double|double]]|0.01|optional=true}}
'''Type''': [[Types/uint32_t]]
'''Since''': 0.11.0
'''Default''': 60


{{Prototype property|turret_return_timeout|[[Types/uint32|uint32]]|60|optional=true}}
Timeout in ticks specifying how long the turret must be inactive to return to the default position.
Timeout in ticks specifying how long the turret must be inactive to return to the default position.


=== burner ===
{{Prototype property|light|[[Types/LightDefinition|LightDefinition]]|optional=true}}
'''Type''': [[Types/EnergySource]]-Burner
 
{{Prototype property|sound_no_fuel|[[Types/Sound|Sound]]|optional=true}}
 
{{Prototype property|darkness_to_render_light_animation|[[Types/float|float]]|0.3|optional=true}}


=== inventory_size ===
{{Prototype property|track_particle_triggers|[[Types/FootstepTriggerEffectList|FootstepTriggerEffectList]]|optional=true}}
'''Type''': [[Types/InventorySize]]


== 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
  }

Latest revision as of 17:55, 16 December 2022

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.

immune_to_cliff_impacts

Type: bool
Default: true
If this car gets damaged by driving against Prototype/Cliffs.

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.