OnTargetEnterLOS
by Howard Dortch · in Torque Game Engine · 06/11/2004 (10:33 am) · 1 replies
Trying to figure out how this works.
I have a bot and I want it to chase me if it sees me. So onTargetEnterLOS is a callback in PlayerData. Now what all does it need to function?
I set this in as part of MyBot datablock but it never hits here
function MyBot::onTargetEnterLOS(%this,%obj)
{
%this.setMoveDestination($MYPLAYER.getTransform(), 0 );
echo ( " CHASE " );
}
I have a bot and I want it to chase me if it sees me. So onTargetEnterLOS is a callback in PlayerData. Now what all does it need to function?
I set this in as part of MyBot datablock but it never hits here
function MyBot::onTargetEnterLOS(%this,%obj)
{
%this.setMoveDestination($MYPLAYER.getTransform(), 0 );
echo ( " CHASE " );
}
Torque Owner Eric Jergensen
I looked at this approach to try to accomplish the same thing and decided that managing a state machine in "think" worked better.
For learning, I have been enhancing starter.fps. I now have Kork the Orc patrolling (i.e. following a path), chasing, and firing (w/ compensation for the drop of the bolt). Most of the work for this happens in AIManager::think().