User Tools

Site Tools


arma:scripting

This is an old revision of the document!


Scripting

Overview

Scripting in ArmA is changed somewhat from OFP times.

ArmA has “” quotes for STRINGS only and {} curled braces for CODE only. Script commands doesn’t have to be in one line now with the curled braces. Command lines always end with ; instead of a ; *or* carriage return. So you can format code to be more readable

{
    if (condition) then
    {
        DoSomething1;
        DoSomething2;
        DoSomething3;
        DoSomething4;
        DoSomething5;
     };
} foreach array;

Instead of the terrible ofp classic

{if (condition) then {DoSomething1; DoSomething2; DoSomething3; DoSomething4; DoSomething5;};} foreach array;

Comments are no longer the same character as the end of command character.

// my comment
instead of
; my comment

You can use block comments now.

/*
  Comment line 1
  Comment line 2
  Comment line 3
  Comment line 4
  Comment line 5
  Comment line 6
*/

Quotes are no longer a valid substitute for braces.

arma/scripting.1183550266.txt.gz · Last modified: 2007-07-10 09:52 (external edit)