I had a thought regarding the relatively recent
eventVideoDone discussion. It should have more libcampaign support, ideally we should provide a function like this:
Code: Select all
function eventStartLevel() {
// Calls `hackAddMessage("MB1D_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);` instantly.
// Or maybe not instantly, if there are already videos in the playlist.
// Calls `hackAddMessage("MB1D_MSG2", MISS_MSG, CAM_HUMAN_PLAYER, true);` on the next eventVideoDone.
// Support as many arguments as necessary, maybe pass the list of videos as an array if you prefer that.
camEnqueueVideo("MB1D_MSG", "MB1D_MSG2");
}
In order to make this work, you'd have to let libcampaign subscribe to
eventVideoDone and pop items from some "playlist" variable one by one (while the new function populates the playlist). While doing so, you shouldn't break the possibility to subscribe to
eventVideoDone from within the level code as well, as the user may want to make other actions there. Which is why we use
javascript hooks in libcampaign to subscribe to events, implemented by
__camPreHookEvent(). We already use this for a lot of things, like detecting artifact pickup, or tracking transporter movements.
This way we also prevent the level author from calling a "hack"-prefixed function.
Anybody likes this idea?