Jump to content
eviljack109

How to make an objective to clear a minefield?

Recommended Posts

I have a Minefield use'ing the A3 mine Module, but I have now idea to make a trigger fire when all the mines are deactivated.

 

I know it needs to be something like this...

if allMines are Active then don't activate...

 

or something like that. My scripting is still very rough so I am just lost on where to start to get that to where I want it.

Share this post


Link to post
Share on other sites

Not sure exactly how you would write it without playing around with the editor myself, but could you perhaps count the number of active mines, and once that count reaches zero, the trigger would fire?

 

 

 

Share this post


Link to post
Share on other sites

Somehing along the lines of... Not tested.

waitUntil { {!mineActive _x} forEach allMines };

Note that allMines means all on map. I believe this applies to user placed so might be better to do distance check or just use nearestObjects or some other command.

 

EDIT:

Quote

In Arma 3, nearestObjects is partially broken and is unable to return nearby placed explosive charges or mines when searching by classnames. Use nearObjects, nearestObject or allMines instead.

 

Share this post


Link to post
Share on other sites

@HazJ Will give that a try now will let you know. I'm hoing to try an put it in the activation field of the trigger

Share this post


Link to post
Share on other sites

@HazJ I got the following error, when putting where I said I did...

 

'call{waitUntil { {!mineActive _x} forEach allMines };}'
Error Generic error in expression.

 

Share this post


Link to post
Share on other sites

In trigger condition:

{!mineActive _x} forEach allMines

 

Share this post


Link to post
Share on other sites
11 minutes ago, HazJ said:

In trigger condition:


{!mineActive _x} forEach allMines

 

Not getting any sort of error. But not matter what I set the activation type to (i.e. "game logic" or "anybody") The trigger just won't fire.

Share this post


Link to post
Share on other sites

All mines must be deactivated. Mines must be active to start with. ALL mines (every single one is checked for !mineActive or at least should). For now, create one mine and name it testMine then change cond to:

!mineActive testMine

If that works... Try with multiple placed mines.

{!mineActive _x} forEach [testMine1, testMine2];

Then lastly, try the one with allMines above I sent you.

Share this post


Link to post
Share on other sites

@HazJ Test Results:

!mineActive testMine

Placed one mine down like you said and disarmed it. Trigger fired.

{!mineActive _x} forEach [testMine1, testMine2];

Placed another mine down, and like last time. The trigger went off.

{!mineActive _x} forEach allMines

Did not make any changes to the mines that I placed down. The trigger did NOT fire with this condition

Share this post


Link to post
Share on other sites

Try:

{!mineActive _x} count allMines < 1

Share this post


Link to post
Share on other sites
2 minutes ago, HazJ said:

Try:

{!mineActive _x} count allMines < 1

Sorry no, that just fired the trigger on the spot.

 

Share this post


Link to post
Share on other sites

Change back to:

{!mineActive _x} forEach allMines

In debug console put:

hintSilent format [":: %1", allMines];

What does it show? As said previously, this will check for every mine. This is to make sure there are no others.

 

EDIT: You can use apply command to check if mine is X distance in in list X or whatever. allMines returns array so.

https://community.bistudio.com/wiki/apply

I'll post example tomorrow. Sleep now... ZzZzZz

Share this post


Link to post
Share on other sites

And these were placed and both deactivated?

Share this post


Link to post
Share on other sites

oh sorry, That was what I got before I deactivated the mines. This is what I got when I difused them... 

::[]

 

Share this post


Link to post
Share on other sites

gegefrewwgr

In-game Triggers suck! I don't use the Editor at all really except for 4 respawn markers and playable units. Maybe someone else can help you? The trigger appears to fine right away. Demo:

https://drive.google.com/file/d/1GZuIuDsUjJlKB4u_U_QdX9fAq6e6f5An/view?usp=sharing

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

×