SSLC - Documentation


Содержание

Decompilator

int2ssl by Anchorite (TeamX) is included in sfall modderspack package. It was updated to support all additional opcodes of sfall, along with some syntax features. You can use it to decompile any sfall or non-sfall script.

Fixes


Compilator

This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional scripting functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer.

Unlike the original script compiler, this has not been compiled as a dos program. When using this in place of the original compile.exe but still using p.bat, you need to either get rid of the dos4gw.exe reference from p.bat or replace the original dos4gw.exe with the one in this archive.

If you use fallout script editor, you can extract compile.exe and dos4gw.exe to its \binary folder, or extract them somewhere else and change your preferences in FSE to point there. FSE doesn’t seem to be able to tell when errors occur when using this compiler though, so I’d recommend either using sfall’s script editor instead or compiling by hand if possible.

When compiling global or hook scripts for sfall 3.4 or below, you must include the line procedure start; before any #includes that define procedures to avoid a few weird problems. (this is no longer required starting from 3.5)

This version of compiler was designed primarily for new sfall functions, but it can safely (and is recommended) to be used with non-sfall scripts as well, as long as you don’t use any of the arrays syntax and any sfall scripting functions.

The original unmodified sslc source is over here: http://www.teamx.ru/site_arc/utils/index.html.

Command line options

-q  don't wait for input on error
-n  no warnings
-b  backward compatibility mode
-l  no logo
-p  preprocess source (don't generate .int)
-O  optimize code (full by default, see optimization.md)
-O<N> set specific level of optimization (0 - off, 1 - basic, 2 - full, 3 - experimental)
-d  print debug messages
-D  output an abstract syntax tree of the program
-o  set output path (follows the input file name)
-s  enable short-circuit evaluation for all AND, OR operators
-m<macro[=val]> define a macro named "macro" for conditional compilation
-I<path> specify an additional directory to search for include files

The original command line option -w to turn on warnings no longer has an effect, since warnings are now on by default


Дополнительный поддерживаемый синтаксис

Используемый синтаксис ниже, требует наличия sfall для скомпилированных скриптов.


SSL Optimization

The executation speed of scripts is not typically important in an unmodded game, given the difference in performance between a modern computer and what Fallout was designed for. When you start adding mods to the mix there’s the potential for problems again, since sfall’s global script system means that you can have a large amount of scripts being run every single frame.


Compilator: -O option

The sfall build of sslc supports a -O command line option to perform an optimization pass over the generated code. This isn’t a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It’s primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes define.h, whether you use them or not, and to do something about the additional variables that get created by foreach loops.

There are several levels of optimization available:

The following optimizations are performed:

Writing your own code


SSLC Changelog

v1.5.1:


v1.5.0:


v1.4.0:


v1.3.1:


v1.3.0:


v1.2.3:


v1.2.2:


v1.2.0:


v1.1.0:


v1.0.0:


SFALL 4.0: (нумерация версии компилятора не велась)


SFALL 3.8:


SFALL 3.6:


SFALL 3.5:


SFALL 3.4:

Backward compatibility (obsolete)

There are several changes in this version of sslc which may result in problems for previously working scripts. A new command line option -b is available, which will turn off all new fixes and features which have the possibility of causing a previously compiling script to change its behaviour. (And only those features; anything which would not compile under the old sslc is not affected.) This includes the following: