Results 1 to 5 of 5
  1. #1

    Default How to hide AI path finding in UDK?

    i have a problem about AI in UDK, everytime i played my game, the blue and red Ai pathfinding is appears..
    my question is, how to hide that? the AI pathfinding..

    this is the picture..


    that the red and blue that i mean..

    thx everyone, and sory for my bad english

  2. #2
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,556

    Default

    How are you doing path finding, show us the code please. It is likely that you are printing out the debugging stuff...

  3. #3

    Default

    Quote Originally Posted by Solid Snake View Post
    How are you doing path finding, show us the code please. It is likely that you are printing out the debugging stuff...
    thx for your reply Solid snake, here it is the code..

    Code:
    class TKOVMonsterControler extends AIController;
    
    var Actor target;
    var() Vector TempDest;
    
    event Possess(Pawn inPawn, bool bVehicleTransition)
    {
        super.Possess(inPawn, bVehicleTransition);
        Pawn.SetMovementPhysics();
    }
    
    //I'm adding an default idle state so the Pawn doesn't try to follow a player that doesn' exist yet.
    auto state Idle
    {
        event SeePlayer (Pawn Seen)
        {
            super.SeePlayer(Seen);
            target = Seen;
            GotoState('Follow');
        }
    Begin:
    }
    
    state Follow
    {
        ignores SeePlayer;
        function bool FindNavMeshPath()
        {
            // Clear cache and constraints (ignore recycling for the moment)
            NavigationHandle.PathConstraintList = none;
            NavigationHandle.PathGoalList = none;
    
            // Create constraints
            class'NavMeshPath_Toward'.static.TowardGoal( NavigationHandle,target );
            class'NavMeshGoal_At'.static.AtActor( NavigationHandle, target,32 );
    
            // Find path
            return NavigationHandle.FindPath();
        }
    Begin:
    
        if( NavigationHandle.ActorReachable( target) )
        {
            FlushPersistentDebugLines();
            //Direct move
            MoveToward( target,target );
    		 GotoState('Shoot'); //Start shooting when close enough to the player.
    
        }
        else if( FindNavMeshPath() )
        {
            NavigationHandle.SetFinalDestination(target.Location);
            FlushPersistentDebugLines();
            NavigationHandle.DrawPathCache(,TRUE);
            
            // move to the first node on the path
            if( NavigationHandle.GetNextMoveLocation( TempDest, Pawn.GetCollisionRadius()) )
            {
                DrawDebugLine(Pawn.Location,TempDest,255,0,0,true);
                DrawDebugSphere(TempDest,16,20,255,0,0,true);
                MoveTo( TempDest, target );
    			GotoState('Shoot');	
    	
            }
    		 GotoState('Shoot'); //Start shooting when close enough to the player.
    		 
    
    
    
        }
    	
    	
        else
        {
    		Sleep(0.5);
            //We can't follow, so get the hell out of this state, otherwise we'll enter an infinite loop.
            GotoState('Idle');
        }
        goto 'Begin';
    }
    simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation)
    {
        // AI does things from the Pawn
        if (Pawn != None)
        {
            out_Location = Pawn.Location;
            out_Rotation = Rotation; //That's what we've changed
        }
        else
        {
            Super.GetPlayerViewPoint(out_Location, out_Rotation);
        }
    }
    
    state Shoot
    {
    	
       
    Begin:
    	
    	
        Pawn.StartFire(1);
    	
    	Sleep(0.3);
    	
        GotoState('Idle');
    }
    
    DefaultProperties
    {
    }

  4. #4
    MSgt. Shooter Person
    Join Date
    Mar 2012
    Location
    Chicago Il
    Posts
    183

    Default

    Have you tried console commands:

    show paths

    show bounds

    FLUSHPERSISTENTDEBUGLINES


    Also this might be it, either set them to false? or get rid of them
    DrawDebugLine(Pawn.Location,TempDest,255,0,0,true) ;
    DrawDebugSphere(TempDest,16,20,255,0,0,true);

  5. #5

    Default

    Quote Originally Posted by DGlow View Post
    Have you tried console commands:

    show paths

    show bounds

    FLUSHPERSISTENTDEBUGLINES


    Also this might be it, either set them to false? or get rid of them
    thx DGlow, i've tried the console commands, and delete this code or change the "true" become "false"
    Code:
     DrawDebugLine(Pawn.Location,TempDest,255,0,0,false);
                DrawDebugSphere(TempDest,16,20,255,0,0,false);
    but, the line and sphere in the game still appears, what should i do?
    Last edited by dooon; 03-18-2012 at 11:46 AM.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.