Announcement

Collapse
No announcement yet.

AI Auto State

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    AI Auto State

    Hi,

    I've a problem managing with my AI's state : auto state is not called.
    I tried to put a log after the Begin:, without success.

    My Auto State code, from BlitzAICrowd class (extends BlitzAI):

    Code:
    auto state FollowPath
    {
    Begin:
        foreach AllActors( class 'PathNode', thisActor)
        {        
            if (thisActor.Group == PathNodeGroup)
            {
                if(((thisActor.Location.X - Pawn.Location.X) <= 1500) && ((thisActor.Location.Y - Pawn.Location.Y) <= 1500))
                {
                    PathNodeArray[pathNodeArrayCount] = thisActor;
                }
            }
            pathNodeArrayCount++;
        }
        
    Moving:
        for(movingCount=0; movingCount<=PathNodeArray.Length; movingCount++)
        {
            currentPathNode = pathNodeArray[movingCount];
            if(CurrentPathNode != oldCurrentPathNode)
            {
                randomPathNode = (Rand(PathNodeArray.Length)+1);
                MoveToward(PathNodeArray[randomPathNode]);
                oldCurrentPathNode = currentPathNode;
                if(Pawn.ReachedDestination(PathNodeArray[randomPathNode]))
                Goto('Begin');
            }
            else
            {
                movingCount++;
            }
        }
    }
    Do you see any mistake somewhere?
    By the way, parent class inherits utbot (UtBot <= BlitzAI <= BlitzAiCrowd ). There is no auto state in my BlitzAI class.

    Thank you for your help.

    #2
    Sorry about that, my thread is on the wrong category.

    Comment

    Working...
    X