Hello, Im trying to get a list of nearby animals, and im having trouble with the NPCAI / NpcAI class I see in used in others scripts.
NpcAI is not recognized, and NPCAI complains about a missing "BARust_Animal".
Here's my code :
Am i missing something ?Code:List<BaseEntity> list = new List<BaseEntity>(); Vis.Entities<BaseEntity>(pl.eyes.position,3f, list); foreach (BaseEntity be in list) { NPCAI npc = be.gameObject.GetComponent<NPCAI>; if (npc != null) Puts("ai found"); }
[DOUBLEPOST=1467593291][/DOUBLEPOST]Edit : Nevermind, im an idiot.
be.gameObject.GetComponent<NPCAI>();
Re-edit: Spoke too soon, still have the BARust_Animal error in the Oxide server console.
Solved Getting nearby animals : Problem with NPCAI
Discussion in 'Rust Development' started by Yatta, Jul 4, 2016.
-
You need to post the full error
-
Finally found the fix, no idea how it works tough.
I thought the following lines at the very top of others plugins where developper comments, turns out they are required :
// Reference: RustBuild
// Reference: Behave.Unity.Runtime -
Wulf Community Admin
//Reference is used to reference a DLL that isn't loaded already for plugins. Generally the only DLLs that get loaded are those in use by Oxide. -
Thank you Wulf. I have to say you're doing an excellent job at supporting your community, you seem to be present and helpfull in most if not all threads. I dont think Ive ever seen a developer so supportive.
