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();
Solved What have happened to the AI of scientists?
Discussion in 'Rust Development' started by Rekt Ross, Aug 4, 2018.
-
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)
-
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;
-
Ah okay, thanks mate!
-
Is that the fix ? How do I apply it? and on what?
-
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.
-
Cause that crap spams my rcon with null exceptions and that error is outputted to the output log. Lags my server alot -
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.
-
Both auto spawn bots
I'm guessing these are self spawned? -
Yes, I do not have a problem with BotSpawn myself but idk about ZombieHorde.
-
-
Yes, please report back after. And are you also using BotSpawn to spawn scientists? I’m only spawning murderers from that plugin.
-
When I get home from work, I'll test it and then let you know. -
I also have spam in the console with NullReferenceException on the murderers spawn.
-
-
-