Jump to content
mikie boy

Arma 3 Scripting Tutorial For Noobs

Recommended Posts

Fock_Moto_BIS.png

Scripting tutorial for complete Noobs

This is a tutorial for all those who have no idea how to start scripting. Anyone with half the knowledge of Arma scripting will not require this, it was written as a complete beginners guide and nothing more. The tutorial leads you through a very simple process of making small scripts to carryout certain actions. I've done my best to make this as simplistic as possible and not to confuse anyone. A few people have seen it and have found it very useful, so i thought id finish the first chapter and post it here. Plan is to move on to show how to make a MP game. This is purely something to give back to the community, which over the last 5-6 years I have thoroughly enjoyed.

It can be downloaded from here http://fockers.moonfruit.com/ click on the A2/3 scripting page

I've written the first chapter which covers the basics of...

Setting up a file, showscripterrors, and window mode

Variables, assignment, initialization, and variable types.

Init.sqf, interactions between the game world and the scripts.

Alignment of code, bracket usage and setting out code.

If/else statement, nested if/else statements.

While, and both for-loops types.

Commands - player, waituntil, getpos, createvehicle, createunit, hint, format, sleep and a few other bits.

And a lot of reference on using BIS forums and the Wiki.

I've done my best to check for errors, both spelling and coding errors and its looking ok. Anyone find any please email me and ill correct it.

Direct link - https://www.dropbox.com/s/vpr2d8mb7ll5w10/Fockers Arma Scripting - Chapter 1.pdf?dl=0

Chapter 2 released...

Download from https://www.dropbox.com/s/x7shqt7ocga5ham/Fockers Arma Scripting - Chapter 2.pdf?dl=0

Chapter 3 released...

https://www.dropbox.com/s/a5q9jk11aw66t83/Fockers Arma Scripting - Chapter 3.pdf?dl=0

See last posting from me for contents.

Edited by mikie boy
updated links
  • Like 5

Share this post


Link to post
Share on other sites

Really nice work Mikie, i'll be passing this on to friends.

I seriously wish I had this guide a long time ago, you explained a couple of things that took me weeks to figure out.

Typo, page 9.

"....t1.Stratis folder - called int.sqf. "

Share this post


Link to post
Share on other sites

Cheers chaps much appreciated. If anyone has any topics that they want in for next few chapters let me know. ScoobySnack - nice spot cheers dude

Share this post


Link to post
Share on other sites

@Mikie

if you can,make a tutorial about the new function of 'compileFinal' after the update.

Maybe a short introducion about 'setVehicleInit, clearVehicleInit, processInitCommands' and how to implement in a script a new solution for it ;-).

Share this post


Link to post
Share on other sites

Focking awesome! Thanks a lot! :P

Share this post


Link to post
Share on other sites

Nice work Mikie boy. Seems like you have too much time on your hands ;)

Seriously, nice one mate!

Share this post


Link to post
Share on other sites

I'll check this out Mikie, cheers. by the way I also call things in the editor dave when testing :P

Share this post


Link to post
Share on other sites

Lol, cheers Kremator - you know how it goes :) I'm just work shy lol- in fact perhaps i should have posted this in the... you know when you have been scripting too much when... post - lol

ClydeFrog - cheers dude - Again no idea why dave lol. Once we finished that mp_fnc can add that into the MP tutorial i had in mind.

Share this post


Link to post
Share on other sites

When I started reading after a few lines I started to have a smile on my face. This is exactly what I was looking for. Having no idea about scripting/editing this fairly comprehensive guide is extremely useful for people like me. I can only commend your efforts Mikie boy for putting together such a handy little piece of art :) (using art loosely :) ) .

I can only hope that you will have time to put together other tutorial/guides about editing mission creating and comprehensive scripting.

Thank You very much! Your work is much appreciated!

regards, Sharpy.

Share this post


Link to post
Share on other sites

I began losing hope that I can learn scripting. This has brought my hope back. Thank you for helping me understand and being able to wrap my head around this stuff. I did not know the difference between strings, arrays and such let alone what the underscores meant. I would love to read more of your tutorials.

Share this post


Link to post
Share on other sites

Great stuff thank you, I'm sure I can learn something from this

Share this post


Link to post
Share on other sites

This is awesome and I'm enjoying it and I am not really a basic user of the ARMA universe! I did find a couple things that may need to be changed and I'll update this post as I find 'em... (I'm not including too many spelling/grammatical errors if they don't effect the point being made. PM me if you want 'em)

Page 9 - Save this (make sure it is saved as hint.sqf). Now create another file inside the FockTest1.Stratis folder - called int.sqf. Should be init.sqf at the end. You refer to it correctly in the next line.

Page 12 - Last line... realize not realise

Page 22 - Use this webpage to assist with alignment and order of words!!!!!! ... It's assumed by "this" you mean "Wiki Scripting Topics Page" but could be slightly confusing.

Page 24 - can also use || - left of your z key ... Shift is to the left of my Z key. | is to the right of my ] key. I'm US English keyboard.

Page 38/39 - I may suggest adding (or at least mention in the text that it is located somewhere else) is in your section about creating units and grouping them, you don't give the code to add the AI to the PLAYER's group (just their own individual groups or a separate group).

Looks great & looking forward to reading the next chapters!

Edited by Spazo

Share this post


Link to post
Share on other sites

Lol - much like your comment about the american keyboard - im guessing that works both ways with the american and English spelling...

but in any event i appreciate your point about the keyboard - didnt even cross my mind. Thanks dude.

as for adding AI to the players group that comes later on in chapter 2 - array (almost complete) :) - but again noted

Hopefully should have something by end of next week to lob out as chapter 2

Share this post


Link to post
Share on other sites

I just finished reading the whole thing and I must say that it was very good. Exactly what I needed. I feel like I have a better understanding of the scripting language and I think is a must read for all newbies. At the very least it will make reading other user made scripts less intimidating. I seriously cannot wait for more, especially for the part about multiplayer.

Share this post


Link to post
Share on other sites

I've just finished working my way through the guide and wanted to say thanks. I hadn't done any scripting/programming in quite some time and this has helped me ease back into it. I think this guide will be of great use to many people who are new to the concepts and to those, like me, who need to ease back into it.

I look forward to the second installment.

Edited by Korpayne

Share this post


Link to post
Share on other sites

Chapter 2 released...

Download from http://fockers.moonfruit.com/#/arma-23-scripting/4566406735

Part 1

Basic Arrays

Selecting elements

Subtracting

Addition

forEach command

Part 2

Basic Functions

Local and global

call

Spawn

Part 3

Making a basic Patrol function.

Few other commands have been thrown in

Direct Download https://dl.dropboxusercontent.com/u/17725328/BIS_forum/Fockers%20Tutorials/Fockers%20Arma%20Scripting%20-%20Chapter%202.pdf

plan is to collect all errors and correct them for one large tutorial once this is finished.

Share this post


Link to post
Share on other sites

excellent, can't wait to get reading.

Edited by Spayd

Share this post


Link to post
Share on other sites

read it today, it's pretty good, better than some "professional" manuals/tutorial books. I would have liked some more practical examples, similar to the patrol script, except maybe shorter/simpler.

Share this post


Link to post
Share on other sites
For now, and just for now, use spawn to execute any function that has a sleep command inside of it,

and if you want the function to return a value (this is explained below).

Shouldn't this say

For now, and just for now, use spawn to execute any function that has a sleep command inside of it,

and if you don't want the function to return a value (this is explained below).

?

Edit: two things I would appreciate are consistency and indentation. You sometimes use camel case, and sometimes you don't, and you don't indent the stuff you put inside the curly braces. Minor annoyances, but still :)

Apart from those two things though, for the most part I like this guide.

Edited by Concurssi

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

×