Jump to content
Sign in to follow this  
trigger313th

Learning to script for ARMA2

Recommended Posts

What would be the best approach and where would be the best resources to learn how to script for a complete newb?

Tutorials, idots guides, etc...

JB

Share this post


Link to post
Share on other sites

Best place to get started would probably be to dissect someone elses (completed) mission/addon and look at things they did. That way you can see some practical solutions to practical problems.

Then there's the Biki (BI Wiki) that will answer a lot of questions for you if they arise.

Then there's this forum, and the Search feature. A lot of questions you will probably have have (tehe) already been asked and answered many times here. If after that you have a genuinly new question that you can't find a resonable answer to then you can post it here.

Share this post


Link to post
Share on other sites

I bought C++ for Dummies and I'm in the process of reading it and doing the tutorials. I must say it is an excellent book, I would highly recommend it as a starting point.

Share this post


Link to post
Share on other sites

I would also highly recommend not to start scripting with SQS, you're better off learning SQF in the first place.

Personally I think the best way is a mixture of

a) extensive use of the comref

b) use and editing of existing scripts

c) trial and error

The comref is your friend:

http://www.arma2.com/comref/comref.html

Same thing goes for the biki.

Oh and this forum can be rather helpful too. ;)

Share this post


Link to post
Share on other sites

Thanks for all the replies...

Looking at all the resources...

Coming from someone who really doesn't know much about coding... Whats the best method to build a foundation to understand the scripting in ARMA2? One of the replies mentioned the book C++ for dummies... I feel that if I started with theory or basic coding maybe I would be better off.

Comments please.

JB

Share this post


Link to post
Share on other sites

Teach Yourself Programming in Ten Years contains some general advices (and makes an interesting reading, too). Don't worry! It won't take you this long to write scripts for ARMA... :)

How to get started? Cheetah's SQF tutorial might be worth a look (but it's slightly outdated). In general the first step is to understand the very basics of (SQF) scripting/programming:

- What are variables?

- What are control structures?

- What are arrays?

- How do I run SQF scripts?

You're not expected to understand these articles the first time you read them. So read them again. And again. Learn to teach yourself. Ignore all the stuff about SQS and focus on SQF. Do not stop if you don't understand something but read on. If you're stuck come back and ask.

Once you've grasped the basics, read as much code as possible. There are tons of scripts on OFPEC. Start with small scripts and analyze them until you understand every single line. Try to find the answers to your questions on your own. Your most important tool will be the BIKI's search function. The list of scripting commands will come handy, too.

Write small scripts that accomplish simple tasks and find out why they don't works as intended (you will make many errors but that's fine because you gain experience this way). Realize that writing code can (and will) be frustrating sometimes. Realize that writing code can (and will) be rewarding once that damn script is finally working! :)

Did I mention that you should learn to teach yourself and to find answers on your own? Just in case I did not: learn to teach yourself and try to find answers on your own. Both are skills. The more you practice the better you get. Nobody who knows how to code will teach you because they're all busy coding. ;)

The whole "learn how to code" thing boils down to:

- becoming an autodidact

- being patient

- reading code written by others

- writing code yourself

- making lots of errors

- reading good books about coding (if the title contains "dummies" or "in 21 days" it's by definition not a good book)

Note: You should be familiar with the Mission Editor of course.

Share this post


Link to post
Share on other sites

Worldeater...

Thanks, thats exactly the answer I was looking for... I just took a look at your links and it seems they will be very helpfull, especially the SQF guide.

JB

Share this post


Link to post
Share on other sites
- making lots of errors

you forgot:

- correcting errors, just to discover new ones

- searching the comref on a daily basis

:)

Maybe it would make sense to create an starter guide on how to use and create scripts.

The Basic SQF thing by Cheetah looks pretty good already.

Share this post


Link to post
Share on other sites
you forgot:

- correcting errors, just to discover new ones

- searching the comref on a daily basis

:)

Maybe it would make sense to create an starter guide on how to use and create scripts.

But those errors are just errors of errors that produce other errors... yeah, i like scripting in ArmA^^

I was working on a tutorial about SQF and i have already 7 pages but i get a little bit lazy the last weeks...

Share this post


Link to post
Share on other sites

OFPEc has a good tutorial for sqf-beginners. Downloadable for your personal perusal and study. Written by Cheetah, I believe.

About learning c++ and similar theoretical studies. I don't think it's necessary to begin with. Play with the scripting commands as they come. It's not that difficult. Have fun! You'll learn faster that way. You can always polish your finer techniques with theoretical studies once you know what you need it for.

Share this post


Link to post
Share on other sites

BTW: A good book about programming (well, probably the best one available) is Code Complete. It's not for beginners, though, but for people who already know a thing or two about coding and strive to get better.

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  

×