NPC behavior and FindCreativeObjectsWithTag best practice

Great stuff. Managed to resolve the issue based on your direction. Thanks!

For anyone else facing similar issues, I did the following (I imagine there might be cleaner ways to pull this off):

  1. Setup a weak map in the creative device required to be called from the npc_behavior.
    var GameManagerMap : weak_map(session, game_manager) = map{}
  2. Populate the weak_map in the OnBegin method of that creative_device:
    var currentSession : session = GetSession()
    if (set GameManagerMap[currentSession] = Self) {}
  3. Retrieve the creative device in the npc_behavior:
    var currentSession : session = GetSession()
    var GameManager: ?game_manager = false
    if (GameManagerProxy := GameManagerMap[currentSession]) { set GameManager = option{GameManagerProxy} }
3 Likes