Announcement

Collapse
No announcement yet.

ai controller not using navigation points

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

  • replied
    true,
    what i did was i created a subclass of keypoint which is the base class of invisible actors which mark things instead of Actors which are abstract. i spawned them correctly and all that, but theres a type mismatch in my AIcontroller
    MoveTarget = NewDestination;
    after i figure it out, ill post how i did it.
    thanks everyone.

    Leave a comment:


  • replied
    You'll probably want to word it like this:

    Code:
    var(config) array<MyNavPoint> NavPoints;
    
    ...
    
    NavPoints[SomeNumberInTheArray] = spawn(class'MyNavPoint');
    Instead of having an array of Actors.

    Leave a comment:


  • replied
    I see what your saying, but my gametype has no intial objective to replace, and the goal is i create navPoints and just say MoveToward(MoveTarget); where Movetarget is an element in my NavPoint array. Unfortunately my navpoints extend from actor and although i am not saying it is native the log SpawnActor failed because class Actor is abstract.... whats up with that??

    Leave a comment:


  • replied
    From my own experiance, the botPaths have to be built prior to playing the map. And if your code does anything to any of the navigation points, say for example:

    say you use the CheckReplacement function in the mutator, to try to dynamicly replace a ONSPower Core with a CTF flag base. It should work, they are both GameObjectives that are also part of the navigationpath network.... right?

    well Upon doing that, it is the same as if you where to in Unreal Ed, delete a ONS Power core from the map, and then manualy add in a flag base. All the paths that existed going to that powercore is gone and bots have no idea that the flag base exists until u actualy rebuild the paths.

    I maybe wrong, but Im pretty sure that, that example is whats going on.

    Leave a comment:


  • replied
    gracias Angel_Mapper...

    Leave a comment:


  • replied
    If you're calling MoveToward it won't matter. If you use FindPathTowards it will most likely break.

    Leave a comment:


  • replied
    That's pretty cool, never thought of spawning navpoints dynamically.

    Do the paths ever get built with them? You know, you build the paths when you add the nav points while mapping, will the bots use the ones dynamically generated?

    I thought that the paths were what is used for like FindPathTowards and what all.

    I smell Hansel and Gretel gametype here. How fun would THAT be.

    Leave a comment:


  • replied
    [code] tags are your friend.

    I don't see anywhere that you're spawning the navpoints. It should go something like:

    Code:
    function PostBeginPlay()
    {
        local int i;
        Super.PostBeginPlay();
        if ( !bDeleteMe && bIsPlayer && (Level.NetMode != NM_Client) )
        {
            PlayerReplicationInfo = Spawn(PlayerReplicationInfoClass, Self,,vect(0,0,0),rot(0,0,0));
            InitPlayerReplicationInfo();
        }
    
        Log("pedAIController===============PostBeginplay");
    
        for(i=0;i<10;i++)
            NavPoints[i] = spawn(class'Whatever',,,vect(111.,110.,-468.000000));
    }

    Leave a comment:


  • replied
    thanks AM, but i still access none for my NavPoints, can you look at a piece of my code(postbeginplay)? I have commented out where I am logging a warning.

    var(Config) array<Actor> NavPoints[11];
    var int currentPoint;
    var bool bIncrementing;

    function PostBeginPlay()
    {
    Super.PostBeginPlay();
    if ( !bDeleteMe && bIsPlayer && (Level.NetMode != NM_Client) )
    {
    PlayerReplicationInfo = Spawn(PlayerReplicationInfoClass, Self,,vect(0,0,0),rot(0,0,0));
    InitPlayerReplicationInfo();
    }

    Log("pedAIController===============PostBeginplay") ;

    NavPoints[0].SetLocation(vect(111.,110.,-468.000000));
    :
    :
    NavPoints[10].SetLocation(vect(110.,110.,-468.));
    //i access none when i try to set these locations..
    }

    You should know that until this point I never use NaviPoints in my code.
    thanks in advance.

    Leave a comment:


  • replied
    If it's dynamic no, unless you want it replicated across the server. In that case you specify a number, not a variable.

    Leave a comment:


  • replied
    then how do i initialize the array size? is it nessacary to?

    Leave a comment:


  • replied
    Originally posted by keyser_sose
    var(Config) array<Actor> NavPoints[numOfPoints];
    Is that how it's written in the code? It should just be:

    var(config) array<actor> NavPoints;

    Leave a comment:


  • started a topic ai controller not using navigation points

    ai controller not using navigation points

    I am having problems with my AIController..
    I create an array of points:

    var(Config) array<Actor> NavPoints[numOfPoints];

    I then try to set their location but instead I get a warning in the log: 'Accessed None 'NavPoints''

    -->Is there something i need to do before i can set their location?
    I assume I eventually want to call moveToward(NavPoints[i])
    while incrementing through the array (i++)....
    -->am I right to assume this?

    any help is welcome...
Working...
X