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

Well, in the end i removed my plugin solution from before and as -my- final solution 

I modified the assembly and added a null check to the method, throwing the exception , checking for a Brain on the AI before trying to think....

--  Inside "BaseAnimalNPC" class --

public virtual void TryThink()
	{
                 //Added this Check.
		if (this.brain == null || !this.HasBrain)
		{
			return;
		}

		if (this.brain.ShouldServerThink())
		{
			this.brain.DoThink();
		}
	}

I tried all of the above suggestions with no luck.  Finally started deleting the animals one by one to find the cause.
Turned out it was the wild horses.

del assets/rust.ai/agents/horse/horse.prefab
horse.population 0

ridablehorse.population can still be used with no problems.

I did that too. I missed putting it on. A thousand pardons.

6wvxv8vs7eNKAke.jpg Dissonance7622

I tried all of the above suggestions with no luck.  Finally started deleting the animals one by one to find the cause.
Turned out it was the wild horses.

del assets/rust.ai/agents/horse/horse.prefab
horse.population 0

ridablehorse.population can still be used with no problems.



Merged post

Even so, spam continues to appear on the console, but much less than before.

Something else is still missing to correct.

Well as i said,  its the trythink method, thats executed on AI Entities without the brain component. 

My Method above is not the perfect solution , but it stops the spam alltogether,

If you wanna try it yourself- here is the assembly from the latest oxide zip , only modified as shown above.

pPpLLtXYsefSmQw.png Crushed

Well as i said,  its the trythink method, thats executed on AI Entities without the brain component. 

My Method above is not the perfect solution , but it stops the spam alltogether,

If you wanna try it yourself- here is the assembly from the latest oxide zip , only modified as shown above.

Please do not distribute random DLLs here. We can add a patch to fix as mentioned if needed based on your suggestion.

https://ci.appveyor.com/api/projects/oxidemod/oxide-rust/artifacts/Oxide.Rust-develop.zip?branch=develop
https://ci.appveyor.com/api/projects/oxidemod/oxide-rust/artifacts/Oxide.Rust-linux-develop.zip?branch=develop
fG8l7N1FliVrymK.png ZEODE
Do these patches now contain a fix?

They contain what was suggested previously by Crushed. This isn't an Oxide issue, we just added a patch to handle the error.

SaRoLUoldBdiYLj.jpg Wulf

They contain what was suggested previously by Crushed. This isn't an Oxide issue, we just added a patch to handle the error.

Yes understood, thanks.

Is this patch for
Windows
or
Linux?


I have RUST running on the LINUX server and get error messages immediately after importing it




"

(18:32:35) | FileNotFoundException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

(18:32:35) | Server Exception: Steam Query

(18:32:35) | FileNotFoundException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

(18:32:35) | Server Exception: Steam Query

(18:32:35) | FileNotFoundException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

(18:32:35) | Server Exception: Steam Query

(18:32:35) | FileNotFoundException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

(18:32:35) | Server Exception: Steam Query
"


Ghostplayer
Is this patch for
Windows
or
Linux?


I have RUST running on the LINUX server and get error messages immediately after importing it

"

(18:32:35) | FileNotFoundException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=*.*.*.*, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

(18:32:35) | Server Exception: Steam Query

(18:32:35) | FileNotFoundException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=*.*.*.*, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

(18:32:35) | Server Exception: Steam Query

(18:32:35) | FileNotFoundException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=*.*.*.*, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

(18:32:35) | Server Exception: Steam Query

(18:32:35) | FileNotFoundException: Could not load file or assembly 'Facepunch.Steamworks.Win64, Version=*.*.*.*, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

(18:32:35) | Server Exception: Steam Query
"


There are two builds linked, you installed the wrong one.

Thx ☺️

hi

i get this spamming my console 

  at AIThinkManager.DoProcessing (ListHashSet`1[T] process, System.Single budgetSeconds, System.Int32& last) [0x00014] in :0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)
System.NullReferenceException: Object reference not set to an instance of an object
  at BaseAnimalNPC.TryThink () [0x00000] in :0 
  at AIThinkManager.DoProcessing (ListHashSet`1[T] process, System.Single budgetSeconds, System.Int32& last) [0x00014] in :0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)
System.NullReferenceException: Object reference not set to an instance of an object
  at BaseAnimalNPC.TryThink () [0x00000] in :0 
  at AIThinkManager.DoProcessing (ListHashSet`1[T] process, System.Single budgetSeconds, System.Int32& last) [0x00014] in :0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)
System.NullReferenceException: Object reference not set to an instance of an object
  at BaseAnimalNPC.TryThink () [0x00000] in :0 


this is on a test server with no other plugins installed

how can i fix this ? 

 

let me know
grz

Same problem around here.

Less frequently very occasionally this appears on console:

System.NullReferenceException: Object reference not set to an instance of an object
  at AnimalBrain+AttackState.GetAimDirection (BaseCombatEntity from, BaseCombatEntity target) [0x00000] in <c8f52207be534df0a09963fbe837cda2>:0 
  at AnimalBrain+AttackState.StateThink (System.Single delta) [0x000de] in <c8f52207be534df0a09963fbe837cda2>:0 
  at BaseAIBrain`1[T].Think (System.Single delta) [0x00051] in <c8f52207be534df0a09963fbe837cda2>:0 
  at BaseAIBrain`1[T].DoThink () [0x0000d] in <c8f52207be534df0a09963fbe837cda2>:0 
  at BaseAnimalNPC.TryThink () [0x00023] in <c8f52207be534df0a09963fbe837cda2>:0 
  at AIThinkManager.DoProcessing (ListHashSet`1[T] process, System.Single budgetSeconds, System.Int32& last) [0x00014] in <c8f52207be534df0a09963fbe837cda2>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)​

same problem. my solution that worked is to stop my server. backup my world. update umod to the latest last night. start my server again. There seems to be an error with bones something but that only happens early on. now its running fine.