Clone this wiki locally
How to understand SQF Syntax:
SQF is a pseudocode based in C syntax, but without many advanced functions as pointers or memory allocators. Also, SQF has many functions related to the RV Engine that makes the life easier. It's used in MODs and also in the main game files, in both cases the code is executed through an API wrote in C# (NET).
If you know how to code in C, C++, C# or even java, you'll know how to code in SQF, and this is why you should start with the basic from one of these languages.
The next step, is learning the SQF functions. Here are some of them:
|player||the player that is executing the script.||
|exitWith||exits the current scope.||
|waitUntil||waits 'till something is done. (Only for spawned scripts).||
|forEach||selects each value from an array and executes a code with it set as _x.||
|isNull||checks if something returns as objNull.||
|remoteExec||spawns a function in MP for each player set.||
|remoteExecCall||calls a function in MP for each player set.||
|playerSide||returns the player side||
You can find all the functions in Bohemia's wiki.
Spawn vs Call
The main diference is that, when calling something, all the script after that will wait 'till it's done. Also, only spawned scripts can take use of suspension functions as "sleep" and "waitUntil". (execVM can too, but it isn't the case here.)
Since you know how to code, remember always to keep the file style (spacing, etc.) for a better reading.
Also, never forget the semicolon.