SCAR is the scripting language for Dawn of War, standing for Scripting at Relic.
It is used mainly in the single player missions, but comes 3 file forms:
. SCAR files – These contain the scenarios program, how it works, objectives, players, and events. They can be used for multiplayer win condition files too.
. NIS files – These are None Interactive Sequence files. They are cutscenes (at the start and end of levels), information, and suchlike.
SCAR uses the LUA scripting language, which is mearly a basis for what they have changed it to. Several LUA things would make no sense in Dawn of War (such as GUI related functions).
Note that all SCAR files are compiled at run time, and this makes debugging harder (as you have to run the code until it fails and gives a FATAL SCAR ERROR and stops the program – see Debugging.
Textpad Syntax File
One way to edit SCAR's plain text files is to use Textpad, and use a syntax file to highlight the code. To do this, firstly download the syntax file: here (you may need to Save Target As to download).
Then, place it in your samples directory, which for the latest version 4, is: C:\Program Files\TextPad 4\Samples
Then, once you open textpad, go to the menu Configure -> New Document Class. You can put any name, but DOW SCAR will probably to. Class members are: *.nis, *.scar, *.ai. Note: the AI files use a lot of custom functions, and so not as useful for that.
For the next page, you must Enable Syntax Highlighting, and choose the scar.syn file from the dropdown box – if you have put it in the right place, that is! Then click Finish.
This document class will appear in the Preferences menu. It is recommended to turn on Strip Trailing spaces from lines when saving, just to save some extra space, which would otherwise be wasted unnessissary extra whitespace. You can also modify the colours here, and selecting a different colour (eg: dark red) for Keywords 2, makes some things better distinguished.
These beginner tutorials should be done in step by step, and allows you to build up knowledge of how SCAR works (wether you have coded before or not). It will start with very general things, and build up to the singleplayer SCAR files.
SCAR is a very easy language to use, because Dawn of War doesn't do very many complicated things (the entire scenario is contained within one file!).
Once you have completed the tutorials, you should be able to make singleplayer SCAR files very easily.
These are done by FinalDeath:, and uses expamples from Dawn of War's singleplayer campaign, and some new scripts.
The functions in SCAR, while avalible at ScarDoc, are not editable (and not updated for later patches), and do not include other notes.
Once complete, the Functions section will contain all avalible game functions to use in SCAR scripts, as well as appropriate examples, notes, revisions and updates. Each function will have its own sub-page. The functions page will link to the index and category pages where you can find list of the SCAR functions.