Jump to content

Sign in to follow this  
tlwhite0311

Where do all of you learn how to script?

Recommended Posts

Where do you go to learn how to script? Some people seem to know a lot about it. I dont just mean copy and pasting scripts off the internet but like actually learning how to script. I have searched and not really found what im looking for. Is it something that you have to be shown? Thanks.

Share this post


Link to post
Share on other sites

For me it's just another programming language. I'm not a good coder by any stretch of the imagination, but I am reasonably fluent with a few languages. Started when I was young, so writing programs to solve problems is just very natural to me.

So to answer your question... I'd probably focus more on general programming, maybe learn an easy language with a comfortable syntax like Python or PHP. Once you know "how to program", switching to other languages is pretty straightforward; the main thing is having the mindset that allows you to convert somewhat abstract notions of what you want to achieve into explicit line-by-line instructions that the computer can follow.

No reason you couldn't learn directly with in-game scripting, but IHMO it's not the easiest environment for learning in.

Share this post


Link to post
Share on other sites

Same as above. I've been programming in C/C++ for a number of years, and also know a variety of other languages (including scripted, such as LUA). All it took for me was to read some of Bohemia's scripts for a little bit before I got the hang of it. It still annoys me that parameters come before function calls though. I also don't like the fact that if statements require the keyword then and a final semi-colon--but I guess that's just the C in me.

There's got to be some tutorials for it somewhere though, I don't think the language has changed much since the OFP days.

Oh, and learn to love this website, and, more specifically, this page:

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

Share this post


Link to post
Share on other sites

Have a look at Mr Murrays editing guide for Arma1 alot of the stuff in that applies to A2. I understand there will be a guide for Arma2. Start with simple stuff.

Bookmark these links

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

http://community.bistudio.com/wiki/Operators

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

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

I recommend getting the Notepad++ program there is a plugin for Arma scripting.

http://forums.bistudio.com/showthread.php?t=91939&highlight=notepad

Also in your Arma launcher or shortcut add -showscripterrors this will ingame show up scripting errors and which line. Using notepad++ which numbers the lines, you can easily find which one it is.

Often as a newbie scripter syntax errors is the cause of alot of problems, i know that has been the case for me. Another helpful tip is to get an index book and write down

stuff you have learnt or syntax examples for basic things. Saves time.

Hope this helps,

Daza

Edited by Daza
Added a link

Share this post


Link to post
Share on other sites

There is no easy way as the help you get now day is not as good as it used to be

Find people that like to help and LISTEN to them ,

Get an idea and play with a few way to make it happen.

dont be scared to ask silly questions

if you find people that like to help you on your way and help you be ready to help them back

ie test there stuff.

the wikis ect are hard enough to understand , they seem to be a guide for people that know what to do and just need a reminder on how the code is written "yes a dig"

its easy to point people to a web page you know they wont understand so if you have a question on a script you cam PM me and i will try to help.

Im on MSN and SKYPE

ZoneKiller

Share this post


Link to post
Share on other sites

If you’ve never programmed anything in your life, then try learning java script or something. Just to get your head around the idea. There are plenty of tutorials on the net.

Look at other people’s scripts and reverses engineer them.

Don’t try and do too much in one go. The amount of times I’ve seen people posting large scripts full or errors, that fail at the first couple of lines.

  Quote
the wikis ect are hard enough to understand , they seem to be a guide for people that know what to do and just need a reminder on how the code is written "yes a dig"

There is more info on scripting now, then there has ever been. Perhaps that’s the problem. The wiki is a reference, not a tutorial for teaching people about programming languages.

Rather than needlessly pointing the finger at all the people who put their own time and effort into populating that valuable resource. Try writing your own tutorials, if you’re that bothered.

Share this post


Link to post
Share on other sites

not a dig at the wikis they are a great resorce ,,,

just not the way i would answer a question that someone has.

i may not be to bothered in writing anything but i will and have always been

avilable to contact to help anyone who wishes it via voice on ts ect,

scripting is a passion and i would like to see the new ones get a head start

i know the probs i had understanding stuff and i learnt how to code

php java c++ ect because of the interest i have in this game.

  Quote
Look at other people’s scripts and reverses engineer them.

that i agree is one of the best ways to learn , if you dont have anyone to help you.

hint keep your scripts as small and simple as you can..

Share this post


Link to post
Share on other sites

The scripting is mostly game-specific. You have to use the BIKI or good script examples to learn the intricacies of every command you use. You don't need programming experience.

You don't need to learn ArmA1 scripting. It is very similar, but you should focus on SQF and the commands specific to ArmA2.

Share this post


Link to post
Share on other sites

i don't like this "language" if it can be called so (it is not game's code, it's abstract code , i don't know how to say in english) and don't learn it :) I just read wiki and see that there's not enough information, try to read and ask in forum. The game's engine seems very strange to me, too many restrictions and no freedom. For me it is better to code in game's code, like in NWN/NWN2 (there's comfortable C++-style editor with compiler, let alone nice 3D world editor and so on..). This game (Arma) is 100x times more difficult to code in.

Share this post


Link to post
Share on other sites

I've been writing programs since 1975, when a "useless" summer school class in typing suddenly got me volunteered into demonstrating how to use a brand-new computer terminal ( an ASR-33 teletype no less ) by my mathematics teacher.

That turned into a university degree in Computer Science and eventually a multi-decade career as programmer, systems admininistrator, information security officer, and systems architect at a weapons lab for the US Dept of Energy. Familiar with a quite a few programming languages.

Now retired, coding for A2 is a hobby to keep active.

Share this post


Link to post
Share on other sites
  Zonekiller said:
not a dig at the wikis they are a great resorce

In that case. My apologies for tarring you with the same brush, as those that have levelled criticism at the wiki.

Share this post


Link to post
Share on other sites

Hi tlwhite0311,

I'm also new to ArmA2 and, like yourself, just started scripting for it.

Although my coding skills are limited (my background is BASIC and some notions of C and C++... gee... just showed my age! :cool:) I found that reading other people's scripts helps a lot in understanding/figuring out both the logic/syntax used and how commands are used. (Note: Many commands are actions and all it is required is to give data such as name of a unit, coordinates, and the command does the rest!).

I'm way from being a coding guru for ArmA2, but in a matter of 2 weeks I've learned a great deal by reading as much as I can and also with the help of the community.

I've found that the guys in this forum are great and give you a hand when you need help/have questions/etc. :notworthy:

One piece of advice, though: Search the forum before you post a question.:D

The forum is reach with info that noobs like you and I usually ask when getting started. If you can't find a topic or an answer to something then it's time to post.

Hope you enjoy scripting for ArmA2 as much as the rest of us. :bounce3:

Best, Splicer.

Share this post


Link to post
Share on other sites

Javascript, ugh, no, don't learn programming with that. Haha. Once you have a firm grasp on the basic operations and techniques of something like Java, which will get you pretty far in knowing your way around ArmA scripting, I recommend looking into something like Python or Lisp. I've been learning Common Lisp for the past few months and coming back to ArmA scripting with that background is like an entirely different world. Java will certainly teach you the basics of instances and objects, but Lisp can give you insights into how to look at programming tasks in a more abstract and universal way that can be applied with any programming language. Then you start to realize that .sqf is a ridiculously powerful tool. Or if you ever looked at Mando's MMA code I guess it was self-evident, not that mortals can grasp it to that degree ;p

Share this post


Link to post
Share on other sites

Started out briefly with basic on the C64 before quickly moving onto C64 assembly. Since then, pretty much on a standstill until OFP when I picked up scripting. Some basic C++ but not something I went very deep into.

Don't really consider myself a coder anymore, but it's a nice skill to have "back there" when you need to solve a problem. But I still script for Arma2/OA, mostly it's working on own systems for own leisure, and tweaking other missions to suit our needs.

"How do you learn Arma scripting"? Do the tutorials, try to get a grasp on the basic syntax, pay attention, modify other peoples code and see what happens. Learn to use the biki skillfully.

Share this post


Link to post
Share on other sites

Hints on starting scripting:

-Learn the commands 1st - leave the mathematics, loops and logical stuff till later.

-Build your own reference as you go along - put all the trigger conditions in 1 text file, for example. Then if you get stuck you can just look down the list for inspiration.

-The wiki is very good but some of the command examples are things people would never use and focus too much on the player. I would like to add more examples if that's possible?

-The wiki index is found by clicking "categories" at the bottom left of the home page. Lots and lots of great stuff in there.

-Some of the commands listed don't work in Arma2. Beware it is a resource for all games in the series OFP, VBS2 and Arma1.

-Kylania and shk have very good websites:

http://www.kylania.com/ex/

http://derfel.org/arma2/scripts/

Look at Kylanias tasks demo: kill the girl not the goat. Great for setting tasks, waypoints and hints for maps. It's the way BIS does the training missions.

shk's 1st language is Arma script!

-Download some maps and de-PBO them to find out how they were scripted.

-It takes lots of time and lots of patience! My wife has developed a special disapproving look since I started playing Arma2!

Edited by PELHAM

Share this post


Link to post
Share on other sites

Basic knowledge of programming is good, so you are familiar with the common stuff like arrays, IF, FOR, etc. However, the key thing to learn A2 scripting is getting to know how the engine works. How to interact with objects and so on. Syntax, commands etc you can just check from the Biki.

As for myself, I started 10 years ago with OFP. Scripting I've learned the same way as PHP, Java, C++, Python etc, by modifying other peoples code and then just purely testing. I'm just a silly electrician, so I don't really consider myself as a skilled scripter/coder.

Share this post


Link to post
Share on other sites
  PELHAM said:
kill the girl not the goat.

My wife has developed a special disapproving look since I started playing Arma2!

Can you blame her? :D

Share this post


Link to post
Share on other sites

In Operation Flashpoint I started opening up missions made by others and discovering how they did certain things. No prior programming experience.

Share this post


Link to post
Share on other sites

I seem to disagree with most here it seems. Or maybe I read your question differently, I don't know.

I for one wouldn't recommend learning some other language first. Getting your feet wet with a very simple scripting language that give access to quick satisfaction and almost immediate results is a perfect start and hard to come by with other "real" programming languages. In these GUI days coding anything somewhat useful is far away when one start learning to program. Almost everything useful includes something like threading, events, netcode and other stuff that is way too complicated to begin with.

The most important tip I can give you from the way I learn is to write examples others could learn from. Nobody need to read it but you but writing it down forces you to actually understand it.

I would go about learning it something like this (no matter what language you start out with):

Learn what variables are and how they work - Write a tiny guide so it sticks

Learn about if-else - Write a tiny guide so it sticks

Continue like this with arrays, loops and so on and when trying new stuff include some of what you have coded already to make it stick.

When you have got a small library of guides and code you have come a long way and in no time people might be copy&pasting your work ;)

(Oh and hallo everyone. Long time reader, new poster) :D

Share this post


Link to post
Share on other sites

My method has been:

-think of something you want to achieve

-search the forums for something like it. There are some easy scripts about most of the things.

-rewrite the code from line to line: this way you can understand it better. You can use the Wiki here.

-test everything with different settings, and with altering things. One at a time!

My most used line:

hint format ["%1",_anyVariable];

You need the basic knowledge of:

variables, conditions, loops, and arrays for this.

Eventually you will learn a lot about the engine.

Share this post


Link to post
Share on other sites

Started out with the C64 basic and assembler. Then C128...then got involved with writing RPN stuff for the HP 41-CV and CX's.

Then on to AutoCAD and AutoLISP. (Lost In Stupid Parentheses).

Was interested in Apache and Perl for a long time as a hobby. Wrote GPS moving map stuff for myself using VB quite some years ago before all these GPS units hit the scene. That ended up being around 30,000 lines of code and kept me busy for a while.

Discovered OFP back in 2001 I think it was and have loved and followed it ever since. It's how I get my fix!

Learned this by looking at other peoples code and many, many hours of reading forums. It was truly not easy. Maybe that's what makes it fun!

Share this post


Link to post
Share on other sites

I've been learning C++, though I am by no means an expert. But I'm not unfamiliar with the quirks of computers and why programming languages are the way they are.

To learn how to script, I started out by making small scripts and using the biki for reference. I'm by no means an expert, but I'm making my first mission with the sole purpose of honing my skills and exploring SQF scripting.

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  

×