yeah, using the updated MobAiLib. friendlies throws some errors, but they arent locked up anymore like they were before the update(they´ve been throwing a very similar kind of error actually before, tho getting locked in place instead of slowing the game) then i tried the slave greylings and this happened. everything was fine until the taming reached 100%, then i had 2fps
ah, it seems slave greylings is conflicting with (horems updated) friendlies reloaded mod, it works like a charm when removing that one. sorry for the scare.
Friendlies Reloaded has had some issues with the updated MobAILib. Im not sure what the current status is but you will still need to install friendlies reloaded to have the NPCs.
Hi Im using this mod for the friendlies reloaded but the npcs cant operate anything and in the console puts this when its working [Warning: Unity Log] MobController:RagnarsRokare.MobAI.SorterAI [Warning: Unity Log] MobController:RagnarsRokare.MobAI.FixerAI [Warning: Unity Log] MobController:RagnarsRokare.MobAI.WorkerAI [Warning: Unity Log] MobController:RagnarsRokare.MobAI.Mobs.ExampleAI
I need to put something in the config to make the npcs can work or something?
Thanks, I'm glad you like it. :) This seems to be an issue where Friendlies is using a method in MobAILib that has been changed. I will add back a stub for the old method signature.
Very much appreciate the quick reply, not that this error seems to actually be affecting anything I can notice. Look forward to future refinements and updates!
Hey! This mod can only be used through another mod, like SlaveGreylings or Friendlies Reloaded.
If you are writing your own mod that uses MobAILib the type of config to be sent in when registering a mob in the MobManager can be found by calling the method GetMobAIInfo() on the MobAIType.
Hi. I wonder if it is not possible to use Xml configuration with classes in your code to control NPCs.I mean Greylingi + Custom NPCs could reference the same code simultaneously. Custom NPC will be spawn Used SPAWN THAT.
Friendlies Reloaded does that but they have made their own AI for the NPCs. If they included an option to use the built in AI classes (worker, fixer, sorter) on the NPCs they spawn you would get what you are looking for. We have a new project in the making that will utilize MobAILib for human NPCs but it is only just started.
Can I apply this to RRR NPCS? I have a few custom NPC followers that I'd like to apply the worker AI behavior to. Do I need to know how to code to do this? Or can I mess around in notepad and .cfg files to pull it off?
I got my "Stig", he follows, he learns when I click on kiln, furnace and maybe a couple other things. He ate resin out of a chest for a while, but now he just walks around bored all the time, despite chests, mats and task available. Wont even pick up wood from the ground, the bum. Is this related to those warnings? Is the game not able to find what it's looking for? Will keep tinkering, cheers!
74 comments
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ObjectDB.GetAllItems (ItemDrop+ItemData+ItemType type, System.String startWith) (at <843a49d5cb48439fa5a62a7bcd81c2a9>:0)
RagnarsRokare.MobAI.BasicFarmingBehaviour.Init () (at <6b99871f044a41edb3521615f09bf60d>:0)
RagnarsRokare.MobAI.ItemSortingBehaviour.Configure (RagnarsRokare.MobAI.MobAIBase aiBase, Stateless.StateMachine`2[TState,TTrigger] brain, System.String parentState) (at <6b99871f044a41edb3521615f09bf60d>:0)
RagnarsRokare.MobAI.SorterAI..ctor (MonsterAI instance, RagnarsRokare.MobAI.MobAIBaseConfig config) (at <6b99871f044a41edb3521615f09bf60d>:0)
System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Activator.CreateInstance (System.Type type, System.Object[] args) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
RagnarsRokare.MobAI.MobManager.CreateMob (System.String uniqueId, BaseAI baseAI) (at <6b99871f044a41edb3521615f09bf60d>:0)
RagnarsRokare.SlaveGreylings.MobAILib+MonsterAI_UpdateAI_Patch.GetOrCreateMob (System.String uniqueId, MonsterAI instance, ZNetView nview) (at <6b99871f044a41edb3521615f09bf60d>:0)
RagnarsRokare.SlaveGreylings.MobAILib+MonsterAI_UpdateAI_Patch.Prefix (MonsterAI __instance, System.Single dt, ZNetView& ___m_nview, Character& ___m_character, System.Single& ___m_timeSinceHurt, System.Single& ___m_jumpInterval, System.Single& ___m_jumpTimer, System.Single& ___m_randomMoveUpdateTimer, System.Boolean& ___m_alerted) (at <6b99871f044a41edb3521615f09bf60d>:0)
(wrapper dynamic-method) MonsterAI.DMD<MonsterAI::UpdateAI>(MonsterAI,single)
BaseAI.FixedUpdate () (at <843a49d5cb48439fa5a62a7bcd81c2a9>:0)
//Morgh
Im not sure what the current status is but you will still need to install friendlies reloaded to have the NPCs.
//Barg
[Warning: Unity Log] MobController:RagnarsRokare.MobAI.SorterAI
[Warning: Unity Log] MobController:RagnarsRokare.MobAI.FixerAI
[Warning: Unity Log] MobController:RagnarsRokare.MobAI.WorkerAI
[Warning: Unity Log] MobController:RagnarsRokare.MobAI.Mobs.ExampleAI
I need to put something in the config to make the npcs can work or something?
And yes, even after the update from January.
Also, the game was just updated to 208.1, so I wouldn't be surprised if it breaks some mods.
Might help also for Friendlies, but I am not sure.
//Morgh
//Morgh
[Error : Unity Log] MissingMethodException: Container RagnarsRokare.MobAI.Common.FindRandomNearbyContainer(BaseAI,RagnarsRokare.MobAI.MaxStack`1<Container>,string[],single)
Stack trace:
Stateless.StateMachine`2+StateConfiguration+<>c__DisplayClass78_0[TState,TTrigger].<OnEntry>b__0 (Stateless.StateMachine`2+Transition[TState,TTrigger] t, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2+EntryActionBehavior+Sync[TState,TTrigger].Execute (Stateless.StateMachine`2+Transition[TState,TTrigger] transition, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2+StateRepresentation[TState,TTrigger].ExecuteEntryActions (Stateless.StateMachine`2+Transition[TState,TTrigger] transition, System.Object[] entryArgs) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2+StateRepresentation[TState,TTrigger].Enter (Stateless.StateMachine`2+Transition[TState,TTrigger] transition, System.Object[] entryArgs) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].EnterState (Stateless.StateMachine`2+StateRepresentation[TState,TTrigger] representation, Stateless.StateMachine`2+Transition[TState,TTrigger] transition, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].HandleTransitioningTrigger (System.Object[] args, Stateless.StateMachine`2+StateRepresentation[TState,TTrigger] representativeState, Stateless.StateMachine`2+Transition[TState,TTrigger] transition) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].InternalFireOne (TTrigger trigger, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].InternalFireQueued (TTrigger trigger, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].InternalFire (TTrigger trigger, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].Fire[TArg0] (Stateless.StateMachine`2+TriggerWithParameters`1[TState,TTrigger,TArg0] trigger, TArg0 arg0) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
FriendliesAI.EatingBehaviorF.Update (RagnarsRokare.MobAI.MobAIBase instance, System.Single dt) (at <c42efe0d7022416db692357655926076>:0)
FriendliesAI.NpcAI.UpdateAI (System.Single dt) (at <c42efe0d7022416db692357655926076>:0)
RagnarsRokare.SlaveGreylings.MobAILib+MonsterAI_UpdateAI_Patch.Prefix (MonsterAI __instance, System.Single dt, ZNetView& ___m_nview, Character& ___m_character, System.Single& ___m_timeSinceHurt, System.Single& ___m_jumpInterval, System.Single& ___m_jumpTimer, System.Single& ___m_randomMoveUpdateTimer, System.Boolean& ___m_alerted) (at <dfb57de4b90240f3a5b5ef52700f0f84>:0)
(wrapper dynamic-method) MonsterAI.DMD<MonsterAI::UpdateAI>(MonsterAI,single)
(wrapper dynamic-method) BaseAI.DMD<BaseAI::FixedUpdate>(BaseAI)
Thanks, I'm glad you like it. :)
This seems to be an issue where Friendlies is using a method in MobAILib that has been changed.
I will add back a stub for the old method signature.
Thank you for letting me know!
//Barg
Are you still getting this error?
//Barg
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ObjectDB.GetAllItems (ItemDrop+ItemData+ItemType type, System.String startWith) (at <dcb0de0155834d459f18d7ac6ea5244b>:0)
RagnarsRokare.MobAI.FixerAI+<>c__DisplayClass56_0.<ConfigureAssigned>b__6 (System.ValueTuple`2[T1,T2] args) (at <753c78701e754f7a88ab35d37935b95a>:0)
Stateless.StateMachine`2+TransitionGuard+<>c__DisplayClass4_0`1[TState,TTrigger,TArg0].<ToPackedGuard>b__0 (System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2+TransitionGuard+<>c__DisplayClass17_0[TState,TTrigger].<UnmetGuardConditions>b__0 (Stateless.StateMachine`2+GuardCondition[TState,TTrigger] c) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
System.Linq.Enumerable+WhereSelectListIterator`2[TSource,TResult].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
Stateless.StateMachine`2+TransitionGuard[TState,TTrigger].UnmetGuardConditions (System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2+TriggerBehaviour[TState,TTrigger].UnmetGuardConditions (System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2+StateRepresentation+<>c__DisplayClass39_0[TState,TTrigger].<TryFindLocalHandler>b__0 (Stateless.StateMachine`2+TriggerBehaviour[TState,TTrigger] h) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].ToArray () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
Stateless.StateMachine`2+StateRepresentation[TState,TTrigger].TryFindLocalHandler (TTrigger trigger, System.Object[] args, Stateless.StateMachine`2+TriggerBehaviourResult[TState,TTrigger]& handlerResult) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2+StateRepresentation[TState,TTrigger].TryFindHandler (TTrigger trigger, System.Object[] args, Stateless.StateMachine`2+TriggerBehaviourResult[TState,TTrigger]& handler) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].InternalFireOne (TTrigger trigger, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].InternalFireQueued (TTrigger trigger, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].InternalFire (TTrigger trigger, System.Object[] args) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
Stateless.StateMachine`2[TState,TTrigger].Fire[TArg0] (Stateless.StateMachine`2+TriggerWithParameters`1[TState,TTrigger,TArg0] trigger, TArg0 arg0) (at <58ab5bdb569a455f90e9307c41aacb15>:0)
RagnarsRokare.MobAI.FixerAI.UpdateAI (System.Single dt) (at <753c78701e754f7a88ab35d37935b95a>:0)
RagnarsRokare.SlaveGreylings.MobAILib+MonsterAI_UpdateAI_Patch.Prefix (MonsterAI __instance, System.Single dt, ZNetView& ___m_nview, Character& ___m_character, System.Single& ___m_timeSinceHurt, System.Single& ___m_jumpInterval, System.Single& ___m_jumpTimer, System.Single& ___m_randomMoveUpdateTimer, System.Boolean& ___m_alerted) (at <753c78701e754f7a88ab35d37935b95a>:0)
(wrapper dynamic-method) MonsterAI.DMD<MonsterAI::UpdateAI>(MonsterAI,single)
(wrapper dynamic-method) BaseAI.DMD<BaseAI::FixedUpdate>(BaseAI)
This mod can only be used through another mod, like SlaveGreylings or Friendlies Reloaded.
If you are writing your own mod that uses MobAILib the type of config to be sent in when registering a mob in the MobManager can be found by calling the method GetMobAIInfo() on the MobAIType.
//Barg
//Barg
Friendlies Reloaded does that but they have made their own AI for the NPCs.
If they included an option to use the built in AI classes (worker, fixer, sorter) on the NPCs they spawn you would get what you are looking for.
We have a new project in the making that will utilize MobAILib for human NPCs but it is only just started.
//Barg
It is actually.. https://valheim.thunderstore.io/package/Oran1/MobAILib/
Not uploaded by me but Im fine with that as long as there is a link back here.
//Barg
[Warning: Unity Log] MobController:RagnarsRokare.MobAI.SorterAI
[Warning: Unity Log] MobController:RagnarsRokare.MobAI.FixerAI
[Warning: Unity Log] MobController:RagnarsRokare.MobAI.WorkerAI
[Warning: Unity Log] MobController:RagnarsRokare.MobAI.Mobs.ExampleAI
I got my "Stig", he follows, he learns when I click on kiln, furnace and maybe a couple other things. He ate resin out of a chest for a while, but now he just walks around bored all the time, despite chests, mats and task available. Wont even pick up wood from the ground, the bum. Is this related to those warnings? Is the game not able to find what it's looking for? Will keep tinkering, cheers!