Jump to content
Tankbuster

sensing a naval mine detonation?

Recommended Posts

I'm trying to finish up a secondary mission, a naval mine clearance job. If all of the mines are defused, the mission succeeds - that's easy, but if a mine goes off, the mission needs to fail, but sensing the explosion is proving hard.

 

My initial approach was to put a traffic cone near it with an "explosion" event handler on it, but the cones floated away so I attached them to the mine itself, but it went all weird with the cones appearing some distance away (10m +), never on the mine, despite debug reporting the cone and the mine were very close. I switched the cone out for a emptyhelipad, but the EH never triggered when it was on that.

 

 

Share this post


Link to post
Share on other sites

have you tried adding an EH to the mine itself?

 

"killed","hitPart","hit","dammaged" might be worth trying in that order I reckon.

Share this post


Link to post
Share on other sites

Just count allMines. If one blows , the count decreases. See also detectedMines and other commands.

Share this post


Link to post
Share on other sites

I think he wants to tweak the sensory so that the mine doesn't go off all the time (distance + movement sensitivity???) or vice versa, I think anyway... Sorry if I have misunderstood. (:

Share this post


Link to post
Share on other sites
7 hours ago, das attorney said:

have you tried adding an EH to the mine itself?

 

"killed","hitPart","hit","dammaged" might be worth trying in that order I reckon.

II tried the explosion eh on the mines which never triggered but yes, I'll try the others. Thankss.

Share this post


Link to post
Share on other sites
5 hours ago, pierremgi said:

Just count allMines. If one blows , the count decreases. See also detectedMines and other commands.

Allmines decrements when mines are defused as well as when they explode. I should have said that earlier.

Share this post


Link to post
Share on other sites
5 hours ago, HazJ said:

I think he wants to tweak the sensory so that the mine doesn't go off all the time (distance + movement sensitivity???) or vice versa, I think anyway... Sorry if I have misunderstood. (:

Hi Harry!

IM unhappy with the mines in general, the ease of defusing and the lack of of explosive power, but I'm not currently looking at changing its sensitivity

Share this post


Link to post
Share on other sites

What about a EntityKilled missionEventhandler?

Check if the killed entity is the same type as a mine -> fail the mission.

 

Cheers

Share this post


Link to post
Share on other sites
51 minutes ago, Grumpy Old Man said:

What about a EntityKilled missionEventhandler?

Check if the killed entity is the same type as a mine -> fail the mission.

 

Cheers

This might have legs. Hadn't thought of the missioneventhandlers!

Share this post


Link to post
Share on other sites
9 hours ago, Tankbuster said:

Allmines decrements when mines are defused as well as when they explode. I should have said that earlier.

Hum, are you sure? allmines doesn't decrease for defused naval  mines. their p3d model changes for samefilename_d.p3d (_d as defused). On the other hand you can  make a difference between defused or not, with mineActive.

But allMines can return also terrestrial mines and explosives, so the best way is to add a trigger for your naval mines area:

 

in a repeatable, server only trigger, none,none:

cond:   isnil "trig1"

on act:  cntdefused = {_x inArea thisTrigger && !mineActive _x} count allMines; if (cntDefused > 2) then {"minefield cleared" remoteExec ["hint"]}; trig1 = true;

on deact: 0 = [] spawn {sleep 1; trig1 = nil}

 

BIKI is a mine!

Share this post


Link to post
Share on other sites
56 minutes ago, pierremgi said:

Hum, are you sure? allmines doesn't decrease for defused naval  mines. their p3d model changes for samefilename_d.p3d (_d as defused). On the other hand you can  make a difference between defused or not, with mineActive.

But allMines can return also terrestrial mines and explosives, so the best way is to add a trigger for your naval mines area:

 

in a repeatable, server only trigger, none,none:

cond:   isnil "trig1"

on act:  cntdefused = {_x inArea thisTrigger && !mineActive _x} count allMines; if (cntDefused > 2) then {"minefield cleared" remoteExec ["hint"]}; trig1 = true;

on deact: 0 = [] spawn {sleep 1; trig1 = nil}

 

BIKI is a mine!

No, I'm not sure! The eh route is a complete non starter, so I'm looking into counting and comparing using the available commands

Share this post


Link to post
Share on other sites

Right making some progress here. A detonated mine becomes objNull in my minearray, so having to cope with that, but other than that....

 

f0a72772c2.PNG

 

Damn you, beer!

  • Like 1

Share this post


Link to post
Share on other sites

Here's what I finally settled on. Eventhandlers just didn't work or was too much hassle. 

 

while {missionactive} do
	{
	sleep 3;

	minearray = minearray - [objNull];//remove any exploded mines
	if ((({mineactive _x} count minearray) isEqualTo 0) and (count minearray isEqualTo _numberofmines) ) then
		{
		missionactive = false;
		missionsuccess = true;
		"All the mines have been cleared. Well done." remoteExecCall ["tky_fnc_usefirstemptyinhintqueue", 2, false];
		};
	if (count minearray < _numberofmines) then
		{
		missionactive = false;
		missionsuccess = false;
		failtext = "A mine has gone off. You've failed this secondary mission.";

		};
	};

Couple of things to note. allMines isn't useful to me because the mission has other mines spawned in it, so I have to store all my mines in minearray.

 

Thanks everyone for your help.

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

×