/// </summary>
[DataField("blackboard", customTypeSerializer: typeof(NPCBlackboardSerializer))]
public NPCBlackboard Blackboard = new();
+ // TODO FULL GAME SAVE Serialize this
}
/// </summary>
[ViewVariables]
public HTNPlan? Plan;
+ // TODO FULL GAME SAVE serialize this?
/// <summary>
/// How long to wait after having planned to try planning again.
base.Initialize();
SubscribeLocalEvent<HTNComponent, MobStateChangedEvent>(_npc.OnMobStateChange);
SubscribeLocalEvent<HTNComponent, MapInitEvent>(_npc.OnNPCMapInit);
+ SubscribeLocalEvent<HTNComponent, ComponentStartup>(_npc.OnNPCStartup);
SubscribeLocalEvent<HTNComponent, PlayerAttachedEvent>(_npc.OnPlayerNPCAttach);
SubscribeLocalEvent<HTNComponent, PlayerDetachedEvent>(_npc.OnPlayerNPCDetach);
SubscribeLocalEvent<HTNComponent, ComponentShutdown>(OnHTNShutdown);
WakeNPC(uid, component);
}
- public void OnNPCMapInit(EntityUid uid, HTNComponent component, MapInitEvent args)
+ public void OnNPCStartup(EntityUid uid, HTNComponent component, ComponentStartup args)
{
component.Blackboard.SetValue(NPCBlackboard.Owner, uid);
+ }
+
+ public void OnNPCMapInit(EntityUid uid, HTNComponent component, MapInitEvent args)
+ {
WakeNPC(uid, component);
}