Given the new structure of the API, this does no longer work. How do I create a relationship between the npc_behavior and my creative_device(s)? From what I gather, there is no way (?) of calling methods in the npc_behavior script from the creative_device, so I still need to find a way to call find the creative_device from the npc_behavior setup.
Appreciate all the help from the masterminds out there.
That’s exactly how I did this prior to the latest update.
However, the new FindCreativeObjectsWithTag method requires me to have a reference to the creative device and I’m trying to figure out how to pass that to the npc_behavior script.
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} }