Repository navigation
Throw Back Grenade
🇬🇧 English · 🇩🇪 Deutsche Version
Source:
…/ArmaReforgerWorkbench/addons/Throw Back Grenade· prefixTBG_· Enfusion / Enforce Script. Verified againstScripts/Game/TBG_*.c,Configs/System/*.conf,Prefabs/Weapons/Grenades/*.et.
Throw Back Grenade lets a player pick up a live, already‑thrown grenade and immediately throw it back (or somewhere else) before it goes off. It works for frag grenades and smoke grenades.
- A "Pick Up and Throw Grenade" world action appears on a live grenade lying on the ground.
- On pickup the grenade is put into the character's hand, a dummy inventory copy is spawned into the throwable slot and auto‑equipped, and the player throws it with the normal throw input.
- The carried grenade follows the dummy's throw arc via a hidden "flight proxy" so the real (still‑ticking) grenade lands where you aimed, then detonates / smokes on its own timer.
- If the grenade expires while still in your hand (smoke runs out, it explodes), the dummy is removed from your inventory automatically.
| Prefab | Type |
|---|---|
Grenade_M67.et |
Frag (US) |
Grenade_RGD5.et |
Frag (USSR) |
Smoke_ANM8HC.et |
Smoke (HC white) |
Smoke_RDG2.et |
Smoke (USSR) |
Smoke_M18_Base.et |
Smoke (M18, colored) |
Any grenade prefab gets support by adding two components (see §5).
- An enemy (or friendly) grenade lands near you and is still live.
- Look at it — the "Pick Up and Throw Grenade" action shows (only if a normal "Pick Up" action is not available for that item and the grenade is not already attached to a character).
- Perform the action. The grenade goes into your hand and is auto‑selected in the throwable slot.
-
Throw it with your normal grenade throw input, or with
Ctrl+X(TBG_Throw, default). Aim first — the live grenade follows where the throw lands. - If you instead switch to another quick‑slot weapon while holding it, the grenade is dropped at your feet (it does not vanish).
Category TBG in Settings → Keybindings.
| Action | Default | Context | Note |
|---|---|---|---|
TBG_Throw ("Throw Granade") |
Ctrl + X (KC_LCONTROL + KC_X) |
TBG_Action (priority 100) |
Throw the currently carried grenade. The normal grenade‑throw input also works. |
The pickup itself is a world action ("Pick Up and Throw Grenade"), not a keybind — use your normal interact key.
None. There is no in‑game settings menu for TBG.
No dedicated config file. Configs/Editor/TBG_DebugMode.conf (TBG_DebugConfig) only gates debug logging (TBG_DebugConfig.Log(...)). Tunable constants live in the scripts:
| Constant | File | Default | Meaning |
|---|---|---|---|
DETACH_MAX_RETRIES |
TBG_CarryingComponent.c |
3 |
Retries to find the carried grenade child on remote clients before giving up |
DETACH_RETRY_DELAY_MS |
TBG_CarryingComponent.c |
200 |
Delay between those retries |
RETRY_MAX / RETRY_DELAY_MS
|
TBG_PickUpGrenadeAction.c |
10 / 50 ms
|
Wait for the dummy grenade to replicate after spawn |
TBG_EQUIP_MAX_RETRIES / TBG_EQUIP_RETRY_DELAY_MS
|
TBG_PlayerController.c |
10 / 100 ms
|
Wait for the grenade to replicate before equip/throw on the owner client |
| landing delta check | TBG_CarryingComponent.c |
500 ms after throw, delta < 0.05
|
Detects that the thrown grenade has come to rest |
The only server‑side requirement is that the grenade prefabs carry the TBG components (see §5) and that TBG_CarryingComponent is on the character prefab (Prefabs/Characters/Core/Character_Base.et in this repo).
On the grenade prefab:
- Add
TBG_ThrowBackComponent(holds theETBGGrenadeStatestate machine). - On its
ActionsManagerComponent → Additional Actions, addTBG_PickUpGrenadeActionwithParentContextList = { "default" }. Configure its UIInfo name so the action appears.
On the character prefab: add TBG_CarryingComponent.
The modded SCR_PlayerController (TBG_PlayerController.c) and SCR_WeaponSwitchingBaseUI (TBG_WeaponSwitchingUI.c) are applied automatically by the mod.
Character Entity
└── TBG_CarryingComponent — tracks carried grenade, dummy-follow loop, all RPCs
Grenade Entity (prefab)
├── TBG_ThrowBackComponent — ETBGGrenadeState: IDLE, THROWN, CARRIED, ACTIVATED
└── TBG_PickUpGrenadeAction — pickup action + dummy spawn callback
SCR_PlayerController (modded) — TBG_EquipAndThrow on the owner client
SCR_WeaponSwitchingBaseUI (modded) — detects slot switch → drop
Owner Client → RpcServer_TBG_* → Server → RpcBroadcast_TBG_* → Remote Clients
The server is a pure relay — it never sets member variables, only forwards RPCs. All gameplay logic runs on the owning client (_Client methods). Remote clients mirror state from broadcast RPCs. PerformAction runs on every machine (so remote clients get CARRIED state + the grenade in the character hierarchy for tracking); inventory operations (slot clear, dummy spawn) are server‑only.
- Wait until the dummy grenade leaves the character hierarchy (= thrown).
- First frame after throw → create a flight proxy, attach the carried grenade to it.
- Every tick: proxy position = dummy position (follows the throw arc).
- 500 ms after throw detection → arm the delta check.
- Delta
< 0.05→ grenade landed → pin it to the landing position, delete the dummy. The flight proxy is kept as a landing anchor (RemoveChild(false)does not preserve world position, and the inventory system would otherwise snap the grenade back to the character).
- The flight proxy must stay alive after landing — never delete or
RemoveChildit. -
ConfirmLandingPosfires 500 ms after the swap on remote clients to re‑pin the position (something overwrites it after the first set). -
SetDummyGrenaderuns on the server (fromTBG_PickupSpawnCallback.OnComplete) so the inventory parent change is visible server‑side. -
TBG_EquipAndThrowroutes via RPC to the owning client —SelectWeapon/SetThrowmust run on the owner, not the server.
| File | Purpose |
|---|---|
Scripts/Game/TBG_ThrowBackComponent.c |
State enum + state component on the grenade |
Scripts/Game/TBG_CarryingComponent.c |
Main logic: carrying, dummy‑follow, RPCs (~32 KB) |
Scripts/Game/TBG_PickUpGrenadeAction.c |
Pickup action + spawn callback |
Scripts/Game/TBG_PlayerController.c |
Modded PlayerController: equip & throw, slot‑switch drop |
Scripts/Game/TBG_WeaponSwitchingUI.c |
Modded switching UI: slot‑change detection |
Scripts/Game/TBG_DebugConfig.c |
Debug logging gate |
TBG_ classes/files · ETBG_ enums · members: m_p pointer/entity, m_b bool, m_v vector, m_i int · _Client = owning‑client logic · _Server = server relay · RpcServer_TBG_ = owner→server · RpcBroadcast_TBG_ = server→all.
- Pickup is blocked while a normal engine "Pick Up" action is available for the item, and while the grenade is already parented to a character.
- Switching quick‑slots while carrying always drops the grenade (by design — you can't stow a live grenade).
- Multiplayer edge cases are handled with retry loops (replication lag) rather than hard guarantees; see the retry constants in §4.
SkyKing Mod Docs · EN (Page) / DE (Page-DE) · Keep both languages in sync with the source repos (SkyMap-X-DEV, SpeedUI, SIDC-Framework, Throw Back Grenade) and the companion tools (ATAKmaps, SIDC---C2---Command-Control).
🇬🇧 English
General
SkyMap-X (SMX)
- Overview & Usage
- Workflows (step by step)
- Camera functions (Fnc1/Fnc2, NV)
- Drones (WIP)
- SecondMap Bridge (map provider)
- Chat API (for mods)
- Screen Mirror & Tablet ID (WIP)
SpeedUI (SUI)
SIDC-Framework (SIDC)
Throw Back Grenade (TBG)
Companion tools
🇩🇪 Deutsch
Allgemein
SkyMap-X (SMX)
- Überblick & Bedienung
- Abläufe (Schritt für Schritt)
- Kamera-Funktionen (Fnc1/Fnc2, NV)
- Drohnen (in Arbeit)
- SecondMap-Bridge (Kartenanbieter)
- Chat-API (für Mods)
- Bildschirm-Spiegelung & Tablet-ID (in Arbeit)
SpeedUI (SUI)
SIDC-Framework (SIDC)
Throw Back Grenade (TBG)
Begleit-Tools