Function – Talk

From Bohemia Interactive Community
Revision as of 20:29, 26 September 2006 by Mr.Peanut (talk | contribs)
Jump to navigation Jump to search

How can engine know if I want to use standard or semicolon free variation? In both is first command semicoloned... --Djura 19:34, 24 July 2006 (CEST)

There is no semicolon free in function-based syntax. Watch the examples, they all have semicolons to separate instructions. When no semicolon, it's a curled-brace, ie an "embedded" function line, or set of instruction. The semicolon free syntax exists in current OFP-style scripts, launched by exec. If I'm not mistaken, once you launch things through call, spawn or execVM, you're using function syntax that requires semicolons to separate instructions. If you still use "exec", you're using OFP-style syntax --Whisper 19:44, 24 July 2006 (CEST)

The deprecation of scripts has not been clearly explained. The proper explanation here and in Script_syntax should be that SQS-script syntax has been deprecated in favour of SQF-script syntax. The differences between an SQF-function and an SQF-script are:

  • 1) SQF-scripts can not return values
  • 2) SQF-scripts can pause and wait using the sleep and waitUntil commands
  • 3) SQF-scripts are run in parallel via the spawn command.

The comments about script deprecation so far led me to believe that all functions would have to run in parallel. I doubt I am the only person so confused.--Mr.Peanut 21:28, 26 September 2006 (CEST)