Jump to content
Sign in to follow this  
BeerHunter

ARRGH!! I'm pulling my hair out. Confusing syntax!!

Recommended Posts

The scripting language used in ArmA2 violates just about every syntax rule in existence for any programming language I'm familiar with!!

There doesn't seem to be any consistency (though I'm sure there is , just haven't figured it out yet) in how function (or scripts in BIS's language??) are called. Seems to go something like this:

Var2Fn Function

instead of the NORMAL common everyday standard usage

Function(Var2Fn);

as far as I can tell. :386:

Seems arrays can hold any type of data in any combination of strings , numbers etc. you can dream up.

Variable types don't seem to be declared/defined so you really don't know if you can manipulate them mathematically or not just by looking at them.

I've tried reading other peoples scripts but for the most part it's hard to tell when they are using a built in script , what they are passing to it and what is supposed to be returned (if anything).

Been to the WiKi over and over again but not much help there other than to see what prebuilt script names are available. Very little in the way of usage examples.

Think I'll take up drinking instead... :803:

BTW - am I right with these assumptions?? :o

BTW - How can I tell if a script I made up is working or not? There doesn't seem to be any error reporting in the editor (ie script nnnn failed because...). Is there any type of add on or mod to help here?

Edited by BeerHunter

Share this post


Link to post
Share on other sites

hehe

Without delay, go to ofpec.com. :) They have a beginners tutorial, and the forums are chock full of examples. :)

And as in any language, there is a unique syntax. :D But, it isn't too bad once you get used to it.

Hell, if I can do it, anyone can. :D

Share this post


Link to post
Share on other sites
The scripting language used in ArmA2 violates just about every syntax rule in existence for any programming language I'm familiar with!!

Ye well, its just script, not a programming language.

There doesn't seem to be any consistency (though I'm sure there is , just haven't figured it out yet) in how function (or scripts in BIS's language??) are called.

Plenty of consistency. You pass vars infront of the calling command. Like

Passing 2 vars to a script:

[myVar1,myVar2] execvm "scriptName.sqf";

Passing 2 vars to a script that was preprocessed already:

[myVar3,myVar4] call precompiledScriptName;

Passing only 1 var:

myVar5 spawn precompiledScript2;

Passing no vars, and not calling a separate script file, but some script code directly:

[] spawn {dostuff;};

Seems arrays can hold any type of data in any combination of strings , numbers etc. you can dream up.

Variable types don't seem to be declared/defined so you really don't know if you can manipulate them mathematically or not just by looking at them.

See my first reply, it's scripting. Who the heck wants to allocate memory or define vars etc when you don't have to.

I've tried reading other peoples scripts but for the most part it's hard to tell when they are using a built in script , what they are passing to it and what is supposed to be returned (if anything).

There basically are no builtin scripts. Well, there are, but only a few. They start with "BIS_fnc_". Everything else you see is either scripting commands or player made scripts.

Been to the WiKi over and over again but not much help there other than to see what prebuilt script names are available. Very little in the way of usage examples.

Seems to me that you are mixing scripts with scripting commands. Wiki has a list of commands you can use in your scripts.

BTW - How can I tell if a script I made up is working or not? There doesn't seem to be any error reporting in the editor (ie script nnnn failed because...). Is there any type of add on or mod to help here?

Start your game with -showScriptErrors and you get errors shown on screen. In file form, search for arma2.rpt.

Share this post


Link to post
Share on other sites

NWN uses a scripting language that heavily follows C/C++. T'was easy to figure it out.

But thanks for the insight anyway. Does sort out a few things I was confused about.

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  

×