demo/bench harness polish: BT_SELF_DAMAGE_DELAY + two harness bug fixes + the OBS limp demo bat
- BT_SELF_DAMAGE_DELAY=<s>: hold the harness off for n seconds (capture demos: healthy walking first). Fixed its underflow bug (the countdown crossed below zero, which is also the "read the env" sentinel -- the delay re-armed forever). - The one-death latch was fed by EVERY mech's update: a mission that generated any destroyed mech entity tripped it at frame one and the harness silently never fired (random per mission roll). Now viewpoint-mech only. - run\limpdemo.cmd: the OBS capture demo -- 30 s healthy auto-walk, then the leg crosses half on the final damage tick: klaxon-klaxon-"reverse disabled" + the limp, then unlimited limp footage (waypoint 8000,8000). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
18766a167b
commit
5b19cd6c3f
@@ -5627,7 +5627,12 @@ void
|
||||
// shooting us. (Live damage knocks the power bus down, which is exactly
|
||||
// the signal a respawn test is trying to read.)
|
||||
static int s_sdSpent = 0;
|
||||
if (IsMechDestroyed())
|
||||
// Latch off at the VIEWPOINT mech's first death only. (The latch used
|
||||
// to be fed by EVERY mech's update -- a mission that generated any
|
||||
// destroyed mech/wreck entity tripped it at frame one and the harness
|
||||
// silently never fired; random per mission roll.)
|
||||
if ((Entity *)this == application->GetViewpointEntity()
|
||||
&& IsMechDestroyed())
|
||||
s_sdSpent = 1;
|
||||
if ((Entity *)this == application->GetViewpointEntity()
|
||||
&& getenv("BT_SELF_DAMAGE") && !s_sdSpent
|
||||
@@ -5635,6 +5640,20 @@ void
|
||||
{
|
||||
static float s_sdAccum = 0.0f;
|
||||
static int s_sdTicks = 0;
|
||||
// BT_SELF_DAMAGE_DELAY=<s>: hold the harness off for the first n
|
||||
// seconds of the mission (capture/demo: healthy walking first).
|
||||
static float s_sdDelay = -1.0f;
|
||||
if (s_sdDelay < 0.0f)
|
||||
{
|
||||
const char *de = getenv("BT_SELF_DAMAGE_DELAY");
|
||||
s_sdDelay = (de != 0 && *de != '\0') ? (float)atof(de) : 0.0f;
|
||||
}
|
||||
if (s_sdDelay > 0.0f)
|
||||
{
|
||||
s_sdDelay -= dt;
|
||||
if (s_sdDelay < 0.0f) s_sdDelay = 0.0f; // NOT below: <0 is the
|
||||
s_sdAccum = 0.0f; // "read the env" sentinel --
|
||||
} // underflow re-armed the delay forever
|
||||
// BT_SELF_DAMAGE_TICKS=<n>: stop after n hits (bench: ramp a leg
|
||||
// PAST LegHalfStructure then hold, so the limp window is unbounded
|
||||
// instead of the 1 s between half and destroyed at high dps).
|
||||
|
||||
Reference in New Issue
Block a user