Using Includes

By HeliJunkie

Using the #include statement

Dialogs are not the only thing that is defined in the description.ext. So it's good practice to place dialog definitions in a separate file, it also helps with organization! The file can be named anything as long as the extension is named .hpp. In my scripts I mostly name the file "dialog.hpp" and placed it in a subfolder for a dialog.

Outsourcing of dialog definitions

For better organization I outsource the dialog definitions too. We create a subfolder in our mission directory named "TutorialDialog". Then we move our "description.ext" to this new directory. Now we rename it to "dialog.hpp". We create a new description.ext in the main mission directory. Then we type the follwing code into our new description.ext:

#include "TutorialDialog\dialog.hpp"This command includes the file "TutorialDialog\Dialog.hpp" at this place in the description.ext. So we can deactivate the whole dialog configuration by deleting one line. On the other hand, we can merge our dialog in other missions, by copying the "TutorialDialog" folder to our new mission folder, and adding only the one line to the description.ext of our new mission.