Features
Battery and signal
How the phone battery drains and charges, and how signal bars are worked out.
The phone has a battery that drains while it is used and a signal that depends on where the player stands. Both are on by default. This page explains how they behave, how a player charges the phone, and what each option in Config.Battery and Config.Signal changes.
#Battery
#How it drains
The battery is kept on the player's own machine, per phone number, and survives a reconnect. It goes down by a share of a percent every minute:
| Situation | Option | Default | About |
|---|---|---|---|
| Phone put away | IdlePerMinute |
0.035 |
2 % an hour |
| Phone open | OpenPerMinute |
0.2 |
12 % an hour |
| Camera, video call, live stream, Snap, Klip | HeavyPerMinute |
0.45 |
27 % an hour |
| In a call (added on top) | CallPerMinute |
0.15 |
9 % an hour |
A battery case from the Cases store slows the drain to BatteryCaseDrain (default 0.7, so 30 % slower).
At 20 % and 10 % (WarnAt) the Dynamic Island shows a low battery warning and the battery icon turns red. At 0 % the phone switches off: it closes, cannot be opened, and a call in progress ends. It switches back on by itself once it has charged to WakeAt percent (default 3).
#How it charges
While charging, the battery fills by ChargePerMinute percent a minute (default 4.0, empty to full in about 25 minutes). The phone charges when any of these is true:
| Way | Option | Default | Notes |
|---|---|---|---|
| In a vehicle | ChargeInVehicles |
true |
Any seat, as long as the engine is running. A vehicle with the engine off does not charge. |
| At a phone shop | ChargeAtShops |
true |
Within 8 metres of a shop in Config.PhoneShop.Shops. This is the way for a player without a vehicle. |
| At a charging spot | Chargers |
{} |
Your own list: { coords = vector3(x, y, z), radius = 2.0 }. Use it for homes, cafés, offices, stations. |
| With a power bank | PowerBankItem |
'powerbank' |
Using the item charges for PowerBankMinutes (default 20) wherever the player is. The item is used up. |
The phone looks for a charger every two seconds. When it finds one:
- the battery icon in the status bar turns green with a bolt and pulses,
- the Dynamic Island shows "Charging" with the level for a moment,
- the lock screen shows a green battery with the level under the clock for as long as it charges,
- if the phone is put away or switched off and the battery is at 20 % or less, the player gets a normal game notification, because nothing on screen would tell them otherwise.
#The power bank item
The power bank is an inventory item you add yourself; see Item setup for the item block and the picture (setup/items/powerbank.png). fx-phone does not sell it: put it in any shop of yours. Set PowerBankItem = nil if you do not want power banks.
#Options
| Option | Default | What it changes |
|---|---|---|
Enabled |
true |
false: the phone is always at 100 % and never switches off. |
IdlePerMinute, OpenPerMinute, HeavyPerMinute, CallPerMinute |
see above | Drain per minute. |
BatteryCaseDrain |
0.7 |
Share of the normal drain with a battery case on. |
ChargePerMinute |
4.0 |
Charge per minute, the same for every way of charging. |
ChargeInVehicles |
true |
Charging in a vehicle with the engine running. |
ChargeAtShops |
true |
Charging at phone shops. |
WarnAt |
{ 20, 10 } |
Levels that show the low battery warning. |
WakeAt |
3 |
Level a switched-off phone comes back on at. |
Chargers |
{} |
Your own charging spots. |
PowerBankItem |
'powerbank' |
Item name of the power bank; nil for none. |
PowerBankMinutes |
20 |
How long one power bank charges. |
Settings > Display > Battery Percentage lets each player show or hide the number inside the battery icon.
Exports for other resources (read the level, set it, ask whether it is charging) are in Client exports: battery.
#Good to know
- "It does not charge in my car": the engine has to be running. Check the status bar: a green battery with a bolt means it is charging.
- A switched-off phone needs to reach
WakeAtfirst. At the default rate that is under a minute. - The level is saved on the player's machine, so it is per player and per phone number, not per character slot on the server.
#Signal
The signal bars show how far the player is from the nearest tower in Config.Signal.Towers.
Ranges(default{ 1400, 2100, 2800, 3600 }): the distance in metres at which the phone drops to 3, 2, 1 and 0 bars.- Indoors the phone loses one bar. Indoors and below
UndergroundZ(default15.0) it has at most one bar. - Below
DeepZ(default-20.0) and under water there is no signal. - Airplane mode gives no signal.
With BlockCalls = true (default) a call needs at least one bar on both phones. Enabled = false gives every phone full signal everywhere.
Add a tower with { x = ..., y = ... } in Towers; the default list covers the city, the highways and the main towns of the map.