Prototype/Car: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "==Basics== Entity with specialized properties for acceleration, braking, and turning. Extends the Prototype/EntityWithHealth == Usage in base== *Car == Properties ...")
 
(1.1.74: immune_to_cliff_impacts added)
 
(16 intermediate revisions by 4 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/Animation]]


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


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


=== consumption ===
== Mandatory properties ==
'''Type''': [[Types/int]]?
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]]


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