OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: greg147 on 08 Aug 2007, 18:00:45
-
Hi all,
Is there a way to detect whether a group of editor-placed mines have been defused? I seem to remember seeing it in OFP, but couldn't find anything on the forums (or comref)
Thanks
-
_mines = [mine1, mine2 ...];
_defused = {(isNull _x) || ((vectorUp _x select 2) < 1) ) } count _mines;
if (_defused > 0) then
{
hint format["%1 mines defused", _defused];
};
-
Ah thanks. How would I call that? Tried acouple of ways but got 'type string, expected code' errors.
-
If you prefer SQS:
;Defusedmines.sqs
_mines = [mine1, mine2 ...]
_defused = {(isNull _x) || ((vectorUp _x select 2) < 1)} count _mines
? _defused > 0: hint format["%1 mines defused", _defused]
-
Ah, OK, thanks (I havn't worked out SQF yet, I tend to stick with SQS)
I get this error when I try to use the sqs version
'..._x) || ((vectorUP _x select 2) < 1) ) } |#|count _mines'
Error count: Type String, expected code
I must be calling the script up wrong. Where would you put [] exec "defusedmines,sqs" for this particular script?
Thanks
-
Sorry, there was an extra ) there (fixed above).
Here is an example mission with the script in SQF format and using a position and radius instead of a list of mines.
-
Thanks, that works nicely. :D
-
Lee, your question has no relation at all with the current topic:defused mines, please open a new thread about the satchels.
-
I found this topic after a long search and tried out Mando's code in Arma2 OA to no avail.
vectorUP _x select 2returns any and
isNull mine1returns bool however putting this into a condition line of a trigger does not fire the trigger when the mine is active or deactivated.