Templates
Templates are used when new files are
created by the user. If you use Packafied just for file editing,
you need not concern yourself with creating new templates. If you
are developing HFD files, FD files,
or loaders, you should know
how to create templates.
How Packafied identifies Template files
In the templates directory, there are a number of files with an
extension of ptd
, which stands for Packafied Template
Description. These files are text files that describe one
template each.
The first line in a PTD file contains the name of the file it
represents. If you have a file called D3Hog.ptd
, it's first line
might point to a file called newd3.hog
, which must also
be in the templates directory. The file newd3.hog is a package file
with no files in it, an empty package file. This file is copied
every time the user creates a new file of this type.
The second line contains a description of the template. A good
description for D3Hog.ptd
would be Empty Descent 3
Demo HOG file.
How to create a template
- Create an empty package file of the type you want to make a
template for. This usually means
selecting all the files
and using the Delete command.
- Copy this empty file to the templates directory. Give it a
meaningful name, but don't change the extension.
- Create a new text file with your favourite text editor (or the
one that came with Pacakfied). Give it a meaningful name, and give it
an extension of
ptd
.
- In your text editor, enter the name of the template file (used
in step 2) on the first line. Only specify the file name, not the
path.
- On the second line, type a description for your template.
Save the text file and exit your text editor.
That's it! You now know how to create template files.