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):
- Setup a weak map in the creative device required to be called from the npc_behavior.
var GameManagerMap : weak_map(session, game_manager) = map{}
- Populate the weak_map in the OnBegin method of that creative_device:
var currentSession : session = GetSession()
if (set GameManagerMap[currentSession] = Self) {}
- 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} }