On this page
Heroes: the item bar's widgets
A widget is a one-key item on the hero's item bar: a tonic, a rocket jump, a pocket jeep, a cake to throw. In the engine it is a fire arm with an ability ammo component, like an ability; what differs is the item its enable makes. This page follows a widget's key and lists each widget with the numbers of its own template.
The numbers are each widget's own template (the weapon archive of a 1.126 install), not the menu file's, which differs for most widgets. A verdict SAME means the original's function was read in the listing against ours' statements; DIFFERS is a filed difference; partly read says what was read. The sweep is of 2026-11-27 with its state of 2026-11-28 (behind its round 27): 30 widget rows and 3 rows every widget shares. Where a row below says "a test is written, not built", no run of that test exists yet: the difference rests on the reading alone.
What a key does#
- The key is the weapon-select control plus the slot's number. In Heroes the client's own key selects nothing: the server selects, and the choice comes back in the control block (the control block).
- The use tests decide whether the item may be selected: the fire arm's selectable test (
BFHeroes.exe@bfh126!0x0070d6a7) and the ability ammo's (0x00773468). - The enable (
AbilityAmmoComp::enable0x007728de) makes the widget's item from the template'sability.add...Itemline: a heal, a speed factor, a shield, a push, a vehicle. - The item runs for
ammo.timeToStayActive, then the wait ofammo.usageIntervalstarts. Some widgets keep their wait through a death: the kit drop keeps the items' wait fraction (0x00724a52), SAME in ours.
The use tests#
A template switches tests on with its own lines:
| Template line | The key is refused |
|---|---|
disableInsideVehicle 1 | in a seat |
disableOutsideVehicle 1 | on foot |
disableInAllVehiclePositions 1 | in any seat, a passenger's too |
disableWhileOffGround 1 | in the air |
no allowInWater / allowInSkyDive / allowInParachute | swimming / sky diving / under a parachute |
ammo.vehicleRestriction, or the item's vehicle type | in a vehicle of another type |
| while the wait runs | always |
The item bar crosses a slot out by tests of the same kind, on the client.
The vehicle type rule#
Four widgets work only in one kind of vehicle. The type is the first value of the item's line:
| Widget | Template line | Works in |
|---|---|---|
| Jeep Jump | addVehicleJumpIem VTScoutCar 600 45 15 99000 3 | a jeep |
| Ramming Jeep | addVehicleRammingIem VTScoutCar 100 5 1.5 0.5 99000 2 | a jeep |
| Plane Rocket Barrage Prototype | addVehicleRestrictionItem VTFighter | a plane |
| Tank Shield Prototype | addShield VTLightTank 60 -1 15 0 6 | a tank |
The test is a block of the ability ammo's selectable test (0x007734cd to 0x007735a5). The port's server did not have it: Jeep Jump's key worked at a tank's wheel. MENDED on the server, replayed (the vehicle replay twelve of twelve identical) and played in a Heroes game by a scenario (bfh_widget_vehicle_type).
Pocket vehicles#
addVehicleSpawnItem ger_jeep_kubelwagen bri_jeep_willys VTScoutCar 10 2 0.7 60 3 (and the tank's and the helicopter's lines): the widget puts a vehicle of the hero's team in front of him; wait 12 s; not from a seat, not off the ground. A hero has one pocket vehicle at a time.
| What | The original, as read | The port | State |
|---|---|---|---|
| the order at a second call | the new vehicle is made first, then the earlier one is destroyed (0x007375a8) | the same since the mend | MENDED on the server: when the new vehicle cannot be made the hero keeps the earlier one. Its test was red on the tree before, one mutation was caught, and the vehicle replay stayed identical (twelve of twelve). Its play shows a blocked place alone, on both sides of the mend. |
| another player near | the key is refused while any other living player stands within 5 m of the hero, a team mate too (0x0069985d) | the other team's players alone are counted | DIFFERS, not in the tree: the mend is a proven patch (red before, green behind, one mutation caught) that waits for the owner's word |
| the earlier vehicle's end | its occupants are put out and it takes its damage in the caller's name (0x0069a16d), so its blast is his: an enemy hurt by it is his damage and his kill, a team mate killed by it his team kill | the damage is in nobody's name, and such a death has no killer | DIFFERS (read to its end on 2026-11-28); a test is written, not built; not ported |
Blasts#
Every exploding widget goes through the explosion (0x0072a930), its two predicates (0x007280ff, 0x00728183), the splash hit (0x0072a3b0) and the fall-off (0x007281aa).
- The blast asks every object with an armor or a detonation component.
- The fall-off is full inside
radius x hotSpotRadiusPercent(0.2 without a line) and falls in a straight line to 0 at the radius: SAME (bfh_game::explosion::falloff). - DIFFERS, not mended: the cover ray is stopped by thrown things in ours and passes them in the original; and a vehicle keeps the cover test in a stomp or gravity weapon's blast in ours.
- The explosion and the two predicates were read whole; the splash hit itself was read in part.
The widgets#
Seconds are the template's. "Active" is ammo.timeToStayActive, "wait" is ammo.usageInterval.
| Widget | What its template says | Verdict of the sweep |
|---|---|---|
| Terrific Health Tonic | heals 50; wait 20 s; not in a vehicle; in water too; the wait is kept through a death | read whole (0x00738487, 0x0052c3ed, 0x00828174) |
| Bandage (every class, five tiers) | 6 / 7 / 8 / 9 / 12 % of the maximum every 1.5 s for 12 s; wait 3 s; ends on damage; allowInWater 1 | read; a Bandage that cures a burn or a poison heals nothing in that update |
| Wrench (five tiers) | repairs 3 to 10 % of the vehicle's armour every second for 6 s; wait 15 to 10 s; only in a vehicle | read: from any seat, the root of what he sits in is repaired |
| Sarge's Rocket and the other rocket fuels, Metallo's Rocket Jump | addRocketPackItem 1.0 1.1 100 0.05 -1.0 1.0 4.0 7.0; active 2 s; wait 30 s | SAME as read; ours gives up after 64 blocked directions where the original tries on: no player's difference found |
| Captain Royal's Speed Boost | factor 1.2 / 1.4 / 1.4 by class for 5 s; wait 15 s; not in a vehicle | the attach and the end SAME; how the factor enters the speed is the filed difference |
| Jeep Jump, Ramming Jeep | active 4 s / 2 s; wait 5 s; a jeep only | the vehicle type rule MENDED |
| Plane Rocket Barrage Prototype | rockets of damage 7, radius 9; active 4 s; wait 5 s; a plane only | the vehicle type rule MENDED |
| Plane Stealth Prototype | wait 13 s; a plane only | DIFFERS for a passenger: ours refuses him, the original passes him |
| Tank Shield Prototype | a shield of 60 for 15 s; wait 8 s; a tank only | the vehicle type rule MENDED; the attach read in its first half |
| Pocket Jeep, Tank, Copter | above | above |
| Overcharge | locks the movement, the weapon bar and the vehicle access for 3.5 s; a blast of damage 50, radius 8; wait 16 s | the three locks' readers found and read whole (0x00723bdd, 0x0072394d, 0x007239d1) |
| Teleport | a device to throw; the hero is put at it after a delay | read whole; DIFFERS for a hero in a passenger's open seat when the delay ends: the original moves the whole vehicle, ours does nothing |
| Festive Firework | radius 10, force 20, no damage; wait 3 s | its push is the blasts' row |
| Festive Flare | a flare that lives 15 s; wait 15 s | read: a hero has at most two flares in the world; the third removes his oldest |
| Sarge's Fun-Time Football | lives 120 s; wait 120 s | read: the ball can be kicked from 1 s after it is thrown |
| the claws, the punches, the chair smacks | a short blast of damage 25 (8 for the punches), radius 4 | partly read: the use test read, the melee hit not |
| the fire bombs and the surprise parcels | damage 80, radius 6, force 12 after 3 s (5 s for one team's) | the damage over time's start and update SAME |
| Festive Egg | a trap: damage 30, radius 12, then poison 5 every 1.5 s for 12 s; wait 23 s | the blast's row; the trigger not read |
| the Detonating Brew | damage 40, radius 10, then fire 5 every 1.5 s for 6 s; wait 45 s | the blast's row |
| the thrown blades | damage 15 at every distance; wait 3 s; ends a stealth | the hit's damage block read |
| the anniversary cakes | damage 30, radius 2, armed after 0.7 s; wait 3 s | DIFFERS: the thrown thing's tumble (fire.randomRotationalSpeed) is missing in ours |
| Amassing Force | a burst of radius 20 that takes the force's gravity branch in place of the push | the gravity branch of the force read (0x00728c03) |
The filed differences, most used first#
- The widget bar's crossed slots: mended for water, sky dive, parachute and the seat (the HUD).
- The vehicle type rule: mended on the server, replayed and played; the client's prediction of the key is mended too, on tests, not yet played on a page.
- The pocket vehicles' order when the new vehicle cannot be made: mended on the server, with its test and the replay.
- The pocket vehicles' key with another player within 5 m: a proven patch, not in the tree; waits for the owner's word.
- The Teleport from a passenger's open seat: not mended.
- Blasts and thrown things in the cover ray: the mend is written with a rig of six rows; not in the tree.
- The tumble of cakes and class grenades: not mended.
- The Plane Stealth for a passenger: not mended.
Found since, as the sweep has them on 2026-11-28#
Each of these is a reading laid beside the port's code. Where it says "a test is written, not built", the test has not run: nothing is proven red yet.
| What | The original, as read | The port | State |
|---|---|---|---|
| who is charged for the earlier pocket vehicle's blast | the hero who called the new one (0x0069a16d, 0x0052e974) | nobody | a test is written, not built; not ported |
| a hero who ducks in a tank seat that allows it | takes no share of any blast (0x007283c7) and is hidden a quarter second later; his widget keys are refused | the duck counts for the fire test alone: a blast beside the tank hurts him | a test is written, not built; a mend makes the ducked hero stronger: the owner's line; not ported |
| the force on an armor that refuses force (the hill's rocket alone) | left alone in every branch (0x00728c03) | asked for a gravity weapon alone: another blast pushes it | a test is written, not built; not ported |
| a hero behind a thing the same blast destroys | takes half of each blocked sample's weight (0x007286d1) | takes none | a test is written, not built; a mend makes a blast hurt more: the owner's line; not ported |
| the wait before a heat of team elimination | the weapon bar is locked for every hero: no weapon change, no widget key, no seat (0x0072394d, 0x00506bb4) | the lock asks the hero's abilities alone | a test is written, not built; not ported |
| two movement items of one hero (Leg It and the Speed Boost) | the one that ends first leaves the hero at plain speed for the rest of the other (0x00737bbf) | the newest item that is left counts | a test is written, not built; a mend makes him slower: the owner's line; not ported |
| a widget's key on a ladder and in a duck | refused | the use test asks neither | DIFFERS as read; what becomes of the widget in the port was not read; no test |
| the Rocket Fuels and the Rocket Jump | tries on past 64 blocked directions | gives up after 64 | no difference for a player found |
In a player's words#
Three things every widget shares, as the widget sweep's notes tell them. The feature checklists take these sentences from here.
| Feature | For a player |
|---|---|
| The blasts | Every exploding widget hurts and pushes what stands within its radius: at full strength inside its hot spot, falling off to nothing at the edge. Something in the way between the burst and a thing halves the blast or stops it, except for a strike's, a keg's or a gravity charge's burst, which goes through cover |
| The widget bar | The row of slots at the bottom of the screen, one for each widget: its icon, how many are left, the wait filling up again with a sound and five blinks when the widget is ready, a bar while it runs, and a cross over the slot wherever its key will not work |
| When a widget's key works | Pressing a widget's key does something only where the widget allows it: a vehicle widget not on foot and not for the driver of another kind of vehicle, a widget that forbids seats not in a seat, some not off the ground, in water or under a parachute only when the widget says so, and none before its wait is over |
The widgets' checklists#
Each of these has a checklist in the feature ledger: every step of the original's code behind it and every situation it must work in. None is called done until every line is checked.
| Feature | Checked | What it does | What you see |
|---|---|---|---|
| 4th Anniversary Cake | 54 of 680 lines checked | 2 of 19 | 0 of 19 |
| Bandage, tiers Crude to Splendid | 25 of 274 lines checked | 1 of 19 | 0 of 19 |
| Brass-Bender's / Destroyer Drone's Overcharge | 13 of 103 lines checked | 1 of 20 | 0 of 20 |
| Bruce's Bash / Sly's Sucker-Punch | 7 of 74 lines checked | 1 of 19 | no such lines |
| Captain Royal's Speed Boost | 4 of 64 lines checked | 1 of 19 | 0 of 19 |
| Festive Firework | 6 of 74 lines checked | 0 of 19 | no such lines |
| Festive Flare | 3 of 108 lines checked | 1 of 19 | 0 of 19 |
| Frost's / Bane's Amassing Force | 17 of 142 lines checked | 0 of 19 | 0 of 19 |
| Jeep Jump | 16 of 109 lines checked | 1 of 19 | 0 of 19 |
| Plane Rocket Barrage Prototype | 3 of 60 lines checked | 1 of 19 | no such lines |
| Plane Stealth Prototype | 21 of 221 lines checked | 0 of 20 | 0 of 20 |
| Pocket Copter | 19 of 163 lines checked | 6 of 19 | 0 of 19 |
| Pocket Jeep | 12 of 122 lines checked | 1 of 19 | 0 of 19 |
| Pocket Tank | 12 of 122 lines checked | 1 of 19 | 0 of 19 |
| Ramming Jeep | 15 of 150 lines checked | 1 of 20 | 0 of 20 |
| Royal / National Chair Smack | 7 of 74 lines checked | 1 of 19 | no such lines |
| Sarge's Fun-Time Football | 24 of 215 lines checked | 0 of 19 | 0 of 19 |
| Sarge's Rocket Fuel / Turbojet Fuel, Titan / CEC Thruster Fuel | 5 of 53 lines checked | 1 of 19 | 0 of 19 |
| Tank Shield Prototype | 28 of 293 lines checked | 1 of 19 | 0 of 19 |
| Teleport | 9 of 139 lines checked | 1 of 19 | 0 of 19 |
| Terrific Health Tonic | 15 of 181 lines checked | 1 of 19 | 0 of 19 |
| The blasts (Claw Attack, Firework, Bash / Sucker-Punch, Firebomb / Super Bomb, Surprise, Egg, Brew, Chair Smack) | 43 of 528 lines checked | 0 of 20 | 0 of 20 |
| The widget bar (every widget's slot: icon, count, wait, crossed out) | 2 of 62 lines checked | no such lines | 0 of 19 |
| When a widget's key works (the use tests of every widget) | 6 of 109 lines checked | 0 of 19 | 0 of 19 |
| Wolf / Vampire Claw Attack | 7 of 74 lines checked | 1 of 19 | no such lines |
| Wrench, tiers Crude to Splendid | 14 of 260 lines checked | 0 of 19 | 0 of 19 |
How it is tested#
- The ability and widget engine (
crates/bfh-game/src/abilities/tests.rs, 77 tests): template values read from the game's own files, an effect that survives a death, an item that ends at its duration, effects that stay on the local player. - Blasts (
abilities/stomp.rs,explosion.rs): who is pushed and how far, friendlies taking no push, the hot spot of a Heroes explosion. - The item bar (
crates/bfh-client/src/hud.rs): the slots' fill, the reload sweep, the gates. - Played: each widget has scenarios; most assert state (hit points, trace lines) and read no screenshot, which the feature checklists count as "played by state only", not as a check.
By those checklists no widget is done today. The filed differences above have, where it says so, a test that is written and red, or written and not yet built.
In the code#
| What | Where |
|---|---|
| the items a widget makes | crates/bfh-game (abilities) |
| the use tests' template bytes | crates/bfh-data/src/templates.rs |
| the server's side | crates/bfh-server |
| the bar | crates/bfh-client/src/hud.rs (ItemBar, slot_no_use) |
Notes: notes/bfheroes/widget_sweep.md, notes/bfheroes/abilities_table.md. See also abilities, classes.
docs/dev/heroes/widgets.md · built from bf2-rs e3b4f05 · part of the Battlefield 2 / 2142 / Heroes reimplementation. Not affiliated with EA or DICE.