Fandom

武装突袭 Wiki

SQS to SQF conversion

简体 | 繁體

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

您使用了广告屏蔽软件!


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

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

What's different in SQF编辑

  • Every command has to end with semicolon.
  • SQF does not have a goto command anymore.
  • SQF commands can span several lines if they are enclosed in brackets.
  • SQF can return a variable, where SQS cannot.

Replacing编辑

Comment编辑

SQS
; This is a comment
SQF
// This is single-line comment
/* This is multiline
   comment
*/
comment "And this is a comment working both in SQS and SQF";


Condition编辑

SQS
@CONDITION
SQF
waitUntil {CONDITION};


Delay编辑

SQS
~DELAY
SQF
sleep DELAY;


Conditional command编辑

SQS
?CONDITION: COMMAND
SQF
if (CONDITION) then {COMMAND};


Multi-conditional command编辑

SQS
?CONDITION: goto "SKIP"
 COMMAND_2
 goto "END"
#SKIP
 COMMAND_1
#END
SQF
if (CONDITION) then {COMMAND_1} else {COMMAND_2};


Cycle编辑

SQS
#loop
 COMMAND
 ~DELAY
?CONDITION: goto "LOOP"
SQF
while {CONDITION} do {
 COMMAND;
 sleep DELAY;
};


Cycle with step编辑

SQS
_n = 0
#LOOP
 COMMAND
 _n = _n + 1;
?_n < COUNT: goto "LOOP"
SQF
for [{_n = 0},{_n <= COUNT},{_n = _n+1}] do {
 COMMAND;
};


Structured conditional command编辑

SQS
?VARIABLE == VALUE_1: goto "SKIP_1"
?VARIABLE == VALUE_2: goto "SKIP_2"
 DEFAULT COMMAND
 goto "END"
#SKIP_1
 COMMAND_1
 goto "END"
#SKIP_2
 COMMAND_2
#END
SQF
switch (VARIABLE) do {
 case VALUE_1: {COMMAND_1};
 case VALUE_2: {COMMAND_2};
 default {DEFAULT_COMMAND};
};


Exiting编辑

SQS
?CONDITION: goto "Exit"
 COMMAND_1
#Exit
 COMMAND_2
 exit
SQF
if (CONDITION) exitWith
{
 COMMAND_2;
};
COMMAND_1;


See Also 编辑

更多维基

随机维基