Home   Help Search Login Register  

Author Topic: SQS Replaced?  (Read 1937 times)

0 Members and 1 Guest are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
SQS Replaced?
« on: 21 Jun 2007, 21:49:05 »
Right, I'm getting ArmA next week so I want to be prepared once it arrives. So I had a look around at the Biki to see what has changed (editing-wise) from OFP to ArmA. The Biki states that while SQS is still supported, SQF is the primary language. Why? I never really learnt SQF back in the day because I was scared looking at the syntax, but wasn't SQF merely a complement to SQS? I understand that there are several advantages (and disadvantages) to both formats, but can someone give me a little background to why the SQS is treated as obsolete?

I tried searching the forums and I just ended up with topics in which loops were named after various culturally-tabooed body-openings. :whistle:

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: SQS Replaced?
« Reply #1 on: 21 Jun 2007, 22:03:39 »
Well, the good point about sqf is that now Sleeps are supported there, so you are not limited to "fast" functions anymore. And sqf scripts (not functions) are compiled by execVM and executed so they are not "parsed" every time as with SQS which means they consumes less CPU and are more efficient. But for scripts where you have > 1 sec sleeps SQS are still perfectly valid, just as valid as in OFP.

SQF has another advantage when executed with execVM, execVM command returns an script handler and you may use it to terminate the script from outside and/or to check whether that script is finished or not. For example:

_script = execVM "myscript.sqf"
@scriptDone _script
hint "Script finished"


Or


_script = execVM "myscript.sqf"
~5
?!scriptDone _script
terminate _script

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re: SQS Replaced?
« Reply #2 on: 22 Jun 2007, 02:01:50 »
Thanks for the answer mate. Looks like it's time to learn SQF-syntax then. :)

Offline Cheetah

  • Former Staff
  • ****
Re: SQS Replaced?
« Reply #3 on: 22 Jun 2007, 10:22:14 »
This should get you started.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: SQS Replaced?
« Reply #4 on: 22 Jun 2007, 20:28:35 »
I'm sure there are better opportunities in SQF writing, but the SQS you learned in OFP still 95% applies to Armed Assault, so you should have no problems jumping in and creating.  I've been able to use old OFP stuff for most of my mission.

Offline Sick

  • Members
  • *
    • Dev-Heaven.net
Re: SQS Replaced?
« Reply #5 on: 03 Jul 2007, 15:09:53 »
SQF is especially better when you have to repeat the same script or function  more often in the same mission.
Especially when much of such things are happening in the mission.

preProcessFile, spawn and call, are your friends :-)

I recommend anyone to simply quit SQS and work in 1 language-only, not only because SQF is better in many cases, but also so you don't have to develop in 2 different scripting formats but simply keep to 1, easier for yourself, easier for others in the end aswell...
1 Syntax to rule them all :-)

Offline benreeper

  • Members
  • *
  • I'm a llama!
Re: SQS Replaced?
« Reply #6 on: 04 Jul 2007, 02:14:09 »
SQF also feels better to program.  It's closer to what you will find in the real world.  Since SQS is line based I used to need 3 to 4 SQS scripts to do what 1 SQF script can do.  This also makes the code easier to read and edit. 
--Ben