Created 5 years ago2019-10-03 11:51:38 UTC by abbadon
//=========================================================
// Classify - indicates this monster's place in the
// relationship table.
//=========================================================
int CISlave :: Classify ( void )
{
return CLASS_PLAYER_ALLY;
}
int CISlave::IRelationship( CBaseEntity *pTarget )
{
if ( FClassnameIs( pTarget->pev, "monster_sentinel" ) )
{
return R_NM;
}
if ( FClassnameIs( pTarget->pev, "player" ) )
{
return R_AL;
}
if ( FClassnameIs( pTarget->pev, "monster_trolley" ) )
{
return R_HT;
}
return CBaseMonster::IRelationship( pTarget );
}
wrote the new code:
//=========================================================
// Codigo para seguir a los Trolley
//=========================================================
Task_t tlFollow[] =
{
// { TASK_SET_FAIL_SCHEDULE, (float)SCHED_CANT_FOLLOW }, // If you fail
{ TASK_MOVE_TO_TARGET_RANGE,(float)640 }, // Move within 640 of target ent (monster_trolley)
// { TASK_SET_SCHEDULE, (float)SCHED_TARGET_FACE },
};
Schedule_t slFollow[] =
{
{
tlFollow,
ARRAYSIZE ( tlFollow ),
bits_COND_NEW_ENEMY |
bits_COND_LIGHT_DAMAGE |
bits_COND_HEAVY_DAMAGE |
bits_COND_HEAR_SOUND,
bits_SOUND_COMBAT |
bits_SOUND_DANGER,
"Follow"
},
};
Of course I have definded all...
DEFINE_CUSTOM_SCHEDULES( CISlave )
{
slSlaveAttack1,
slSlaveEstablishLineOfFire,
slFollow,
};
And in:
Schedule_t *CISlave :: GetSchedule( void )
I placed:
//=================================================
// He follows who he hates...
//=================================================
if ( HasConditions (bits_COND_SEE_HATE ) )
{
return slFollow;
}
//=================================================
Also I put the "follow" thing in:
Schedule_t *CISlave :: GetScheduleOfType ( int Type )
{
switch ( Type )
{
case SCHED_FAIL:
slSlaveEstablishLineOfFire;//ZWC
case SCHED_RANGE_ATTACK1:
return slSlaveAttack1;
case SCHED_TARGET_CHASE:
return slFollow;
}
return CSquadMonster :: GetScheduleOfType( Type );
}
//=================================================
if ( HasConditions (bits_COND_SEE_HATE ) )
{
return GetScheduleOfType( SCHED_TARGET_CHASE );
}
//=================================================
...the game runs perfect. The gunners attack the Trolley guy, yes, but the game does not crash at all. ```
code goes here
```
code
, and it look awful (sorry), but did not look into the Formatting Help link, moron me. A monster following another monster? Like, actively? I'm not sure that you could. Unless you faked it or the monster was trying to kill the other...Sorry for bumping this, but I totally forgot to THANK Jessie for pointing me to the right direction, because finally that´s what I did in the end, so any credit is for you! Thanks Jessie.