Closed lapolla closed 1 year ago
@lapolla
GetSceneActors
can be used to obtain actors in event handler.
It can, but unlike NAF::SceneStarted it returns empty array:
Function OnNAFSceneEnd(NAF:SceneId akScene)
Actor[] kActors = NAF.GetSceneActors(akScene)
Notify(akScene + ":" + kActors)
I guess it has something in common with that comment:
;Returns all actors in akScene. If the scene does not exist, an empty array will be returned.
Actor[] Function GetSceneActors(SceneId akScene) Native Global
Ah, yes. At the moment of OnSceneEnd
triggering the scene is already removed from the list of active scenes.
@Deweh
We need a way to obtain list of actors in OnSceneEnd
event handler.
In addition, we need to know the position ID (if it was assigned to the scene) of the finished scene.
Maybe it should be better to pass full scene details in the OnSceneEnd
event. What do you think?
Ah, yes. At the moment of
OnSceneEnd
triggering the scene is already removed from the list of active scenes.@Deweh We need a way to obtain list of actors in
OnSceneEnd
event handler. In addition, we need to know the position ID (if it was assigned to the scene) of the finished scene.Maybe it should be better to pass full scene details in the
OnSceneEnd
event. What do you think?
Yes, that would probably be the cleanest way to handle this case.
There are ways of keeping the scene in the active scenes map until all OnSceneEnd event handlers finish executing, but that may be bug-prone.
NAF::SceneEnded event should contain the list of actors involved.
Or why not build and send AAF:OnSceneEnd custom event. That way will trigger all mods depending on that hook?