# Advanced Strategic Command

documentation

## Textfiles

Text files are used in ASC several cases. The most important are:

- description of vehicle types
- description of technologies
- the online help
- message events

For vehicles and technologies the text files are embedded in the file of the vehicle type or the technology while the online help and message events load the textfiles at run time.

The textfiles may contain tags that control the format of the output. Tags start and end with the character `#`. The following tags are defined:

`#colorX#`
  changes the color to X. Available values are 0 to 255. The colors are defined in the palette of ASC which is for example contained in every screenshot. The following colors are 'fixed' and recommended to be used:

  0 | black
  1 | blue
  2 | green
  3 | cyan
  4 | red
  5 | magenta
  6 | brown
  7 | light gray

`#backgroundX#`
  Changes the background color to X. The values are the same as for `#colorX#`.
`#fontX#`
  Changes the font. The following fonts are available at the moment:

  1 | small Arial font (same as in Pull down menu)
  2 | large Arial font (for captions etc.)

  If you want to use different font sized in the same line please note that the fonts are not vertically justified by the base line but by their top line (so avoid it please).
`#tabX#`
  Puts tabstops with a width of X. The horizontal text position will be set to the next multiple of X.
`#posX#`
  Sets the horizontal position to X.
`#aeinzugX#`
  Sets the left space to X (default is 0). The first line of a paragraph is not affected, the left space of it is set by `#eeinzugX#`
`#eeinzugX#`
  Sets the left space of the first line of every paragraph to X (default is 0).
`#crt#`
  Stars a new paragraph. A EOL (end of line) in the textfile is internally converted to a #crt# too.
`#crtpX#`
  Same as `#crt#` but makes a free space between both paragraphs of X pixel more than `#crt#` would do.

Since any EndOfLine in the textfile starts a new paragraph you have to write each paragraph in a single line !

### Message events and help files

The textfiles that are loaded at runtime have some enhancements:

- They may contain comments. Each line that starts with the `;` character is not interpreted and ignored.
- A textfile may contain several sections. A section starts with the character sequence `##xxxx` with xxxx a number having 4 digits. This sequence must have exactly 6 characters and must have a line for its own! A section ends with the next `##xxxx` or the end of the file. The section is identified by its number `xxxx`. For message events this number must be entered in the mapeditor when defining the message event. Please note that any empty lines before a `##xxxx` will be visible as free space in the previous section.

A note at the end: Does anybody know of an easy to implement web browser? I would like to use plain HTML files for these texts but don't want to write a html interpreter myself...