Prototype/Car: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎working_sound: inherited from entity)
(0.16)
Line 1: Line 1:
==Basics==
== Basics ==
Entity with specialized properties for acceleration, braking, and turning.
Entity with specialized properties for acceleration, braking, and turning. Extends [[Prototype/Vehicle]].
Extends the [[Prototype/EntityWithHealth]]
 
== Usage in base==
== Usage in base ==
*[[Car]]
*[[Car]]
*[[Tank]]
*[[Tank]]
== Properties ==
 
== Mandatory properties ==
This prototype inherits all the properties from [[Prototype/Vehicle]].


=== animation ===
=== animation ===
'''Type''': [[Types/RotatedAnimation]]
'''Type''': [[Types/RotatedAnimation]]


'''Since''': 0.11.0
Animation speed 1 means 1 frame per tile.
 
Default animation speed is 1 frame / tile.
 
=== 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 ===
=== effectivity ===
'''Type''': [[Types/double]]
'''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 ===
'''Type''': [[Types/EnergyAmount]]
'''Since''': 0.11.0


=== consumption ===
=== consumption ===
'''Type''': [[Types/EnergyAmount]]
'''Type''': [[Types/Energy]]
 
=== friction ===
'''Type''': [[Types/double]](?)
 
=== terrain_friction_modifier ===
'''Type''': Unknown (float or double?)


=== rotation_speed ===
=== rotation_speed ===
'''Type''': [[Types/double]]
'''Type''': [[Types/double]]


=== turret_rotation_speed ===
=== burner ===
'''Type''': [[Types/double]]
'''Type''': [[Types/EnergySource]]


'''Since''': 0.11.0
Must be a burner energy source.


'''Default''': 0.01
=== inventory_size ===
'''Type''': [[Types/ItemStackIndex]]


=== turret_return_timeout ===
Size of the car inventory.
'''Type''': [[Types/uint]]


'''Since''': 0.11.0
== Optional properties ==


'''Default''': 60
=== turret_animation ===
'''Type''': [[Types/RotatedAnimation]]


Timeout in ticks specifying how long the turret must be inactive to return to the default position.
Animation speed 1 means 1 frame per tile.


=== guns ===
=== render_layer ===
'''Type''': [[Types/table]] of [[Types/string]]s of prototype names
'''Type''': [[Types/RenderLayer]]
 
The guns this car prototype uses.
 
=== stop_trigger_speed ===
'''Type''': Unknown (float or double?)


=== stop_trigger ===
'''Default''': "object"
'''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 ===
=== tank_driving ===
'''Type''': [[Types/bool]]
'''Type''': [[Types/bool]]
'''Default''': false


If this car prototype uses tank controls to drive.
If this car prototype uses tank controls to drive.


=== sound_minimum_speed ===
=== has_belt_immunity ===
'''Type''': Unknown (float or double?)
'''Type''': [[Types/bool]]


inherited from [[Prototype/Vehicle]]?
'''Default''': false


=== sound_no_fuel ===
If this car is immune to movement by belts.
'''Type''': [[Types/Sound]]


=== mined_sound ===
=== immune_to_tree_impacts ===
'''Type''': [[Types/Sound]]
'''Type''': [[Types/bool]]


=== open_sound ===
'''Default''': false
'''Type''': [[Types/Sound]]


=== close_sound ===
If this car gets damaged by drving over/against trees.
'''Type''': [[Types/Sound]]


=== energy_per_hit_point ===
=== turret_rotation_speed ===
'''Type''': Unknown (uint?)
'''Type''': [[Types/double]]


inherited from [[Prototype/Vehicle]]?
'''Default''': 0.01


=== light ===
=== turret_return_timeout ===
'''Type''': [[Types/Light]]
'''Type''': [[Types/uint32]]


=== burner ===
'''Default''': 60
'''Type''': [[Types/EnergySource]]-Burner


=== inventory_size ===
Timeout in ticks specifying how long the turret must be inactive to return to the default position.
'''Type''': [[Types/InventorySize]]


== Removed properties ==
=== light ===
'''Type''': [[Types/LightDefinition]]


=== breaking_speed ===
=== sound_no_fuel ===
'''Type''': [[Types/double]]
'''Type''': [[Types/Sound]]


'''Until''': 0.10.12
=== guns ===
'''Type''': [[Types/table]] of [[Types/string]]s of prototype names


=== pictures ===
The guns this car prototype uses.
'''Type''': [[Types/RotatedSprite]]
 
'''Until''': 0.10.12
 
=== acceleration_per_energy ===
'''Type''': [[Types/double]]
 
'''Until''': 0.10.12
 
== 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
  }

Revision as of 08:08, 23 May 2018

Basics

Entity with specialized properties for acceleration, braking, and turning. Extends Prototype/Vehicle.

Usage in base

Mandatory properties

This prototype inherits all the properties from Prototype/Vehicle.

animation

Type: Types/RotatedAnimation

Animation speed 1 means 1 frame per tile.

effectivity

Type: Types/double

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

consumption

Type: Types/Energy

rotation_speed

Type: Types/double

burner

Type: Types/EnergySource

Must be a burner energy source.

inventory_size

Type: Types/ItemStackIndex

Size of the car inventory.

Optional properties

turret_animation

Type: Types/RotatedAnimation

Animation speed 1 means 1 frame per tile.

render_layer

Type: Types/RenderLayer

Default: "object"

tank_driving

Type: Types/bool

Default: false

If this car prototype uses tank controls to drive.

has_belt_immunity

Type: Types/bool

Default: false

If this car is immune to movement by belts.

immune_to_tree_impacts

Type: Types/bool

Default: false

If this car gets damaged by drving over/against trees.

turret_rotation_speed

Type: Types/double

Default: 0.01

turret_return_timeout

Type: Types/uint32

Default: 60

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

light

Type: Types/LightDefinition

sound_no_fuel

Type: Types/Sound

guns

Type: Types/table of Types/strings of prototype names

The guns this car prototype uses.