Jump to content
Sign in to follow this  
Oglesbee

Noob sqs. questions?

Recommended Posts

Hello I have been on the forums for a day or two trying to make heads or tails of basic scripting for arma 2 CO. I have zero scripting experience and to be honest don't even know top from bottom when i open up a sqs, sqf, etc file. I have printed downloaded tutorials and prepared myself to learn.

My question is could someone refer me either to a thread or explain what all the lines or rather characters like // { [ ( _ etc do inside the code and on what lines should i place them in . I gues the best thing to ask is could someone please teach me how to do this stuff rather than list a query a mile long on here. I apologize for my ignorance but i love this game and the capabilities that it offers for those who learn to make it work. THankyou and look forward to your posts.

Share this post


Link to post
Share on other sites

The best way to learn scripting is to play and unPBO missions and see how they managed to do certain things. Very rarely do you need to make a script that someone else hasn't written in some form.

{} is code, [] is an array, () overrides natural order of calculations and // marks a comment line that an .sqf script doesn't execute.

.sqs is the older of the two main script formats. It resembles basic and its forte is the ability to change lines with the goto command. .sqf is the newer, more popular format that resembles C++, and every line requires a semicolon at the end and its usefulness lies in the ability to make complex while do loops and having a slightly more reliable timing in sleeps.

The command reference page is one of a scripter's greatest tools:

http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2

Edited by Celery

Share this post


Link to post
Share on other sites

THankyou for explaining what the keys are for .

now inside the scripts i notice that some lines are alligned all the way left some in the middle some seperated by 2 or three spaces is this just a cosmetic feature or is it exact position for the engine to read it?

I have un pboed several mission files and when i look at the scripts i am overwhelmed by the code and i have yet to find a trully scripting for total oglesbee's (ie Dummies)

Share this post


Link to post
Share on other sites

1st.. welcome

2nd.. http://community.bistudio.com/wiki/Main_Page

because this:

My question is could someone refer me either to a thread or explain what all the lines or rather characters like // { [ ( _ etc do inside the code and on what lines should i place them in .

has a rather long and dry answer...

if you want to get serious.. the biki will be a home for you.

3rd.. best to find people of like minds and join up with them on skype.. teamspeak.. vent.. whatever..

4th.. be prepared to have a steep learning curve... hence 3rd point.

also

http://forums.bistudio.com/showthread.php?t=112306

:)

Share this post


Link to post
Share on other sites

Loki i meet you i think this morning on skype or morning my time i use my wifes account Kathy. I am prepared to learn and live wherever the information is. but i guess the biggest question is exactly finding like minded individuals that can mentor/coach me. i am on the skype channel listed in the forums as a start.

Thankyou for your swiftness and willingness to provide direction and information.

Share this post


Link to post
Share on other sites
now inside the scripts i notice that some lines are alligned all the way left some in the middle some seperated by 2 or three spaces is this just a cosmetic feature or is it exact position for the engine to read it?

Opening up a code into several indented lines is a cosmetic thing meant to make reading and working the code easier.

I have un pboed several mission files and when i look at the scripts i am overwhelmed by the code and i have yet to find a trully scripting for total oglesbee's (ie Dummies)

Some missions have a very complex script base that almost any scripter not intimate with the template will have trouble understanding. Some simple SP and coop missions might be a good place to start digging. I think there was some kind of scripting tutorial for Arma 1 or even Arma 2, but I'm not sure where one can be found.

Share this post


Link to post
Share on other sites

my interest is mostly in the sp portion right now get a handle on basic stuff an making little missions for my own enjoyment and when i get a handle on it then delving into mp and campaigns.

Share this post


Link to post
Share on other sites

First off, welcome to the scripting world, Oglesbee.

As mentioned be prepared for a steep learning curve.

Also as mentioned open others scripts and take alook at them to see whats what, start yourself off with small scripts, nothing fancy.

This is one great bible for a new scripter, Mr Murrays editing guide deluxe:

It has alot of info on editor and etc as well, learned my first bits of scripting from this.

http://www.armaholic.com/page.php?id=4847

Edit: and yeah dont forget the search function here on the forums.

Anytime you have a question, it probably has been answered already somewhere sometime before.

This page may be of high interest for you:

http://forums.bistudio.com/showthread.php?t=78089

Edited by Demonized

Share this post


Link to post
Share on other sites
Opening up a code into several indented lines is a cosmetic thing meant to make reading and working the code easier.

yes, this is the MOST important thing about scripting and programming in general. if you have multiples loops, if then statements and other control structures, it would be confusing as hell as to find where one ends and another starts

the indentation makes it possible to know exactly where a control structure starts and ends, by aligning the closing bracket and the control structure to be same indentation.

i hope that helps more in understanding

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  

×