This is the write-up for notes on how to use Alint on Windows, some of this applies to the Mac version too.
*Alint Exe Help Notes*
What it does
When scenario designers want to check their scripts for errors, the program to use is Alint. It only checks scripts, it does not check the Bas file for instance.
It is not a text editor it does not check spelling or grammar.
Where to get it
Tridash made a version of his own:
This link found at:
In post "Posted 27 July 2012 - 08:42 AM #24"
It may be Mac only, I could not get it to work on Windows XP
[ Go look again at that "#24", you'll notice that it's actually a
permalink to that post in question. ]
How to use it: Mac
Mac version of Alint comes with help files, they appear to be adequate and should be given priority over what is written here.
According to Niemand there is a GUI version of Alint for Mac, it enables you to avoid the Command Prompt.
How to use it: Windows
You can't run the program by itself, unlike Blades of Avernum. Alint can only be run from the Command Prompt.
It can be placed in the scenario's folder.
Tip from Khoth: Alint can be placed in the C:\Windows directory, then it will be available for any scenario anywhere.
You could also just install Alint wherever and then add it to your %PATH%, which can be done in the Control Panel under System; it varies by OS version, but on Win7 I have to go to Advanced System Settings, click the Advanced tab, and then click the Environment Variables button.
Start the MS-Dos Command Prompt, its shortcut should be found at: Start Menu -> Programs -> Accessories
Next, change the current directory to that of your scenario.
Notes below are written assuming that:
all of your files and programs are found on the C: drive.
in particular they are found in the Program Files directory.
(Installing to the Program Files directory causes no problems in Windows XP but I hear it will lead to hassles in Vista. If you get hassles just install to the root C: (or whatever) directory
Example, Frostbite v1.0.2 by Lazarus, the Frostbite scenario is
C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Frostbite Win\Frostbite
In the Command Prompt type:
cd C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Frostbite Win\Frostbite
Note, "cd" simply means Change Directory.
It is worth noting that, due to the unique way cmd.exe works, if you have the scenario placed on a filesystem that is different than your user profile directory's (such as a flash drive or secondary disk), you first have to put that drive letter in. So, if you're checking a scenario in E:\Profile\Games\BoA\Frostbite, you need to run the following commands:
You can copy the directory location and paste it into the Command Prompt.
Copy: in Windows Explorer right-click any file in the scenario directory, this brings up the Context Menu. Click on the Properties line, found at the bottom of the menu. This brings up the Properties dialog screen. Then in the General tab, look for the word "Location:". Drag the cursor across the location of the file till it is all selected, then copy it. Close the Properties dialog screen.
Paste: If you click on the little black "C\:" button in the upper left corner you can see the word Edit. Hold your cursor over that line to bring up the Edit menu. Click on Paste to paste stuff straight into the Prompt.
On Win7 you can simply drag the file over the command prompt window, and its path will be inserted for you. I'm not sure if this'll work on XP or Vista.
Yes, this does work for XP, Vista I don't know about.
Tip from Khoth: It should be able to handle files with spaces in the name, if you put double quotes round the filename:
alint -w "I like spaces.txt"
If you drag a file to the window, double quotes are automatically inserted for you.
An example of using Alint in practice:
C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Frostbite Win\Frostbite\Scripts>alint -v -w t4spring.txt
Hit Enter and Alint will check the script for errors.
After each lot of alterations, hit the Up Arrow and Enter keys till the file comes up clean.
Alint is not infallible, but between it and the Blades of Avernum game you should be able to clean up the errors. Certain errors will not be detected by Alint but the game itself will give error messages.
Note: the meanings of the switches -v and -w are explained below.
Alint can be used to check all files in the scenario folder. Here is an example for Frostbite.
C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Frostbite Win\Frostbite\Scripts>alint -v -w *.txt
Then you get the errors printout:
C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Frostbite Win\Frostbite>alint -v -w *.txt
Checking file 'abom.txt':
Error line 25: Illegal variable definition
Error line 122: Undeclared variable last_abil_time2
Error line 128: Undeclared variable last_abil_time2
Using Command Prompt is not that hard when you master the menu that appears when you click on the "C:\" icon. Ditto if you know about the DosKey hotkeys. By the way, in the Edit menu "Mark" means to select while moving in an x,y manner.
You can copy and paste the error reports into a document. Choose Select All or Mark to select the error reports, then hit Enter to copy the text and you are ready to paste into the file of your choice.
It's better practice to use redirection
"alint (arguments) > report.txt",
especially with cmd.exe. The standard copy/paste method you suggest injects lots of unneeded line breaks and other formatting errors compared to the original program output.
If you get a lot of errors but don't want to redirect them to a text file, you can do something like the following:
alint -w *.txt | more
This will show the errors one screen at a time; you press space to view the next screen.
Remove any text files that are not BOA scripts, else you will be spammed with errors.
They can be placed in a folder of their own.
Although this does work, it would probably be better practice to work one script at a time, especially for developing. *.txt is great if you just want to open alint on someone else's scenario, say "OMG there are 1,945 bugs in this scenario" and call it a day. Meanwhile, in the real world, those will mostly be false positives and getting the entire scenario output while going through one script in particular probably isn't what you're going for.
There are other ways to do this, if you know how globs work and apply some naming conventions. For example, if you name town scripts using the common naming convention of "t.txt", you can check all town scripts with something like "alint t*.txt". If you do it from powershell, you can check town and outdoor scripts at the same time with something like "alint [to]*.txt". (You enter powershell by typing "powershell" and then pressing enter. I think powershell was a separate download in XP, but it's included in Win7; no idea about Vista.)
at the Command Prompt type HELP DosKey, this brings up a brief help screen.
DosKey: Edits command lines, recalls Windows XP commands, and creates macros.
Command Prompt Help:
at the Command Prompt type Help, this brings up the list of all commands.
To alter the size of the Command Prompt window or to alter the amount of lines it contains at any one time:
click on the "C:\" icon. Then click on the word Properties this brings up a dialog box. In the Layout tab, Screen Buffer Size allows you to set the number of lines that the Prompt can handle, I set it to 3,000.
Alint Program Help Printout:
simply type "alint" or "alint.exe", omit quotes.
C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\goodevil.bas>alint.exe
Usage:alint.exe [-advwV] file ...
-a: Check all files, not just *.txt
-d: Print bison debug trace information (You don't want to do this)
-v: More verbose output
-w: Print warnings
-V: Print current version
Options only apply to files appearing after them
The -a switch seems to handle any type of file not just text, its description makes it sound like a second batch processing command, which it is not.
-d: Print bison debug trace information (You don't want to do this)
This is more for people working on alint (ie with the source code) rather than using alint.
-v: tells you which files have been checked, normally files are only listed if they generate error or warning messages.
First there is a mistake with "fl_shimmers", the Alint source code shows it as "floor_shimmers". So to Alint, the correct name "fl_shimmers" is always wrong while the wrong name "floor_shimmers" is always right.
Then te_cutaway_second_icon is spelled as "te_cutaway_second_item".
As far as I can see, the program does not recognize print_big_str_num.
These errors can't be fixed in the MS-Dos Prompt Edit command.
Then it won't accept the Sanctification state in the sanctitem.txt.
It seems that the Blades documentation is wrong when it says that states over 100 are not possible for towns. I haven't experimented with this much myself, but it seems to be possible to use states with numbers around, and not exceeding, 200. Of course some numbers can never be used:
INIT_STATE (equal to 0)
LOAD_SCEN_STATE (equal to 0)
EXIT_STATE (equal to 1)
START_STATE (equal to 2)
DEAD_STATE (equal to 1)
START_SCEN_STATE (equal to 111)
SEARCH_STATE (equal to 100)
TALKING_STATE (equal to 110)
UNLOCK_SPELL_STATE (equal to 101)
SANCTIFICATION_STATE (equal to 102)
BLOCK_MOVE_STATE (equal to 112)
DISPEL_BARRIER_STATE (equal to 113)
STEP_INTO_SPOT_STATE (equal to 114)
Number range may be from 115 to 199, this will need to be researched.
As I learned the hard way, the variables in the various calls are not checked for magnitude. Thus for put_item_on_spot it accepted an item with the number 3,840.
May not detect the absence of the "i = i + 1;" in a while statement.
This is a "logic error", not a "syntax error". For the most part it's the responsibility of the person writing the script to check these.
Understanding Error Messages.
"i" means integer, a whole number.
"s" means a string, a piece of text.
Have 'i', want 'ii'
Means you have one integer parameter in a BoA call but you actually need two.
Ditto, Have 'ss', want 's'
Means you have two string parameters in a BoA call but you actually need only one.
Have 'i', want ''
You have an integer parameter, but no parameter should be there at all.
Normally these errors will be connected to the wrong use of an Avernumscript call. Check the description of the relevant call in the BoA Editor documentation, see if you entered the wrong kind of variable or whatever.
If that does not work, check all your semi-colons and parentheses.
It may simply want an Enter inserted at the end of a line.
It may also demand lower case letters in things like state names and reserved words like ACTION.
Can show line numbers
Can show which brackets or parentheses are paired, this detects errors when they should be paired but they are not.
If text file is given a C++ Syntax Type, strings and comments will be
In many editors you can go further and define a specific AvernumScript syntax type. I did this for TextWrangler, for example. I expect it's also possible for Notepad++, but I haven't investigated.
Running Alint from an MS-Dos batch file
Save the two lines below to a new file, give it a catch name like
Alint.bat, extension must be .bat.
CD C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil2.bas
alint *.txt > AlintOGE.tbl
When you click on the Alint.bat batch file, the text generated is outputted to a file called AlintOGE.tbl. This can be opened in a text editor. Once it is loaded, every time the batch file is run, the prompt will occur for AlintOGE.tbl to be reloaded.
First line changes the directory to C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil2.bas
Second line runs the batch checking function of Alint, then it outputs the data to a file called AlintOGE.tbl
You can choose any name you like, not just AlintOGE.tbl
Again, put the "C:" bit on a separate line, and note that it should be replaced with whichever drive BoA is installed on. I'd also recommend giving the output file a .txt or .log extension instead of .tbl.
(Original Alint Readme)
(Original Commandline file)
Edited by Ishad Nha, 18 June 2014 - 05:15 AM.