Prototype/Car: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Added prototype changes in 0.11.0)
(Removed old prototype docs)
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Basics==
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/prototypes/CarPrototype.html https://lua-api.factorio.com/latest/prototypes/CarPrototype.html]
Entity with specialized properties for acceleration, braking, and turning.
Extends the [[Prototype/EntityWithHealth]]
== Usage in base==
*[[Car]]
* Since 0.11.0: [[Tank]]
== Properties ==
=== pictures ===
'''Type''': [[Types/RotatedSprite]]
'''Until''': 0.10.12


=== animation ===
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
'''Type''': [[Types/RotatedAnimation]]
'''Since''': 0.11.0
 
Default animation speed is 1 frame / tile.
 
=== turret_animation ===
'''Type''': [[Types/RotatedAnimation]]
'''Since''': 0.11.0
 
Optional. Default animation speed is 1 frame / tile.
 
=== acceleration_per_energy ===
'''Type''': [[Types/double]]
'''Until''': 0.10.12
 
=== 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.
 
=== breaking_speed ===
'''Type''': [[Types/double]]
'''Until''': 0.10.12
 
=== braking_power ===
'''Type''': [[Types/Energy]]
'''Since''': 0.11.0
 
=== consumption ===
'''Type''': [[Types/Energy]]
 
=== friction ===
'''Type''': [[Types/double]]
 
=== rotation_speed ===
'''Type''': [[Types/double]]
 
=== turret_rotation_speed ===
'''Type''': [[Types/double]]
'''Since''': 0.11.0
'''Default''': 0.01
 
=== turret_return_timeout ===
'''Type''': [[Types/uint32_t]]
'''Since''': 0.11.0
'''Default''': 60
 
Timeout in ticks specifying how long the turret must be inactive to return to the default position.
 
=== burner ===
'''Type''': [[Types/EnergySource]]-Burner
 
=== inventory_size ===
'''Type''': [[Types/InventorySize]]
 
== Example ==
    {
    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 14:32, 25 October 2024

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/prototypes/CarPrototype.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.