All individual files are compiled into a final story (story.div.osi). The other files are used to generate this, some contain function definitions, others story goals, etc.
The final story file is needed because we run the story based on that one file. It is a compiled result of everything relevant to the game you are running.
When you enable a mod, a custom story is built at runtime that uses the header and goal files of all relevant modules to create the final story for the game. Also when running from an existing savegame, if a change to the add-on setup is detected, those new goals, etc. get patched in/out of the existing story. (It's also how we patch in story changes to the actual game).
Having a story.div.osi on disk as well, next to the runtime compile allows us to skip that runtime compile when no mods are enabled or when a certain setup is invalid/corrupted which then makes the runtime compile fail gracefully by using the fallback story. Granted, the local story.div.osi is not relevant for add-ons, only for adventures.
Last edited by Larian_KVN; 27/09/17 04:11 PM.