Nice script, but still some issues (I wouldn't worry too much about having to have one script instance running per POW, since there are unlikely to be dozens of them). Just because I've given a long list doesn't mean that I don't like the script, and some of the suggestions are not strictly necessary, but I thought I'd mention them:
1) You could be more explicit and say that everyone in the demo mission has "this setCaptive true" on them, so that there isn't any fighting, but in a real mission, you'd just make the POWs captives. I'd also remove weapons from the POWs in the demo, but that is just for aesthetic reasons and isn't important.
2) In
capture.sqf, you broadcast data every few seconds:
NORRN_POW_string = call compile format ["'We Have Liberated POW: %1, Remaining Unliberated POWS: %2'", name _unit, _remain_POWS];
sleep 1;
publicVariable "NORRN_POW_string";
sleep 1;
NORRN_POW_captured = true;
sleep 1;
publicVariable "NORRN_POW_captured";
sleep 5;
NORRN_POW_captured = false;
sleep 2;
publicVariable "NORRN_POW_captured";
This could cause no end of trouble with data synchronisation if two players capture someone within a few seconds of each other (MP only, of course). You should do:
NORRN_POW_string = call compile format ["'We Have Liberated POW: %1, Remaining Unliberated POWS: %2'", name _unit, _remain_POWS];
publicVariable "NORRN_POW_string";
And in the trigger initialisation:
_trig_0 setTriggerStatements ["NORRN_POW_string != """";", "titleText [NORRN_POW_string, 'PLAIN', 0.7]; NORRN_POW_string = """";",""];
This still isn't perfect, but it requires people capturing POWs frames apart, rather than several seconds apart, for it to fail.
3) This code will only work if all of the players have been named in the editor (which you haven't asked for in the documentation):
call compile format ["capture_%1_%2 = %1 addAction [""Capture %2"", ""POW_sqf\capture.sqf"",[_unit, _group,_NORRN_POW], 0, false, true]", player, _unit];
If the players aren't varnamed, then %1 could have spaces in and ruin the creation of the capture_%1_%2 variable. In truth, though, you don't need the player's varname in the captured variable, since it isn't ever broadcast and it is always equal to
player anyway. It also doesn't have to be global, since it is only ever referenced in that script. Save the mission designer some effort and use the simpler:
call compile format ["_capture_%1 = player addAction [""Capture %1"", ""POW_sqf\capture.sqf"",[_unit, _group,_NORRN_POW], 0, false, true]", _unit];
You'd need to change any script that assumed the player varname was in the captured variable too.
4) It would be nice to have the instructions in a
readme.txt (just copy-and-pasting the release documentation from the forum would be fine).
5) When you make the action labels and messages, you just format the varname of the POW into it (e.g. "Capture POW1" action). It would be better if you used their name (
name _unit) instead since then it is more human-friendly. This also prevents the mission-maker from using even more unreadable names, such as this_guy_is_a_POW_and_needs_releasing, which is fine as a variable name (if you like typing!), but not as a name shown to players.
6) If you recalculate "_group" every time you use it in
POW_join_action.sqf, then the script won't be broken in missions where you can change groups in-game (such as Evo).
7) You might like to look at the "{ } count _array" version of
count to simplify some of your code (Not important at all, but just thought I'd tell you about it)
8) Seemed to work fine in SP, though SIX_misc addon threw up an error for some reason (which didn't affect your script). I suspect it might be a global getting overwritten; You've used you NORRN tag on some of the globals, but not on others (such as:
call compile format ["POW_%1 = false", _unit];
which could overwrite a variable using the POW_ tag).
9) Not actually JIP compatible since anyone joining
after someone has been captured will not be aware of this, since all the POW_* variables will be false (not a problem, but you should list it as a limitation).
10) Once released, POWs should really be unset as captives. This prevents players from using the release action until they think it is safe and prevents the player giving them a gun and using them as stealth troops ;P If the POWs stayed in a separate group and just followed the player group around, then leaving them as captives might be reasonable.