Fandom

武装突袭 Wiki

SQS syntax

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 Share

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

SQS syntax (where SQS stands for Status Quo Script) was the main syntax in Operation Flashpoint and is still available in Armed Assault. It can only be used for scripts, but not for functions, in the Mission Editor or in addon config files. The alternative syntax is SQF syntax.

Rules 编辑

Binding rules:

  • Statements are separated by line breaks and semicolons (;) and commas (,). This means that a statement must not span over multiple lines.
  • Curled braces ({ }) group code to blocks. A block is considered a single statement, thus may not span over multiple lines.

Example:

STATEMENT 1
STATEMENT 2; STATEMENT 3, STATEMENT 4

BLOCK { STATEMENT 5; STATEMENT 6 }

Comments 编辑

A line beginning with a semicolon (;) is considered a comment and ignored by the game engine.

Example:

; this is my comment

Language Constructs 编辑

The control structures listed in the article Control Structures may also be used in SQS syntax. Note that they must be written within a single line due to the above rules.

Example:

if (_value==1) then {hint "Value is 1"} else {hint "Value is not 1"}

There exist also special structures limited to SQS syntax.

Label 编辑

You may define labels in the code by beginning a line with #, followed by the name of the label (without spaces). You may use the command goto at any point of the script to jump to this label.

#Label1

CODE

goto "Label1"

Conditional 编辑

You may query a Boolean condition and define code, that is executed only when the condition is true. Note that there is no equivalent for "else". A conditional line must start with ?, followed by the condition and :, followed by one or more commands. Multiple commands are separated by commas (,) or semicolons (;). The conditional statement ends with the end of the line.

? CONDITION : STATEMENT 1; STATEMENT 2

@ 编辑

Much like the waitUntil statement in SQF syntax, @ will evaluate a certain condition, and the script will pause until @ returns true.

@ CONDITION

Notes 编辑

Due to line-based nature of Sqs scripts it is not possible to create multiline string constants in them. To overcome this limitation you can store multiline in separate SQF function files and load them using loadFile or preprocessFile (the second uses C-like preprocessor with // or /* */ comments and #define macros).

Limitations 编辑

In OFP v1.96, if a single line of a sqs file is longer than 4096 characters, OFP will return an error and will not execute the line.

See also 编辑

更多维基

随机维基