Car Battery

From PZwiki
Revision as of 04:13, 8 January 2024 by Calvy (talk | contribs) (→‎Code: Codebox Update)
Car Battery
Car Battery
General
Category Item
Encumbrance
Heavy Load
5.0
Function Start engine
Power accessories
Required tool Screwdriver
Capacity 100,000 units
Contents Electricity
Technical details
item ID Item IDs
Recharges while the engine is running. Drained by starting the engine, by active lights, siren, and radio.
— In-game description
PlushSpiffo.pngThis article is about batteries required to power vehicles. For batteries that power small appliances, see Battery.

A car battery is a drainable item forming an integral part of a vehicle. It is used to start the engine, as well as run electrical components of the vehicle when the engine is off.

Usage

A car battery can only be used in powering a vehicle and not other household electricals.

The car battery is installed underneath the hood and does not require any mechanics level or known recipe to install or uninstall, however it does require the player to have a screwdriver.

A charged car battery is needed to start the engine, therefore having a low or dead car battery will fail to start the vehicle. It's also used to power electric accessories when the engine isn't on, such as the headlights, heater, radio and siren. Remember to turn these off when exiting a vehicle, or you could drain the battery and end up stranded.

Recharging

A car battery will automatically recharge while the engine is running. Otherwise, a flat car battery can be recharged by using a car battery charger, which requires the player to be standing on a powered tile, followed by simply right-clicking the car battery or charger and selecting "recharge".

Condition

The condition of a car battery is separate to the remaining power, although they can be easily mixed up. A car battery's condition determines its charge capacity and effectiveness at starting a vehicle engine. Lower condition batteries will hold less charge and fail to start the engine more often. A low condition battery will never explode or catch fire.

Distribution

Car batteries can very commonly be found under the hood of a vehicle, already installed. They can also be found inside gas stations, sheds, garages or mechanic shops. Car batteries can also be found in the trunks of Vehicles. These batteries are almost always at full condition.

Item IDs

Car batteries can be found as one of three different types, each corresponding to a vehicle type. Therefore, a car battery for one vehicle type cannot be swapped with another vehicle type. For example, it is not possible to install a sport class battery in a standard class vehicle.

Vehicle type Class name
Standard Base.CarBattery1
Heavy-Duty Base.CarBattery2
Sport Base.CarBattery3

Code

Code icon.png Code snippet! This section contains source code from Project ZomboidShow / Hide

Source: ProjectZomboid\media\scripts\vehicleitems.txt

Retrieved: Build 41.78.16
item CarBattery1
{
  DisplayCategory		= VehicleMaintenance,
  Weight				= 5,
  Type					= Drainable,
  UseDelta				= 0.00001,
  UseWhileEquipped		= FALSE,
  DisplayName			= Car Battery,
  Icon					= CarBattery,
  MetalValue			= 1,
  cantBeConsolided		= TRUE,
  VehicleType			= 1,
  ConditionMax			= 100,
  ChanceToSpawnDamaged	= 30,
  MechanicsItem			= TRUE,
  WorldStaticModel		= CarBattery,
  Tags					= CarBattery,
}

item CarBattery2
{
  DisplayCategory		= VehicleMaintenance,
  Weight				= 5,
  Type					= Drainable,
  UseDelta				= 0.00001,
  UseWhileEquipped		= FALSE,
  DisplayName			= Car Battery,
  Icon					= CarBattery,
  MetalValue			= 1,
  cantBeConsolided		= TRUE,
  VehicleType			= 2,
  ConditionMax			= 100,
  ChanceToSpawnDamaged	= 30,
  MechanicsItem			= TRUE,
  WorldStaticModel		= CarBattery,
  Tags					= CarBattery,
}

item CarBattery3
{
  DisplayCategory		= VehicleMaintenance,
  Weight				= 5,
  Type					= Drainable,
  UseDelta				= 0.00001,
  UseWhileEquipped		= FALSE,
  DisplayName			= Car Battery,
  Icon					= CarBattery,
  MetalValue			= 1,
  cantBeConsolided		= TRUE,
  VehicleType			= 3,
  ConditionMax			= 100,
  ChanceToSpawnDamaged	= 30,
  MechanicsItem			= TRUE,
  WorldStaticModel		= CarBattery,
  Tags					= CarBattery,
}


See also