Jump to content
Sign in to follow this  
eymerich

[] exec "script.sqs"

Recommended Posts

I'm calling sqs decrecated because the wiki call it deprecated. I wouldn't be surprised to see sqs completely removed in Arma3. I'm sorry, but for me, sqs has "badly written script format" written all over it.

That page was written by a community member, if you look at the history. Similar comments on other pages have similarly been written by community members that have deemed such comments necessary.

So far none of the conversions got case 0 right: in sqs it continues straight to case 1, meaning that however long case 1's commands are, they should be duplicated to case 0 in sqf.

Share this post


Link to post
Share on other sites
So far none of the conversions got case 0 right

So this proofs what? That sqs is superior in this usecase or that sqs is simply friggin unreadable? :rolleyes:

Or do you think this would be a problem in sqf? Please, make yourself comfortable with private functions, which are very nice for such scenarios. But that goto-here, goto-there, let that one pass to the next case, exit here, not here... no, this all is not good. It's a horrible sqs mess, proofen by the fact that nobody noticed that "loophole" in your fragile sqs-switchy construct. :cool:

Edited by ruebe

Share this post


Link to post
Share on other sites
So this proofs what? That sqs is superior in this usecase or that sqs is simply friggin unreadable? :rolleyes:

Or do you think this would be a problem in sqf? Please, make yourself comfortable with private functions, which are very nice for such scenarios. But that goto-here, goto-there, let that one pass to the next case, exit here, not here... no, this all is not good. It's a horrible sqs mess, proofen by the fact that nobody noticed that "loophole" in your fragile sqs-switchy construct. :cool:

The conversions that were posted already proved that sqs does save time and effort in scripts that have no complex conditions. The error was just a detail I pointed out. Sqf requires the use of brackets, indentation (for ease of reading) and semicolons even for simple stuff, whereas sqs doesn't, and it also lacks some of sqs's functionality and shorter commands. All of that is evident when comparing the codes in this thread.

Share this post


Link to post
Share on other sites

:D

The conversions that were posted already proved that sqs does save time and effort in scripts that have no complex conditions.

Don't be silly. Pulling some code out of one's ass is by far the simpler activity, than trying to port code from one language to another, especially if the original language looks like sqs.

The error was just a detail I pointed out.

No, this wasn't just a detail or by accident. Heck, this is a widely acknowledged problem of such fragile constructs. Such an exit or break clause in a switch statement is considered _dangerous_. For the obvious reasons. Readability is a huge thing at any stage of coding or reading while using that code and figuring out why the heck...

Sqf requires the use of brackets, indentation (for ease of reading) and semicolons even for simple stuff, whereas sqs doesn't,

:D :D

Ahhh, come on. Now you're just trolling me, right? :D

... and it also lacks some of sqs's functionality and shorter commands.

It lacks the goto statement - for good reasons.

Why so goto? :p

All of that is evident when comparing the codes in this thread.

Nah, that's just you, because you (mis-)trained your brain to read goto-soup. ;)

Oh and: http://xkcd.com/292/

Edited by ruebe
added mandatory link to xkcd

Share this post


Link to post
Share on other sites

More like he's been scripting since OFP. I'd imagine he knows a few things.

Personally, if the community hadn't moved on to SQS I'd still be scripting in it. It's significantly easier to use and I've been using it for longer (I only learned SQF after ARMA 2 came out, whereas I'd been using SQS since the OFP days). Though, now I think I'd have to retrain myself in its use as I've forgotten all of the syntax pretty much.

Share this post


Link to post
Share on other sites
Don't be silly. Pulling some code out of one's ass is by far the simpler activity, than trying to port code from one language to another, especially if the original language looks like sqs.

No, this wasn't just a detail or by accident. Heck, this is a widely acknowledged problem of such fragile constructs. Such an exit or break clause in a switch statement is considered _dangerous_. For the obvious reasons. Readability is a huge thing at any stage of coding or reading while using that code and figuring out why the heck...

Ahhh, come on. Now you're just trolling me, right? :D

It lacks the goto statement - for good reasons.

Why so goto? :p

Nah, that's just you, because you (mis-)trained your brain to read goto-soup. ;)

Brackets, semicolons and structured text are all redundant when there's nothing that would make them actually useful. Just the first line's comparison shows what I mean:

?!isServer:exit

if (!isServer) exitWith {};

I'm quite skilled in both sqs and sqf and write most of my scripts in sqf. Does that contradict your mistraining theory?

Share this post


Link to post
Share on other sites
Brackets, semicolons and structured text are all redundant when there's nothing that would make them actually useful. Just the first line's comparison shows what I mean:

?!isServer:exit

if (!isServer) exitWith {};

That's your argument? :confused:

So, tell me. How do you name your functions (or goto-labels, but only because it's you, hehe)?

Would you rather call your function:

a) "thatsMyNameBecauseThatsWhatIFrigginDo" or

b) "f1"?

And what's your opinion on xml? :D

Edited by ruebe

Share this post


Link to post
Share on other sites
That's your argument? :confused:

So, tell me. How do you name your functions (or goto-labels, but only because it's you, hehe)?

Would you rather call your function:

a) "thatsMyNameBecauseThatsWhatIFrigginDo" or

b) "f1"?

:D

That's your argument? You do realize that I'm defending sqs as a format for short and simple scripts where sqf's syntax would go to waste? It's almost as if people have a personal vendetta against it. Did sqs kill your family and rape your dog? :confused:

Share this post


Link to post
Share on other sites
You do realize that I'm defending sqs as a format for short and simple scripts where sqf's syntax would go to waste?

Waste? If you feel so, fine. Compared to using two languages that share a lot and yet are miles apart from each other is IMHO a much bigger waste and an even bigger source of confusion.

It's almost as if people have a personal vendetta against it.

But people do have a personal vendetta against sqs, because it stinks, because it's ugly and because its ugliness insults their brains. :D

Share this post


Link to post
Share on other sites

:popcornsmilie:

It lacks the goto statement - for good reasons.

Just out of interest... apart from some peoples opinion that it's ugly (something being ugly has never been a reason for anything) and the risk of being attacked by baby-godzilla (I can live with that risk), is there any real reason why goto is so bad, bad, bad?

Share this post


Link to post
Share on other sites

So lame and boring......

Such a nice attitude and demeanor you have there ruebe.

sqs gets shit on by the great experts who want to clean it out from the series future in the name of being a jerk....

Edited by TJ72

Share this post


Link to post
Share on other sites
Brackets, semicolons and structured text are all redundant when there's nothing that would make them actually useful.

How are they not useful? It defines the language as structured. Semicolons separate statements within a scope, a concept which doesn't even exist in sqs forcing you to put complex code as single line mayhem.

Just the first line's comparison shows what I mean:

?!isServer:exit

if (!isServer) exitWith {};

I'm quite skilled in both sqs and sqf and write most of my scripts in sqf. Does that contradict your mistraining theory?

And within those brackets, which can be on different lines, and can be contracted/expanded in most decent text editors, you can put in as complex statements as you wish and break it up into several lines. How'd you do that in sqs? You can't. You have to do another goto and keep that complex statement on the same line (i.e. a large hint format debug output). I don't see the point of maintaining proficiency in two similar but yet confusingly different languages.

Someone asked what is bad with goto? I had links earlier. I suggest googling:

why is goto bad

and the following find describes it well:

Simply, there's nothing you need a goto for in procedural programming. It can be syntax sugar for certain jobs, but it comes with a diabetes warning. There's just no compelling reason to use it and it borders on incompetence to teach it to new programmers.

As for the case 0 code miss, that's a classical example of what you get with spaghetti code. Unreadable, or in this case, easy to misread.

@TJ72: You're wrong. We want it out because new guys gets confused about having to deal with two distinct coding styles that aren't compatible. They want to learn scripting, not having to deal with sqs syntax vs sqf syntax. Both have a hard enough learning curve as it is. I was into sqs myself at the time, but had no problems changing to sqf.

As for sqs use, anyone check out default onKilled event script (which has to be sqs)? ;)

Edit: Another thing I remembered. The proprietary sqs scripting language was originally invented for cutscenes and camera control, but it kinda grew beyond it's intended scope where it started to show its limitations. So sqf was invented and came with OFP RES, but could only be used as function calls. Later it became a full scripting language that made sqs obsolete. In sqf you can do things like

waitUntil {sleep 2; bSomeBooleanValue};

whereas in sqs you can only have a single statement like

@bSomeBooleanValue

That might be good enough for cutscenes and camera control, but limits flexibility and possibly efficiency. Oh, and the @ command isn't even documented on the biki?

As for indentations, that's just improving readability, and is also suggested practice for sqs. The sqf interpreter doesn't need any whitespaces other than to separate commands. Download Arma1 addon ECS for a perfect example of (obviously intentional) horrible sqf code to read.

Edit2: Checked out ECS myself, and appears it is an install.exe only. But if you could install it, and tried to read the main sqf file, you'd see that the whole addon code didn't have a single line break in it. And the file was huuuge. Took some (automated) effort to make it readable, I'll tell you that. :)

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

You're writing that wall of text in vain because I never said that SQS is always better, or that structured format is bad. Let me say it once more: SQS is great for short and simple scripts where the SQF syntax has diddly squat to do - where it only serves to make the scripter write more characters and use more elaborate methods for no gain over SQS scripting.

Share this post


Link to post
Share on other sites

Taking something away from people who are used to using it to make things easier in an editing forum is wrong. The ease of helping new users that is gained is FAR less than the loss to another user who either does not know .sqf and may not ever learn how to use it and is left on the sidelines. Im sorry but people who dont understand the concept of two different formats before writing some code and experts who are too lazy to clarify what format they are writing in is not good enough reason to remove something so useful. Whatever happened to live and let live? Programmer types dont have the right to dominate Arma series scripting, its just wrong no matter how mad some of you get about it. You are in the wrong on this.

Maybe we need separate forums for the two formats so everyone can play nice. This bully attitude displayed here is unacceptable to me. Maybe BIS should delete sqs and sqf and move onto LUA? sgf is ugly crap and LUA is the future.

All it will achieve is making scripting more exclusive to one type of person, one who is better at writing programs compared to someone who is more creative and wants to use the easier format to get something done.

You guys are WAY out of line but thanks for being honest about your agenda.

Share this post


Link to post
Share on other sites

@TJ72

The whole point was that sqs should not be showed to new scripters as it confuse them, or they think they can mix it with sqf, resulting in big headaches or them just giving up on scripting all together.

As shown many times lately, some new scripter not getting whats wrong, turns out he has a good mix of sqs and sqf commands mixed in his script and the execution of it.

Removing sqs syntax, (sqf can do all sqs can and more), uniting all old and new scripters in one syntax will do the community alot of good, and increase the numbers.

It will not make it exclusive, it will make it more inclusive.

Those skilled in sqs, will have zero to nil problems converting to all sqf use, most of you are already very competent in sqf already, this because you have long since realised that sqs cannot do the job for everything.

And converting what you already have in sqs to sqf will be no problem as its already only "being used for small and simple" scripts.

I myself started out with sqs with no prior coding experience.

I learned from Mr Murrays exxelent guide.

Once i wanted to gain more advanced scripting, i quickly found myself in a world of confusion, i mixed sqs and sqf from forum examples, almost giving up on the entire scripting part.

Then i converted to sqf and it all worked out.

I am myself a person who spend alot of time reading, searching, testing and trial and error, to get things working.

The differences between sqs and sqf is simple in the eyes of a skilled and experienced coder.

Not everyone has the time, desire or ability to do that, resulting in keeping them at a mediocre level or excludig them all together from arma scripting.

Its not a bashing or discriminating attempt to get rid of sqs, its a call for progress to include everyone.

Share this post


Link to post
Share on other sites

Thanks you all for the help.

Two last more considerations.

I am quite aware about the fact sqf is better than sqs.

But for easy script like the one i have posted, please, don't say it was of difficult reading: especially for people like you much more experienced than me.

I can understand your point of view if i would have posted a complex script (by the way: do you remember the _sniper support pack in the old flashpoint era? It was mainly compiled by sqs and functions).

Again, just to make one more example: the init script is an sqs script nor an sqf.

In my opinion: for easy script sqs it's just equal to sqf. For medium or complex script sqf is preferable.

The reason I still use sqs it's quite simple: the evening i am too tired, after a long day of work, to put my head in learning something new.

It's easier for me use the old knowledge i get form opf and arma1.

I am not a programmer and arma2, for me, it's just a game.

:)

Share this post


Link to post
Share on other sites
do you remember the _sniper support pack in the old flashpoint era? It was mainly compiled by sqs and functions

I do; that was quite a pack. The reason snYpir used .sqs for the scripting, though, was because .sqf wasn't yet available outside of dedicated functions. ArmA I was the first game in the series to allow .sqf for everything.

That said, if you like .sqs, go ahead and use it. It works just fine for most applications despite the fact that many people here consider it an eyesore.

Share this post


Link to post
Share on other sites
do you remember the _sniper support pack in the old flashpoint era? It was mainly compiled by sqs and functions).

The bolded part is my point exactly. If you want to keep using a depreciated syntax because you're lazy, that's just fine I guess. Limit yourself as much as you want. :rolleyes: Just don't expect everyone else to roll back the clock to help you next time because you don't feel like learning SQF at the end of the day.

Share this post


Link to post
Share on other sites
The bolded part is my point exactly. If you want to keep using a depreciated syntax because you're lazy, that's just fine I guess. Limit yourself as much as you want. :rolleyes: Just don't expect everyone else to roll back the clock to help you next time because you don't feel like learning SQF at the end of the day.

Alea iacta est.

My friend: this is a forum.

If you wanna help me do it.

If you don't want, stay away.

Post like yours this let me think twice before asking (again) help on this forum... :(

Share this post


Link to post
Share on other sites

Guys just drop it and close the thread. This is like talking about politics and religion, a topic you know that will turn into a heated debate.

If you want to use .sqs super, if you want to use .sqf great. I do not know much about .sqs because I have put all of my time into learning .sqf, its just a personal choice. GOD BLESS AMERICA!!! :bye:

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Reminded me of the arguments we used to have in the pub about which was better COBOL or NATURAL (the old guy with the beard always insisted it was assembler). Later we moved on to VB or Delphi. Then it was C or Java. Now it's mainly just remembering who's round it is and why they keep moving the bloody loos.

Share this post


Link to post
Share on other sites
SQS is great for short and simple scripts where the SQF syntax has diddly squat to do - where it only serves to make the scripter write more characters and use more elaborate methods for no gain over SQS scripting.

And I disagree. There is nothing sqs can do that sqf can't (afaik), it also helps make the code look better. More characters? Okay, the ? keyword is smaller than if, ~ smaller than sleep, and @ smaller than waitUntil. Did I get those right? Meaning that proper keywords are easier to read, and can't ruin a regexp search (? - baaad baad keyword). And again, it wasn't intended as a scripting language, only for cutscenes and camera control.

The words 'deprecated' and 'obsolete' mean absolutely nothing because SQS works perfectly in every part of the game series, and for simpler scripts it's a time saver. People say it's deprecated because people say it's deprecated.

And that is just plain wrong:

In the process of authoring computer software, its standards or documentation, deprecation is a status applied to software features to indicate that they should be avoided, typically because they have been superseded. Although deprecated features remain in the software, their use may raise warning messages recommending alternative practices, and deprecation may indicate that the feature will be removed in the future. Features are deprecated—rather than immediately removed—in order to provide backward compatibility, and give programmers who have used the feature time to bring their code into compliance with the new standard.

Maybe a dev could clear this up? Is sqs marked for future removal, or is deprecated status guesswork of community members? I ask because currently certain event scripts require sqs (although typically only to execVM a sqf with same name), and there also still exist some sqs scripts deep in the addons that make up the game.

I'll just also remind that sqf in "script format", although a very important building block, may not be the choice of the future, but rather do many things in fsm for enhanced readability in complex scripts at the cost of fairly bad support for writing them (there is no UltraEdit/Notepad++ that does fsm afaik, feel free to correct me). Also I wouldn't be surprised to see Oo become better supported in the future (of which I don't understand anything, lol - gotta relearn everything - again).

And, look. I don't mind people using sqs. Their loss I say :p But it shouldn't be promoted as something good when there are numerous reasons to avoid it that (imo) completely outweights the number of keys you have to write.

Share this post


Link to post
Share on other sites

Lads, just calm down and think logical about it, besides the religious discussion "what is better and what was it's purpose initially", would you? Then please, follow me.

First a few simple facts:

sqs is fine for short and simple scripts.

sqf can do the same things as sqs, although with differing synthax.

sqf plays out when it comes to more complex scripts.

Beginners usually start with short and simple scripts.

But sooner or later the scripts will become larger and more complex.

So, let's say you start with sqs, you learn it's synthax, structure and commands. But at certain point you would switch to sqf as your work get's more complex. So you restart learning synthax, structure and commands. Also you risk to unintentionally mix up sqs and sqf style which might work but usually will fail (source of errors).

So, sooner or later, every beginner should use sqf. Then please tell me, why first learn sqs and not directly sqf?

You're doing the learning almost twice, once for sqs and once for sqf. Why not just jump directly on sqf?

It's just a matter of logic.

Share this post


Link to post
Share on other sites
So, sooner or later, every beginner should use sqf. Then please tell me, why first learn sqs and not directly sqf?

You're doing the learning almost twice, once for sqs and once for sqf. Why not just jump directly on sqf?

If you were just starting out now, then I agree it would make more sense to just start with .sqf, but if you've been scripting since Flashpoint when .sqs was all that was available, I can understand why you might want to stick with that. Going from .sqs to .sqf is really quite confusing at first, and as Celery accurately pointed out, .sqs is perfectly functional.

Share this post


Link to post
Share on other sites

If you've scripted since Resistance, and tried to script efficiently, sqf syntax shouldn't be an issue as it was used for functions. However, I have to admit it took a week or so to get used to certain stuff, and had some pain converting. Now it's second nature, and most of the stuff in sqf when I think about it, makes a hell of a lot more sense to me than sqs did even back then.

Even if you do make simple stuff in sqs because you feel it is simpler, what happens when that very script suddenly becomes more advanced than you planned for? Now you may find yourself in a position where you have to convert the whole simple script from sqs syntax to sqf syntax. Double work is not efficient :)

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  

×