NullReferenceException: Object reference not set to an instance of an object at BaseAnimalNPC.TryThinkFixed

Hello,
unfortunately got since update
"v2.0.50573"
"Patched for June 3rd Rust update (protocol 2303.213.1)"
the error message:

(13:39:22) | System.NullReferenceException: Object reference not set to an instance of an object
at BaseAnimalNPC.TryThink () [0x00000] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
at AIThinkManager.DoProcessing (ListHashSet`1 [T] process, System.Single budgetSeconds, System.Int32 & last) [0x00014] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
(13:39:22) | System.NullReferenceException: Object reference not set to an instance of an object
at BaseAnimalNPC.TryThink () [0x00000] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
at AIThinkManager.DoProcessing (ListHashSet`1 [T] process, System.Single budgetSeconds, System.Int32 & last) [0x00014] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
(13:39:22) | System.NullReferenceException: Object reference not set to an instance of an object
at BaseAnimalNPC.TryThink () [0x00000] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
at AIThinkManager.DoProcessing (ListHashSet`1 [T] process, System.Single budgetSeconds, System.Int32 & last) [0x00014] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
(13:39:23) | Calling 'Unload' on 'RadtownAnimals v0.2.83' took 331ms
(13:39:23) | Unloaded plugin RadtownAnimals v0.2.83 by k1lly0u
(13:39:23) | System.NullReferenceException: Object reference not set to an instance of an object
at BaseAnimalNPC.TryThink () [0x00000] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
at AIThinkManager.DoProcessing (ListHashSet`1 [T] process, System.Single budgetSeconds, System.Int32 & last) [0x00014] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
(13:39:23) | System.NullReferenceException: Object reference not set to an instance of an object
at BaseAnimalNPC.TryThink () [0x00000] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
at AIThinkManager.DoProcessing (ListHashSet`1 [T] process, System.Single budgetSeconds, System.Int32 & last) [0x00014] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0
(13:39:23) | System.NullReferenceException: Object reference not set to an instance of an object
at BaseAnimalNPC.TryThink () [0x00000] in <6a0ecd327b0a4f348fdfee9fcd4348a3>: 0

Too bad, is a very good plugin :)

o5FtnD94lzQ3n7q.jpg ErMonito

Final solution:

1st

https://github.com/k1lly0u/Oxide.Ext.RustEdit

Copy the Oxide.Ext.RustEdit.dll to your / serverroot / RustDedicated_Data / Managed folder.

2nd

https://umod.org/games/rust

Copy - paste and replace files in RustDedicated_Data / Managed folder.

3rd

Restart your server.

Thanks for the explanation. Since there are online players, I will try it at the first opportunity
xdi444
Thanks for the explanation. Since there are online players, I will try it at the first opportunity

error persists :(

(17:58:42) | System.NullReferenceException: Object reference not set to an instance of an object

at AnimalBrain+AttackState.GetAimDirection (BaseCombatEntity from, BaseCombatEntity target) [0x00000] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at AnimalBrain+AttackState.StateThink (System.Single delta) [0x000de] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAIBrain`1[T].Think (System.Single delta) [0x00051] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAIBrain`1[T].DoThink () [0x0000d] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAnimalNPC.TryThink () [0x0000d] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at AIThinkManager.DoProcessing (ListHashSet`1[T] process, System.Single budgetSeconds, System.Int32& last) [0x00014] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

(17:58:42) | System.NullReferenceException: Object reference not set to an instance of an object

at AnimalBrain+AttackState.GetAimDirection (BaseCombatEntity from, BaseCombatEntity target) [0x00000] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at AnimalBrain+AttackState.StateThink (System.Single delta) [0x000de] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAIBrain`1[T].Think (System.Single delta) [0x00051] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAIBrain`1[T].DoThink () [0x0000d] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAnimalNPC.TryThink () [0x0000d] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at AIThinkManager.DoProcessing (ListHashSet`1[T] process, System.Single budgetSeconds, System.Int32& last) [0x00014] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

(17:58:43) | System.NullReferenceException: Object reference not set to an instance of an object

at AnimalBrain+AttackState.GetAimDirection (BaseCombatEntity from, BaseCombatEntity target) [0x00000] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at AnimalBrain+AttackState.StateThink (System.Single delta) [0x000de] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAIBrain`1[T].Think (System.Single delta) [0x00051] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAIBrain`1[T].DoThink () [0x0000d] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at BaseAnimalNPC.TryThink () [0x0000d] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

at AIThinkManager.DoProcessing (ListHashSet`1[T] process, System.Single budgetSeconds, System.Int32& last) [0x00014] in <d70d90f75fab4a7b9437ed7dadb3ce82>:0

(17:59:04) | [Economics] Saving balances for players...


for me too.  had to disable the populations to get rid of the error.

Also,  i dont think it has anything todo with rustedit...

IF we dont have this extension,  how would it be "outdated" ? and why should i add it to remove the error...  

 

Some other wierd thing,-    locally on my own pc,  i tested the same thing,  with the same plugins,   the error did not pop up ....  only on my dedicated root....  

The solution is patience, wait for them to update the uMod code, I wish facepuch would work together with umod, many of the new players only go to mods servers.

And it would also be great to motivate the DevTeam with donations, he does the hard work for free..

Thanks to all uMod project contributors, good luck!

So, i looked into it a bit, added a null check on the TryThink method, and it seemed that some of the spawned animals got no brain,
which leads to the System.NullReferenceException.

Temp Solution ->  i added 2 methods to my custom code"collab" plugin which removes those animals from the manager.

( Code taken from-Remove Animals AI- by Orange- - )

void RemoveMovement(BaseNpc npc)
        {
            npc.CancelInvoke(npc.TickAi);
            var script1 = npc.GetComponent<AiManagedAgent>();
            UnityEngine.Object.Destroy(script1);
            var script2 = npc.GetComponent<UtilityAIComponent>();
            UnityEngine.Object.Destroy(script2);
            npc.StopAllCoroutines();
            var obj = npc as BaseAnimalNPC;
            if (obj != null)
            {
                AIThinkManager.RemoveAnimal(obj);
            }
        }
        void OnEntitySpawned(BaseNetworkable entity)
        {
            if (entity is BaseNpc)
            {
                var obj = entity as BaseAnimalNPC;
                if (obj != null && !obj.HasBrain)
                {
                    RemoveMovement(obj);
                }
            }

        }

 

Hello guys i have found a solution! check if your root folder contains a folder called cfg, for some reason mine doesnt have it and this folder includes all the AI files missing.

 

 

 

If you want this files i can share you, this is my discord...  DEMO#2885

 

After i copied this folder into the root and reboot the server all is working properly

So far none of the above fixes have worked for me.  1) Don't use Rustedit 2) Our files were in the CFG

This option helped me:
(there is no more error in the console and the animals are now moving)

oTMMsSW2h7jroA6.jpg ErMonito

Final solution:

1st

https://github.com/k1lly0u/Oxide.Ext.RustEdit

Copy the Oxide.Ext.RustEdit.dll to your / serverroot / RustDedicated_Data / Managed folder.

2nd

https://umod.org/games/rust

Copy - paste and replace files in RustDedicated_Data / Managed folder.

3rd

Restart your server.

Thank You!

Does'nt change anything for me, I don't use RustEdit, and I have all AI files...
To stop the spam error messages I have installed the plugin remove-animals-ai
But no more AI for animals :(

Expecting an update perhaps from Rust ?

IQ5r1WodGgNnUCj.jpg DanBosS

Does'nt change anything for me, I don't use RustEdit, and I have all AI files...
To stop the spam error messages I have installed the plugin remove-animals-ai
But no more AI for animals :(

Expecting an update perhaps from Rust ?


I don't use RustEdit either, but I just copied this DLL for myself and rebooted the server - everything is ok!
As a hint:
So far, none of the above fixes have worked for me. 😒
1) RUST also runs on a LINUX dedicated server as above for user "Crushed"
2) Don't use a rustedit
3) CFG available in the root directory
4) Error messages only come when I use the "Radtown Animals" plugin

Thanks to the moder, who try here 😉

It seems that by applying the new Rust and Oxide server update everything is back to normal!

Well no, it's always the same galley :(
It seemed to work a few minutes and it started again :(

so much trash talk about rustedit. pitty. 🤢 disrespect

I reinstalled the application with which I configure my server and no more spam on the console.

Problem solved for me.

I hope it helps you.

Download again:

https://umod.org/games/rust

https://github.com/k1lly0u/Oxide.Ext.RustEdit

Recent updates to both files.

Merged post

I think NpcTarget.cs has something to do with it too.

I took it off for now.

I think that when it stops NPCs and animals from attacking each other, that is when it causes spam on the console.

Locked automatically