Example #1
0
// lookup a sequence name and setup the target monster to play it
BOOL CCineMonster::StartSequence(CBaseMonster *pTarget, int iszSeq, BOOL completeOnEmpty)
{
	if(!iszSeq && completeOnEmpty)
	{
		SequenceDone(pTarget);
		return FALSE;
	}

	pTarget->pev->sequence = pTarget->LookupSequence(STRING(iszSeq));
	if(pTarget->pev->sequence == -1)
	{
		ALERT(at_error, "%s: unknown scripted sequence \"%s\"\n", STRING(pTarget->pev->targetname), STRING(iszSeq));
		pTarget->pev->sequence = 0;
		// return FALSE;
	}

#if 0
	char *s;
	if ( pev->spawnflags & SF_SCRIPT_NOINTERRUPT ) 
		s = "No";
	else
		s = "Yes";

	ALERT( at_console, "%s (%s): started \"%s\":INT:%s\n", STRING( pTarget->pev->targetname ), STRING( pTarget->pev->classname ), STRING( iszSeq), s );
#endif

	pTarget->pev->frame = 0;
	pTarget->ResetSequenceInfo();
	return TRUE;
}
Example #2
0
// lookup a sequence name and setup the target monster to play it
// overridden for CCineAI because it's ok for them to not have an animation sequence
// for the monster to play. For a regular Scripted Sequence, that situation is an error.
BOOL CCineAI::StartSequence(CBaseMonster *pTarget, int iszSeq, BOOL completeOnEmpty)
{
	if(iszSeq == 0 && completeOnEmpty)
	{
		// no sequence was provided. Just let the monster proceed, however, we still have to fire any Sequence target
		// and remove any non-repeatable CineAI entities here ( because there is code elsewhere that handles those tasks, but
		// not until the animation sequence is finished. We have to manually take care of these things where there is no sequence.

		SequenceDone(pTarget);

		return TRUE;
	}

	pTarget->pev->sequence = pTarget->LookupSequence(STRING(iszSeq));

	if(pTarget->pev->sequence == -1)
	{
		ALERT(at_error, "%s: unknown aiscripted sequence \"%s\"\n", STRING(pTarget->pev->targetname), STRING(iszSeq));
		pTarget->pev->sequence = 0;
		// return FALSE;
	}

	pTarget->pev->frame = 0;
	pTarget->ResetSequenceInfo();
	return TRUE;
}
Example #3
0
// lookup a sequence name and setup the target monster to play it
bool CCineMonster::StartSequence( CBaseMonster *pTarget, int iszSeq, const bool completeOnEmpty )
{
	if( !iszSeq && completeOnEmpty )
	{
		SequenceDone( pTarget );
		return false;
	}

	pTarget->SetSequence( pTarget->LookupSequence( STRING( iszSeq ) ) );
	if( pTarget->GetSequence() == -1 )
	{
		ALERT( at_error, "%s: unknown scripted sequence \"%s\"\n", pTarget->GetTargetname(), STRING( iszSeq ) );
		pTarget->SetSequence( 0 );
		// return false;
	}

#if 0
	char *s;
	if( GetSpawnFlags().Any( SF_SCRIPT_NOINTERRUPT ) )
		s = "No";
	else
		s = "Yes";

	ALERT( at_console, "%s (%s): started \"%s\":INT:%s\n", pTarget->GetTargetname(), pTarget->GetClassname(), STRING( iszSeq ), s );
#endif

	pTarget->SetFrame( 0 );
	pTarget->ResetSequenceInfo();
	return true;
}