Prototype/Vehicle: Difference between revisions
(Set prototype parent) |
(Updated styling of prototype doc migration note) |
||
(14 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<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/VehiclePrototype.html https://lua-api.factorio.com/latest/prototypes/VehiclePrototype.html] | |||
</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> | |||
This | |||
Abstract base of all vehicles. | |||
{{Prototype parent|Prototype/EntityWithOwner}} | |||
Abstract base of all vehicles. | |||
{{Prototype TOC|''abstract''}} | |||
== Extensions == | == Extensions == | ||
Line 13: | Line 17: | ||
** [[Prototype/FluidWagon]] '''fluid-wagon''' | ** [[Prototype/FluidWagon]] '''fluid-wagon''' | ||
** [[Prototype/Locomotive]] '''locomotive''' | ** [[Prototype/Locomotive]] '''locomotive''' | ||
* [[Prototype/SpiderVehicle]] '''spider-vehicle''' | |||
== Mandatory properties == | == Mandatory properties == | ||
This prototype inherits all the properties from [[Prototype/ | This prototype inherits all the properties from [[Prototype/EntityWithOwner]]. | ||
{{Prototype property|weight|[[Types/double|double]]}} | |||
Must be positive. | Must be positive. | ||
Weight of the entity used for physics calculation when car hits something. | Weight of the entity used for physics calculation when car hits something. | ||
{{Prototype property|braking_power or braking_force|[[Types/Energy|Energy]] or [[Types/double|double]]}} | |||
Two different ways to set braking force. At least one must exist. Must be positive. | Two different ways to set braking force. At least one must exist. Must be positive. | ||
{{Prototype property|friction or friction_force|[[Types/double|double]]}} | |||
Two different ways to set friction force. At least one must exist. Must be positive. | Two different ways to set friction force. At least one must exist. Must be positive. | ||
{{Prototype property|energy_per_hit_point|[[Types/double|double]]}} | |||
The (movement) energy used per hit point (1 hit point = 1 health damage) taken and dealt for this vehicle during collisions. The smaller the number, the more damage this vehicle and the rammed entity take during collisions: <code>damage = energy / energy_per_hit_point</code>. | |||
== Optional properties == | == Optional properties == | ||
{{Prototype property|terrain_friction_modifier|[[Types/float|float]]|1|optional=true}} | |||
Must be in the [0, 1] interval. | Must be in the [0, 1] interval. | ||
{{Prototype property|sound_minimum_speed|[[Types/double|double]]|1 / 60.0|optional=true}} | |||
Must be positive. Sound is scaled by speed. | |||
Must be positive. | |||
{{Prototype property|sound_scaling_ratio|[[Types/double|double]]|1.0|optional=true}} | |||
Must be positive. Sound is scaled by speed. | |||
{{Prototype property|stop_trigger_speed|[[Types/double|double]]|0.0|optional=true}} | |||
{{Prototype property|crash_trigger|[[Types/TriggerEffect|TriggerEffect]]|optional=true}} | |||
{{Prototype property|stop_trigger|[[Types/TriggerEffect|TriggerEffect]]|optional=true}} | |||
{{Prototype property|equipment_grid|[[Types/string|string]]|optional=true}} | |||
The name of the [[Prototype/EquipmentGrid|equipment grid]] this vehicle has. | |||
The | {{Prototype property|minimap_representation|[[Types/Sprite|Sprite]]|optional=true}} | ||
The sprite that represents this vehicle on the map/minimap. | |||
{{Prototype property|selected_minimap_representation|[[Types/Sprite|Sprite]]|optional=true}} | |||
The sprite that represents this vehicle on the map/minimap when it is selected. | |||
{{Prototype property|allow_passengers|[[Types/bool|bool]]|true|optional=true}} | |||
Determines whether this vehicle accepts passengers. This includes both drivers and gunners, if applicable. |
Latest revision as of 10:43, 21 September 2023
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/VehiclePrototype.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.
Prototype definitions » PrototypeBase » Prototype/Entity » Prototype/EntityWithHealth » Prototype/EntityWithOwner » Prototype/Vehicle
Abstract base of all vehicles.
Extensions
- Prototype/Car car
- Prototype/RollingStock <abstract>
- Prototype/ArtilleryWagon artillery-wagon
- Prototype/CargoWagon cargo-wagon
- Prototype/FluidWagon fluid-wagon
- Prototype/Locomotive locomotive
- Prototype/SpiderVehicle spider-vehicle
Mandatory properties
This prototype inherits all the properties from Prototype/EntityWithOwner.
weight
Type: double
Must be positive.
Weight of the entity used for physics calculation when car hits something.
braking_power or braking_force
Type: Energy or double
Two different ways to set braking force. At least one must exist. Must be positive.
friction or friction_force
Type: double
Two different ways to set friction force. At least one must exist. Must be positive.
energy_per_hit_point
Type: double
The (movement) energy used per hit point (1 hit point = 1 health damage) taken and dealt for this vehicle during collisions. The smaller the number, the more damage this vehicle and the rammed entity take during collisions: damage = energy / energy_per_hit_point
.
Optional properties
terrain_friction_modifier
Type: float
Default: 1
Must be in the [0, 1] interval.
sound_minimum_speed
Type: double
Default: 1 / 60.0
Must be positive. Sound is scaled by speed.
sound_scaling_ratio
Type: double
Default: 1.0
Must be positive. Sound is scaled by speed.
stop_trigger_speed
Type: double
Default: 0.0
crash_trigger
Type: TriggerEffect
stop_trigger
Type: TriggerEffect
equipment_grid
Type: string
The name of the equipment grid this vehicle has.
minimap_representation
Type: Sprite
The sprite that represents this vehicle on the map/minimap.
selected_minimap_representation
Type: Sprite
The sprite that represents this vehicle on the map/minimap when it is selected.
allow_passengers
Type: bool
Default: true
Determines whether this vehicle accepts passengers. This includes both drivers and gunners, if applicable.