Jump to content
Sign in to follow this  
bfalcon

Can someone just quickly point out how to use SQS and SQF files?

Recommended Posts

Are they just text files and do they require any kind of header?

I learned Pascal many, many years ago and the script language seems similar, but I'm slowly getting the hang of it, but I'm a little confused about the SQS files in particular.

Also, where do I put them? In with the missions, or do they have a special folder? (This is on windows 7 with UAC off, btw).

Share this post


Link to post
Share on other sites

sqs/sqf files are just plain text files, they also have no header at all.

The location for them is your mission folder, you can also place them in any subfolder if you want to. like mymission\scripts etc.

Share this post


Link to post
Share on other sites

Less like Pascal, more like Perl with C-like precompiler.

If you are new - skip sqs and learn the newer sqf notation. You'll be a lot happier with the new control structures,

and have better performing code.

Share this post


Link to post
Share on other sites

Evil: As I understand it, isn't SQS independant of the main timeline, while a sqf the main program waits for it to complete? Wouldn't that cause problems when you have a lot going on?

I'm actually trying to learn both, since I thought they had different applications, but if people do actually think that sqs is less useful, I'll just concentrate on the sqf.

Share this post


Link to post
Share on other sites

The game will continue to run despite what you do with either scripting language. Only if you are stressing the game with heavy scripting will you cause delays in the form of lag.

I think you are talking about the flow of a single SQF script. SQS can use goto to create loops or jump to different code segments. While SQF still uses for, while, and waitUntil loops, once they break out of the loop, they continue to process the code in a linear way. Without first defining functions to call or using spawn to execute a parallel process (code or script), you can't go back in a SQF script or skip to a section unless you are skipping over a section of code that was contained within an if statement that was not satisfied.

I never really learned SQS, but I can safely say that you won't lose any functionality by switching to SQF. I think you can do the same things in either language, the only thing that is changed is how the scripts are written.

Also, there is always FSM if you want to use SQF but be able to design it in a more freeform way.

Share this post


Link to post
Share on other sites

OK, cool thanks for that - you guys might want to sticky this, I've found it both very interesting and helpful as a quick intro into the file formats.

Now I know the differences, I might well stick to SQF, thanks.

Erm FSM?? :)

Share this post


Link to post
Share on other sites

Master sqf first - then FSM via the editor is fairly easy. Besides, you need to use either sqs or preferably sqf in the code sections of your FSM states.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×