Prototype/Car: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
No edit summary
(format guns type less weirdly)
(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==
*[[Car|Car]]
== Properties ==
=== pictures ===
'''Type''': [[Types/RotatedSprite]]


=== acceleration_per_energy ===
{{Prototype TOC|car}}
'''Type''': [[Types/double]]


=== breaking_speed ===
== Usage in base ==
'''Type''': [[Types/double]]
*[[Car]]
*[[Tank]]


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


=== friction ===
{{Prototype property|animation|[[Types/RotatedAnimation|RotatedAnimation]]}}
'''Type''': [[Types/double]]
Animation speed 1 means 1 frame per tile.


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


=== burner ===
{{Prototype property|consumption|[[Types/Energy|Energy]]}}
'''Type''': [[Types/EnergySource]]-Burner


=== inventory_size ===
{{Prototype property|rotation_speed|[[Types/double|double]]}}
'''Type''': [[Types/InventorySize]]


== Example ==
{{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.
    type = "car",
 
    name = "car",
{{Prototype property|inventory_size|[[Types/ItemStackIndex|ItemStackIndex]]}}
    icon = "__base__/graphics/icons/car.png",
Size of the car inventory.
    flags = {"pushable", "placeable-neutral", "player-creation"},
 
    minable = {mining_time = 1, result = "car"},
== Optional properties ==
    max_health = 500,
 
    corpse = "medium-remnants",
{{Prototype property|turret_animation|[[Types/RotatedAnimation|RotatedAnimation]]|optional=true}}
    resistances =
Animation speed 1 means 1 frame per tile.
    {
 
      {
{{Prototype property|light_animation|[[Types/RotatedAnimation|RotatedAnimation]]|optional=true}}
        type = "fire",
Must have the same frame count as <code>animation</code>.
        percent = 50
 
      }
{{Prototype property|render_layer|[[Types/RenderLayer|RenderLayer]]|"object"|optional=true}}
    },
 
    collision_box = {{-0.7, -1}, {0.7, 1}},
{{Prototype property|tank_driving|[[Types/bool|bool]]|false|optional=true}}
    selection_box = {{-0.7, -1}, {0.7, 1}},
If this car prototype uses tank controls to drive.
    acceleration_per_energy = 0.001,
 
    breaking_speed = 0.01,
{{Prototype property|has_belt_immunity|[[Types/bool|bool]]|false|optional=true}}
    burner =
If this car is immune to movement by belts.
    {
 
      effectivity = 1,
{{Prototype property|immune_to_tree_impacts|[[Types/bool|bool]]|false|optional=true}}
      fuel_inventory_size = 1,
If this car gets damaged by driving over/against [[Prototype/Tree]]s.
      smoke =
 
      {
{{Prototype property|immune_to_rock_impacts|[[Types/bool|bool]]|false|optional=true}}
        {
If this car gets damaged by driving over/against [[Prototype/SimpleEntity#count_as_rock_for_filtered_deconstruction|rocks]].
          name = "smoke",
 
          deviation = {0.25, 0.25},
{{Prototype property|turret_rotation_speed|[[Types/double|double]]|0.01|optional=true}}
          frequency = 50,
 
          position = {0, 1.5},
{{Prototype property|turret_return_timeout|[[Types/uint32|uint32]]|60|optional=true}}
          slow_down_factor = 0.9,
Timeout in ticks specifying how long the turret must be inactive to return to the default position.
          starting_frame = 3,
 
          starting_frame_deviation = 5,
{{Prototype property|light|[[Types/LightDefinition|LightDefinition]]|optional=true}}
          starting_frame_speed = 0,
 
          starting_frame_speed_deviation = 5
{{Prototype property|sound_no_fuel|[[Types/Sound|Sound]]|optional=true}}
        }
 
      }
{{Prototype property|darkness_to_render_light_animation|[[Types/float|float]]|0.3|optional=true}}
    },
 
    consumption = 10,
{{Prototype property|track_particle_triggers|[[Types/FootstepTriggerEffectList|FootstepTriggerEffectList]]|optional=true}}
    friction = 0.02,
 
    light = {intensity = 0.4, size = 25},
{{Prototype property|guns|[[Types/table|table]] of [[Types/string|string]]|optional=true}}
    pictures =
The names of the [[Prototype/Gun]]s this car prototype uses.
    {
      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.