1. So before the recent bandit update, I was able to spawn scientists, set their min- and max roam range etc. and they would roam around the position I spawned them on.

    Now they disregard what I set and all run towards the same destination.
    I know is that they did not do that before the recent update.
    I have tried messing around with the NavAgent without any succes.

    All I want is to spawn scientists at a certain position and have them to roam around that position.
    I know it is possible with timers etc. but I would just see if there is a more lightweight solution out there.

    For code I just do like this:

    Code:
    var scientist = (Scientist)GameManager.server.CreateEntity("assets/prefabs/npc/scientist/scientist.prefab", new Vector3(position.x, position.y, position.z));
    scientist.Stats.MinRoamRange = zone.MinRoamRange;
    scientist.Stats.MaxRoamRange = zone.MaxRoamRange;
    scientist.Spawn();
     
  2. Update: Now I used the bandits instead and made some patrol queue where it periodically sets the destination of the different bots.
    Now I get tons of nullpointers, something with the method `OnAiQuestion` which is triggered when a bot targets me.

    I'm not that much into this rust AI stuff but did they really change a lot behind the scenes for the recent update?

    Anyway, here is the nullpointer I'm getting:

    Code:
    NullReferenceException: Object reference not set to an instance of an object
      at NPCPlayerApex.OnAiQuestion (NPCPlayerApex source, Rust.Ai.AiQuestion_ShareEnemyTarget question) [0x000a7] in <25ffce0737144c53a960ec645231697e>:0
      at Scientist.AskQuestion (Rust.Ai.AiQuestion_ShareEnemyTarget question, System.Collections.Generic.List`1[Rust.Ai.AiAnswer_ShareEnemyTarget]& answers) [0x0002c] in <25ffce0737144c53a960ec645231697e>:0
      at Rust.Ai.SharePlayerTargetComm.Execute (Rust.Ai.PlayerTargetContext c) [0x00018] in <25ffce0737144c53a960ec645231697e>:0
      at Apex.AI.ActionBase`1[TContext].Apex.AI.IAction.Execute (Apex.AI.IAIContext context) [0x00001] in <7bc5c1faa2af4095bd4b5e00ae6066c5>:0
      at Apex.AI.CompositeAction.Execute (Apex.AI.IAIContext context) [0x0001e] in <7bc5c1faa2af4095bd4b5e00ae6066c5>:0
      at Apex.AI.Components.UtilityAIClient.Execute () [0x00071] in <7bc5c1faa2af4095bd4b5e00ae6066c5>:0
      at NPCPlayerApex.TickSensorySystem () [0x000be] in <25ffce0737144c53a960ec645231697e>:0
      at NPCPlayerApex.Apex.LoadBalancing.ILoadBalanced.ExecuteUpdate (System.Single deltaTime, System.Single nextInterval) [0x00038] in <25ffce0737144c53a960ec645231697e>:0
      at Apex.LoadBalancing.LoadBalancedQueue.Update () [0x000ab] in <bb0a7f1370d1429d8f5843f17f216f71>:0
      at Apex.LoadBalancing.LoadBalancerComponent.Update () [0x00006] in <bb0a7f1370d1429d8f5843f17f216f71>:0
     
    (Filename: <25ffce0737144c53a960ec645231697e> Line: 0)
     
  3. Ross, you're not alone in this issue. @tatoforever found a temp fix that I believe many people have been using (including myself) which is to set the communication radius on the NPCPlayerApex to zero.

    Code:
                var botapex = entity.GetComponent<NPCPlayerApex>();
                botapex.CommunicationRadius = 0f;
     
  4. Ah okay, thanks mate!
     
  5. Is that the fix ? How do I apply it? and on what?
     
  6. It might be the fix for bandits - have not tried it tho. Could work with normal scientists too but I have not experienced nullpointers thrown from them.
     
  7. So that error is a bandit thing?

    Cause that crap spams my rcon with null exceptions and that error is outputted to the output log. Lags my server alot
     
  8. Do you have self-spawned bots? It was the case for me with slef-spawned bots. The error went away when I killed the bots.
     
  9. I have Botspawn and ZombieHorde.

    Both auto spawn bots
    I'm guessing these are self spawned?
     
  10. Yes, I do not have a problem with BotSpawn myself but idk about ZombieHorde.
     
  11. I can take each out and test to see which one causing the issue if so
     
  12. Yes, please report back after. And are you also using BotSpawn to spawn scientists? I’m only spawning murderers from that plugin.
     
  13. Actually I have it spawning both. Scientists at monuments, and biomes, and murders with air drops.

    When I get home from work, I'll test it and then let you know. :)
     
  14. I also have spam in the console with NullReferenceException on the murderers spawn.
     
  15. Cool!

    How are you spawning the murderers? Through your own plugin or some public known?
     
  16. I haven't seen the error at all and the two plugins are still in.. Still getting crappy performance though.
     
  17. Well, there has always been issues with bots and performance :/