Game Development Community

AIPlayer face the PathMarker

by Katrina Rose · in Torque Game Engine · 12/22/2004 (8:58 am) · 3 replies

Hi,

I have 2 types of bots in our game:

Patrol: Follows a path and attacks a target if it gets within the setSite variable. After the target is killed or the bot loses site of the target it checks tosee if it can see the pathmarker (node) it was trying to get to and if it can it continues. If it can't see the node it was going for before it will cycle through the nodes on it's path until it finds one it can see and continues tword that node.

Non Patrol: Stays on the First node (0) on the path until a attack target gets within the setSite variable. After the target is killed or the bot loses site of the target it will go back to the First node (0) on the path and wait to be aproached again.

My problem is that I would like to have the Non Patrol bot return to the first node (0) on the path and have the same rotation of the node. This is because if I have a bot outside of a door when the bot returns to the node it is facing the building and won't attack anything because I have them only attacking targets in there sight arc (Engine Modification). I tried setting the bots rotation in the onReachDestination method, but the bot stutters because it is always trying to go to node (0) of the path. I can't figure out how to fix this without messing up the other partoling bots. I need the bot to get to node (0), take the same rotation as the node, and then stop. Any help is apreciated.

Marrion

#1
12/22/2004 (9:09 am)
Does setting the rotation on the node help?
#2
12/22/2004 (9:12 am)
Hi Ron,

I set the rotation on the node so that the Y axis is facing the direction that I want the bot facing. When I try to set the bots rotation to the nodes rotation things get messy.

Marrion
#3
12/22/2004 (3:08 pm)
This may be a bit hacky... but you could possibly insert an object in the direct of where you want the guards to face at each node, and include a script line to have them set aim on that... again just a thought