Jump to content
Sign in to follow this  
BennetArms

Count Mines layed as a Mission Target

Recommended Posts

Hi everyone =)

I started to make a Coop-Mission, where one of the targets is laying a little minefield in a sector. I can detect named mines, deactivated in a trigger like (MineDeactivated or !mineactive mine1, mine2, mine3 etc.). But my problem is the opposite now. When the Explosive Specialist in my group lays his mines at the target-area, I can´t get a Trigger to count the amount of layed mines, so I could fire the Trigger off to move on.

Can anybody give me a hint on doing this?

Thank you.

Ben.

Edited by BennetArms

Share this post


Link to post
Share on other sites

this addEventHandler ["fired", {
if (_this select 2 == "DemoChargeMuzzle") then {
	hint "Placed a charge!"
}
}];

Change DemoChargeMuzzle for whichever type of mine you were wanting to check for.

BoundingMineRangeMuzzle, DirectionalMineRangeMuzzle, MineMuzzle, PipeBombMuzzle and so on.

Share this post


Link to post
Share on other sites

Thank you for that quick reply and your help Kylania.

It works on my Explosive specialist. Now I only need to know, how the trigger gets fired, if my Soldier lays 3 MineMuzzle. So that the Taskstatus, that is linked to the Trigger, where the mines are layed, change to success.

I try something like "{_x in thisList} count "MineMuzzle" > 3"

Please forgive me, if this don´t make any sense, as I am new to editing. I thought, Arma 3 would be a good start to get on with editing ;)

Edited by BennetArms

Share this post


Link to post
Share on other sites

hmm. So you want to know when 3+ mines have been laid in a trigger? Does it really matter who puts them there?

Trigger condition of:

{["mine_", str(_x)] call BIS_fnc_inString} count (thisTrigger nearObjects 10) > 2

That'll detect 3 or more placed mines within 10 meters of the trigger regardless of who placed them. No need for the eventHandler from above.

Share this post


Link to post
Share on other sites

Thank you Kylania!

My Trigger fired off right away, as i layed the third mine. You saved my Mission-Idea and propably my evening :D

And your right, it doesnt really matter who is laying the mine, as long as the job is done ;)

Edited by BennetArms
Answer

Share this post


Link to post
Share on other sites

To explain the solution, it looks like placed mine don't have classnames so isKindOf and typeOf wouldn't help us. They are just: 12314: mine_ap.p3d or something as their result in nearObjects. So I just took the near objects, turned each result into a string and compared to see if "mine_" was in it. If so chances are you have a mine! :)

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
Sign in to follow this  

×