iV - Ghost 50 Posted September 15, 2017 Hello, I'm looking for a way (or the best way) to realize a "disable minefield"-task. I wanna make the minefield via module and if all mines are disabled I wanna have a reaction (delete marker, change taskState, ...). I wanna place more than one minefield on the map. My first attempt: 1. Placing the minefield module 2. Given the module a variable name (Minefield1) 3. Placing a trigger with the follow content: CONDITION: !(alive Minefield1) ON ACTIVATION: ["TaskSucceeded",["","Blablabla."]] call BIS_fnc_showNotification; But this won't work. Any ideas? Share this post Link to post Share on other sites
pierremgi 4909 Posted September 15, 2017 place the trigger at the exact position of the minefield module. Same position, orientation, sizes and shape. condition: {mineActive _x && _x inArea thisTrigger} count allMines == 0 Not tested. I'm using setTaskState for the task. 3 Share this post Link to post Share on other sites
iV - Ghost 50 Posted September 16, 2017 Works fine! THX a lot. Share this post Link to post Share on other sites
iV - Ghost 50 Posted September 17, 2017 One more question: How can I delete all the mines in this area after activate the trigger? CONDITION: {mineActive _x && _x inArea thisTrigger} count allMines == 0 ON ACTIVATION: ["TaskSucceeded",["","The minefield near Therisa was destroyed."]] call BIS_fnc_showNotification; deleteMarker "M2"; deleteVehicle "Therisa_Mines1"; Share this post Link to post Share on other sites
pierremgi 4909 Posted September 17, 2017 Probably different ways to do this. When a mine is deactivated, it no longer belongs to allmines... it becomes a groundWeaponHolder, or more exactly a dummy weapon inside a GWH. You could use: {deleteVehicle _x} forEach (getpos Minefield1 nearSupplies 50 select {_x isKindOf "groundweaponholder"}) or thisTrigger instead of mineField1 if you are inside the trigger act. To delete the marker (if marked by the module), the created minefield has 2 markers (area and text) named ["BIS_site_0","BIS_siteArea_0"], ["BIS_site_1","BIS_siteArea_1"] for second minefield... If you don't want to bother with the minefield creation order, {deletemarker _x} forEach (allMapMarkers select {getMarkerPos _x distanceSqr minefield1 < 1}) Share this post Link to post Share on other sites
iV - Ghost 50 Posted September 17, 2017 THX a lot. I'll try this to delete the mines inside the disarmed minefield: ON ACTIVATION: {deleteVehicle _x} forEach (getpos thisTrigger nearSupplies 50 select {_x isKindOf "groundweaponholder"}); For what exact the "50" are? Is it 50 meter, 50 supplies or what is it? Delete Marker: I don't use module marked marker. For every minefield I've placed a own area marker (M1, M2, M3, ...). This area marker get deleted if the mines are disabled. Works fine. ON ACTIVATION: deleteMarker "M1"; Share this post Link to post Share on other sites
pierremgi 4909 Posted September 18, 2017 NearSupplies General commands 1 Share this post Link to post Share on other sites
iV - Ghost 50 Posted September 20, 2017 After disarming the minefield I get the massage but the mines dosn't deleted. The trigger and the module are on the same place. Maybe the APERSMINE isn't a part of the "groundweaponholder" after disarming? MINEFIELD MODULE: Variablename = Charkia_Mines1 SHAPE = Ellipse SIZE A = 35 SIZE B = 35 Mine = APERSMINE Count = 10 TRIGGER: SHAPE = Ellipse SIZE A = 35 SIZE B = 35 CONDITION: {mineActive _x && _x inArea thisTrigger} count allMines == 0 ON ACTIVATION: ["TaskSucceeded",["","Das Minenfeld bei Charkia wurde zerstört."]] call BIS_fnc_showNotification; deleteVehicle "Charkia_Mines1"; {deleteVehicle _x} forEach (getpos thisTrigger nearSupplies 35 select {_x isKindOf "groundweaponholder"}); Share this post Link to post Share on other sites
pierremgi 4909 Posted September 20, 2017 Works fine for me. your script probably hangs on deleteVehicle "Charkia_Mines1". A string is not a vehicle. You only can deleteMarker like this. Try deleteVehicle Charkia_mines1; On the other hand, there is no need to delete such module. Modules are just kind of script. Once mine spawned, it refers to a variable container/handle. Nothing more. Share this post Link to post Share on other sites
iV - Ghost 50 Posted September 20, 2017 Delete module: I had hoped that it would improve the performance when the modul is gone. In my missions I have a lot of tasks, objects, ... . But I'm not a coder, and if you say that deleting is not necessary, then I believe you. In one of my other tasks I have to close a valve. In this case I delete the module with this: deleteVehicle ((Alikampos_Smoke2 getVariable "effectEmitter") select 0); Works fine. Can't see any problems. What do you think? Share this post Link to post Share on other sites
pierremgi 4909 Posted September 20, 2017 55 minutes ago, iV - Ghost said: deleteVehicle ((Alikampos_Smoke2 getVariable "effectEmitter") select 0); Works fine. Can't see any problems. What do you think? Fine! Share this post Link to post Share on other sites