Death = the burning WRECK-HULK swap (effect 104) -- the authentic chain, reconstructed

The user was right: a dead mech turns into a pile of wreckage.  The authentic
1995 chain, recovered end-to-end:

  kill -> the victim's per-mech DEATH ModelList ('blhdead'/'lokdead'/'owndead'/
  'thrdead', .RES ids 22-25) -> its authored effects: 104 (the WRECK script) +
  1007 (dnboom big explosion) + 1001 (ddthsmk rubble smoke plume) + a damage-
  smoke burst (3/4/5/15).

Effect 104 = ExplosionScripts case 4 (part_008.c:2663, LIVE in the 1996 binary;
the "disabled" warning is case 6): loads the destroyed hulk + flamesml/flamebig
flame meshes with sweep flicker.  Every mech ships its hulk (BLHDBR/MADDBR/
LOKDBR/... + GENDBR generic); the 1996 script hardcoded thrdbr.bgf (dev
shortcut) -- we use the victim's own.

Reconstructed as BTL4VideoRenderer::SwapToWreck: hide every segment mesh, hang
"<prefix>dbr.bgf" on the tree root (pending-swap if death precedes tree build);
routed from the engine's ExplosionClassID dispatch (effect 104 ->
BTSwapMechToWreck(explosion->GetEntityHit())).  The kill now fires the
authentic 'blhdead' resource (manual 7+1 pfx calls removed -- the list carries
1007/1001 itself).  Verified live:
  [death] firing authentic death list 'blhdead' id=22
     ** effect_number = 104
  [BTrender] wreck swap: victim -> 'blhdbr.bgf'

Follow-ups noted: mesh flames + hulk settle (cosmetic), DeathSplash.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-08 15:43:08 -05:00
co-authored by Claude Fable 5
parent b44c0f98f6
commit c0fa6bf21a
9 changed files with 302 additions and 29 deletions
+20 -6
View File
@@ -15,6 +15,7 @@
#include "..\munga\mission.h"
#include "..\munga\cultural.h"
#include "..\munga\nttmgr.h"
#include "..\munga\explode.h" // Explosion::GetEntityHit (the effect-104 wreck swap)
#include "..\munga\app.h"
#include "l4particles.h"
#include "DXUtils.h"
@@ -6436,13 +6437,26 @@ void
{
DEBUG_STREAM << " ** ExplosionScripts(*entity*, RES["
<< model_resource->resourceID << " - " << model_resource->resourceName << "], "
<< "ViewFrom::" << (view_type == ViewFrom::insideEntity ? "insideEntity" : (view_type == ViewFrom::outsideEntity ? "outsideEntity" : "collisionEntity"))
<< "ViewFrom::" << (view_type == ViewFrom::insideEntity ? "insideEntity" : (view_type == ViewFrom::outsideEntity ? "outsideEntity" : "collisionEntity"))
<< ", " << (effect_number - 100) << ");" << std::endl << std::flush;
ExplosionScripts(
entity, // The entity we are dealing with
model_resource, // Pointer to the video resource
view_type, // Type of reference (inside/outside...etc.)
effect_number - 100);
//
// Effect 104 = the death-WRECK script (1996 ExplosionScripts
// case 4: swap the victim to its <mech>dbr burning hulk),
// dispatched by the per-mech death ModelLists ('blhdead'...).
// RECONSTRUCTED in the BT renderer (SwapToWreck); the other
// script numbers remain stubbed with the rest of the layer.
//
if (effect_number == 104)
{
extern void BTSwapMechToWreck(Entity *victim);
BTSwapMechToWreck(((Explosion *)entity)->GetEntityHit());
}
else
ExplosionScripts(
entity, // The entity we are dealing with
model_resource, // Pointer to the video resource
view_type, // Type of reference (inside/outside...etc.)
effect_number - 100);
}
}
break;