Added OnEntrySequence and OnActionSequence for scripted_sequence

This commit is contained in:
Blixibon 2021-05-27 09:53:31 -05:00
parent 7a87bfdf5e
commit c48428b678
3 changed files with 22 additions and 0 deletions

View File

@ -3979,10 +3979,16 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
// If we have an entry, we have to play it first
if ( m_hCine->m_iszEntry != NULL_STRING )
{
#ifdef MAPBASE
m_hCine->OnEntrySequence( this );
#endif
m_hCine->StartSequence( (CAI_BaseNPC *)this, m_hCine->m_iszEntry, true );
}
else
{
#ifdef MAPBASE
m_hCine->OnActionSequence( this );
#endif
m_hCine->StartSequence( (CAI_BaseNPC *)this, m_hCine->m_iszPlay, true );
}

View File

@ -136,6 +136,8 @@ BEGIN_DATADESC( CAI_ScriptedSequence )
DEFINE_OUTPUT(m_OnScriptEvent[6], "OnScriptEvent07"),
DEFINE_OUTPUT(m_OnScriptEvent[7], "OnScriptEvent08"),
#ifdef MAPBASE
DEFINE_OUTPUT(m_OnEntrySequence, "OnEntrySequence"),
DEFINE_OUTPUT(m_OnActionSequence, "OnActionSequence"),
DEFINE_OUTPUT(m_OnPreIdleSequence, "OnPreIdleSequence"),
DEFINE_OUTPUT(m_OnFoundNPC, "OnFoundNPC"),
#endif
@ -864,6 +866,16 @@ void CAI_ScriptedSequence::OnBeginSequence( CBaseEntity *pActor )
m_OnBeginSequence.FireOutput( pActor, this );
}
void CAI_ScriptedSequence::OnEntrySequence( CBaseEntity *pActor )
{
m_OnEntrySequence.FireOutput( pActor, this );
}
void CAI_ScriptedSequence::OnActionSequence( CBaseEntity *pActor )
{
m_OnActionSequence.FireOutput( pActor, this );
}
void CAI_ScriptedSequence::OnPreIdleSequence( CBaseEntity *pActor )
{
m_OnPreIdleSequence.FireOutput( pActor, this );

View File

@ -97,6 +97,8 @@ public:
void FireScriptEvent( int nEvent );
#ifdef MAPBASE
void OnBeginSequence( CBaseEntity *pActor );
void OnEntrySequence( CBaseEntity *pActor );
void OnActionSequence( CBaseEntity *pActor );
void OnPreIdleSequence( CBaseEntity *pActor );
#else
void OnBeginSequence( void );
@ -220,6 +222,8 @@ private:
COutputEvent m_OnCancelFailedSequence; // Fired when a scene is cancelled before it's ever run
COutputEvent m_OnScriptEvent[MAX_SCRIPT_EVENTS];
#ifdef MAPBASE
COutputEvent m_OnEntrySequence;
COutputEvent m_OnActionSequence;
COutputEvent m_OnPreIdleSequence;
COutputEvent m_OnFoundNPC;
#endif