DIF/QuArk/Exporting

From TDN

Exporting a DIF file from QuArK

Once you have constructed your masterwork level, it is time to export it to DIF format so that it can be viewed in-game. A variety of export options can be found under the <Torque> menu when your mapfile is open. The first five options are the ones that we are most interested in.

QuArK Default Export Options

Export MapFile Only: This option creates a .map file of your scene. Since this step is done automatically when a DIF is build, this is not useful to us unless we want to import the file into another program that supports .map.

Prepare Used Textures: This step copies the textures used in the interior into the /tmpQuark/textures/ folder. Note that we will still have to put the textures into the interiors folder for our game manually. This step is not particularly useful on its on, as it is performed automatically when a DIF is created.

Build DIF file only: This creates a high-detail DIF file of our interior. It does not run the .map or texture export options first and will fail if no mapfile is present.

Export220Map/Build High Detail DIF: This is the export option that we will be using most often. It prepares the Mapfile, then exports a DIF file with all DIF options enabled, including LOD if it is present. If you aren't sure which export option to use, use this one.

Export220Map/Build Low Detail DIF: This is similar to the above option; it builds the map and texture files, but the DIF file produced does not include LOD information. This is useful for testing a single LOD shape of an interior, without other LOD information being included.

Advanced users can create their own export options. The command line options for the map2dif exporter can be found in Appendix E, The Map2Dif Utility.

Once your map is exported, you will need to copy it into your /data/interiors folder so that your game can see it. This folder is located inside your game folder in the Torque directory. For the demo application, it would be torque/example/demo/data/interiors/.

DIF files can be accessed from this folder or from any of its subfolders. Your textures must also be present either in the interiors folder, or the same subfolder as the DIF file itself.

If you are using .PNG textures, you will want the .PNG versions to be in you /data/interiors folder or subfolder, while the .JPG copies that you are using with QuArK are stored elsewhere.

Loading Your Interiors In-Game

This is a quick overview on how to load your interiors into the mission editor. This is covered in detail in Chapter 4, Mission Editor Introduction.

Open your game, or the Torque Demo if you don't yet have your game set up.

Press F11 to open the Mission Editor

Press F4 to show the World Editor Creator options, or select it from the Window menu.

Browse through the creation hierarchy to Interiors\(game name)\data\interiors\, and select your interior as shown in the figure below. You object will appear in the scene with no lighting from the sun.

Loading a DTS Interior in the Mission Editor

Adjust your interior's location as desired.

Relight the scene by pressing Ctrl-L. This will light your object. It may take several seconds.

Exit the mission editor (F11) and explore your interior in-game!