Game Development Community

Usage of onTargetEnterLOS and onTargetExitLOS

by Jinnie Ong · in Torque 3D Professional · 08/17/2009 (1:53 am) · 3 replies

Hi all, I've been trying out the example in the Advanced 3D Programming All in One book; more specifically, the Guard AI. It didn't work out of the box (as expected), so I'm now looking through all the code in an attempt to find out what the problem is.

The code in question can be found here: http://www.garagegames.com/community/forums/viewthread/35203

I've noticed that the DoScan function does not pick up the player character, and on further inspection, I can't find the onTargetEnterLOS implemented from anywhere. So I'm wondering if it is a function that is only implemented in TGEA and below (which seems quite unlikely).

At the moment, the bot is pretty much just standing there, staring into blank space. Anyone can provide any insight as to what is wrong or perhaps with experience implementing the code in T3D? Thank you!

#2
08/17/2009 (5:14 am)
Thanks for the advice! I've managed to debug it up to the point where everything works fine, even though the AI isn't too smart - I've got to stand in front of the bot for a few seconds before it realises I'm in front and starts firing.

However it seems to loop through the motions for half a minute, then stops entire, so I'm currently checking out why that's the case.

Another thing, the bot seems to be aiming at the ground instead of directly at me, one thread recommended the use of aimAt(%player) instead of aimAtObject(%player), however that didn't seem to work out either. There was another resource mentioning how to correct this issue but I didn't bookmark it then, and now I can't find it. Any idea how to change the target location?