Game Development Community

Having problem on this one

by Roshan Kuriyan · in Technical Issues · 04/26/2006 (4:21 am) · 11 replies

I am new to Tge, i didnt understand where the function

function AIBeast::onTargetEnterLOS(%this,%obj)
{

}

got invoked and what it does, if i want to invoke this function what i have to do,

Any help anyone could give.

#1
04/26/2006 (5:05 am)
If you have questions about the code or the syntax, please go to the relevant forum, as this is not a General question.
#2
04/26/2006 (6:34 am)
He didnt post in the general forum he posted in the AI forum which is appropriate i would think.

Roshan, onTargetEnterLOS is not a function you actually call. it's a callback, meaning the engine calls it automatically under certain cirumstances, like onCollision(). in this instance, it gets called when something enters the LOS of the ai object. you put whatever code here you want executed when this condition is met. note that this function is only called once when an object first enters the LOS. once it's there, the function doesnt get called again until either something else enters the LOS or the curent target moves out of the LOS and enters again. if I'm wrong about any of this someone correct me.

hope this helps.
#3
04/26/2006 (6:50 am)
Well I don't think this is a general issue for game developers, I would say that it's a specific issue in torque and it should go into the SDK discussions. Just my thought though.
#4
04/26/2006 (6:56 am)
Yea I agree Martin that it would be better placed in either the SDK boards or the torque game engine public area.
#5
04/26/2006 (7:40 am)
Roshan, You just trying to understand this function or you just try to get it to work in TGE 1.4 or TLK 1.4. It will work with them. Sean, explain pretty good.
#6
04/26/2006 (9:23 pm)
Hi sean and others , thank you for your reply, it is much more help full for me,


Thanks a lot ....
#7
04/27/2006 (1:39 pm)
Did you get it to work?
#8
05/03/2006 (1:08 am)
Hi Micheal,

It is not working for me. where to set the target for the AI player.
will you please help me..
#9
05/03/2006 (6:45 am)
What you try to get the AI to do? The beast AI is setup to attack the player at certain distance.
#10
05/09/2006 (10:20 pm)
When the player is visible to the AI , AI player has to attack the player, and once he is not visible AI has to stop attacking the player,

i want this one to done?.
#11
05/10/2006 (6:58 am)
Have you try the resource on GG AIGuard, that good resource. The AI will following the player for certain distance than return to his post.