Does it not log the player? SeePlayer in an AIController works right out of the box for me.
EDIT:Almost works out of the box for me… I recall the default implementation of GetPlayerViewPoint put the ai eyepoint in the ground. Here’s mine if it helps you:
@Crollo. Thanks for checking back. I just tried adding SeePlayer outside of any state and logging, and it never gets triggered.
I also tried your suggestion with GetPlayerViewPoint() but still nothing. I’ve tested that my player controller has bIsPlayer=true and it does.
One thing that is a little confusing is that the signature of SeePlayer in Controller.uc, it states that it is called if bIsPlayer is set to true on ‘Seen’, where ‘Seen’ is a pawn. However bIsPlayer is a param of the Controller class, not the Pawn class. I’m guessing this simply an error, or a change was made through the course of UDK releases.
/* epic ===============================================
* ::SeePlayer
*
* Called whenever Seen is within of our line of sight
* if Seen.bIsPlayer==true.
*
* =====================================================
*/
event SeePlayer( Pawn Seen );
I’m pretty stumped by why SeePlayer is not firing for me in SP, when it’s working perfectly in multiplayer. Does anyone have any other ideas of why?
Since it is native code we can’t see exactly what it’s checking, it may be a typo and it’s checking the IsPlayerPawn function on the pawn instead of bisplayer, or it could be casting from the pawn to it’s controller.
The only other thing I can think of off the top of my head is perhaps me using UDKbot instead of aicontroller might affect things.
Could you post your player pawn and controller?
EDIT: You can also verify the eyepoint is correct by adding the following to your tick event:
local vector ViewLocation;
local rotator ViewRot;
GetPlayerViewPoint(ViewLocation,ViewRot);
DrawDebugLine( ViewLocation, ViewLocation+200*normal(vector(viewrot)), 0, 255, 0, false);
I made a mistake in the GetPlayerViewPoint, instead of Pawn.Rotation it should just be Rotation. This only affects the pitch of the rotation, however so it shouldn’t damage seeplayer.