Ok, I think I got the overtime bug on Payload fixed. I don't have acces to my computer, so you might want to see if it works and let me know. What is this about… So when the timer runs out and BLU is still on the cart, the game goes to over time. When they leave the cart there should be a 5 seconds timer and if that timer runs out the game ends. When BLU touches the cart again that timer gets reset to 5 seconds again.
in src/game/shared/teamplay_round_timer.h
add float m_flExtraOverTime; at the end of class declaration
DECLARE_DATADESC();
bool m_bPauseDueToWin;
bool m_bResetTimeOnRoundStart;
int m_nTimeToUseAfterSetupFinished;
// overtime fix
float m_flExtraOverTime;
// !!===
#endif
};
in src/game/shared/teamplay_round_timer.cpp find the method void CTeamRoundTimer::RoundTimerThink( void )
Go to if (flTime InOvertime() )
{
TeamplayRoundBasedRules()->SetOvertime( true );
}
#if defined( TF_DLL ) || defined( TF_CLASSIC )
else
{
if ( tf_overtime_nag.GetBool() && ( gpGlobals->curtime > m_flNextOvertimeNag ) )
{
m_flNextOvertimeNag = gpGlobals->curtime + 1.0f;
if ( RandomInt( 0, 1 ) > 0 )
{
IGameEvent *event = gameeventmanager->CreateEvent( "overtime_nag" );
if ( event )
{
gameeventmanager->FireEvent( event );
}
}
}
}
#endif
}
SetContextThink( &CTeamRoundTimer::RoundTimerThink, gpGlobals->curtime + 0.05, ROUND_TIMER_THINK );
return;
}
else
{
if (gpGlobals->mapname[0] == 'p' && gpGlobals->mapname[1] == 'l')
{
if (gpGlobals->curtime > m_flExtraOverTime)
{
return;
}
}
}
m_OnFinished.FireOutput( this, this );
m_bFireFinished = false;
instead of checking for map name we should set a flag telling it that it's payload mode when the map loads, but this will work too.
As for the progress bar, I think I have an Idea better than ASCII bar. See, the GUI works like in normal CP game, you don't see the point being captured, because it's cap point is set to some 999999 and so you standing on it doesn't move the capture process by even 1%, when the cart reaches a check point the game just puts 100% capped at this point. I think it's possible to just send packets to the client with the fake CP capture %
Calculating the process isn't that easy, I remember I had to grab all the way points, calculate the distance between them, you have to keep track of how much the cart has been pushed (and take care of lowering that value when the cart goes backwards)