I already asked you people for help, but apparently nobody knows the answer to the "action" mystery (no problem
)
I'll tell you why I desperately need the command: for the moment I'm scripting some kind of "Easy Company" mission (Band of Brothers). But - in OFP version 1.30- there seem to be a lot of bugs and undocumented features. It would be a great help if some of you guys helped me out here.
#########################################
For this reason I propose we start some kind of "undocumented" (or less known) list. Here's my contribution:
(maybe you can find it one day at ofp.kroffel.com)
1) Public variables have not to be declared publically if you declare them in an "init.sqs" script - at least that's what I think. I saw some scripts by snypir and found out he didn't use a single public variable.
What's the use of PublicVariables, you'll probably ask ... You use them to define global - not (script) local - variables. This means "variables that keep on living outside scripts". Example: I'm building the E-company mission. If you want to lay a Firing Base, or give covering fire, you can first check wether there is already a firing base etc, by defining a public variable (or just a variable in the init.sqs script) and switching it to true:
eg.
PublicVariable "FiringBaseBusy"
FiringBaseBusy = FALSE
After you have declared the variable globally, you can alter it through a local script (eg. the Firing Base script)
Moreover you can declare a public variable in any script you want (when you need the variable) - although, of course, I think it's better style to declare all Public Variables beforehand.
Conclusion: you can use PublicVariables not only for multiplayer misions, but also for Single Player missions. If you're a bot creative you can even pass them as "kinda arguments" to scripts !!!
2) Arrays can be initialised by declaring an empty array. Honestly spoken: I first tried:
Array =
- , which gave me an array containing (of course) "0"
Array = [ObjNull], which gave me an object with initially 1 element, "ObjNull"
I thought it was impossible to declare an empty array (since I am very suspicious to "empty memory space" - it usually gets filled up with all kinds of garbage - try it in JAVA !!!), but finally I saw you could initialise it with
Array = []
simple, but undocumented...)
3) It is impossible to make groups act the way you want (eg. try the <Group setUnitPos "DOWN"> command for a group, it won't work, you'll need a for-like structure)
4) Only the < [Array] exec "script.sqs"> command accepts strings, which have been formatted by the <format ["String %1", _variable]> command. So don't try to use it to name units for example in a for-structure <_u% = Units Player select _i>, it'll return the error: "error type: expected object, instead of string" (or something like that).
5) OFP scripting does not accept strings within strings:
I tried \", ', but neither of them worked. You can declare some strings as varables, eg <_wp0 = "M16"> after which <Unit AddWeapon _wp0>, but you can't replace a "BLUE" or "UP", ... string by a variable
Note that you cannot use it in <"_x blabla" Foreach Array> structures, neither in <[Array] exec "script.sqs"> structures.
(I think we should claim the right to use nested strings !!!)
6) I have a bug with <AddAction> commands being displayed twice in a demo ... sometimes ...