Jump to content
Sign in to follow this  
Asclepius

Task "Success" activated by deactivation of multiple mines?

Recommended Posts

I tried searching and found some old things for Arma2 based on land mines, but I'd like some help on sea mines, either moored or the bottom ones. I'd like the player to have to "clear" a mine field by deactivating 10 mines, with a counter, and the success of that task triggered by deactivation of all of those mines. I can't quite figure out how to interrogate the game to see if any of the mines are deactivated. Would it be possible to put a script in the initialization of each mine that may not do it through the game mechanic of deactivate, but would be counted in terms of activating the success of the trigger? (something with [addaction])?

Thanks

Share this post


Link to post
Share on other sites

The showcase scuba version uses an FSM to check the state of the mine. What you are looking for is this mineActive. I would recommend you download the BI tools and open up the mine FSM to see how it works. Good luck!

An end condition for your mission would like this. Mines are named mine1 mine2 mine3.

{mineActive _x} count [mine1, mine2, mine3] == 0

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Thanks Cobra. I have the BI Editing Tools 2. Where do I find the mine FSM? I can't seem to find anything related to the showcases other than my saved games. I downloaded Eliteness as well.

Share this post


Link to post
Share on other sites

Go to your steam common folder, find ARMA 3, click on addons, find missions_f, copy the file and paste somewhere (desktop or in your eliteness folder). Then use eliteness to open the folder. Find the mission you want and drag it your document folder where you keep your saved missions and drop it in. If you have the tools installed you can just click on the FSM and see how it runs.

---------- Post added at 22:57 ---------- Previous post was at 22:32 ----------

Here try out this sample mission I just created, let me know if this works. Maybe I can rework the FSM later tonight to make it more fluid.

http://rapidshare.com/files/212200282/Disable_mines.zip

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Thanks, Cobra. That works awesome for that particular task. Can I use that same type of script in the MissionTasks and Init to set tasks rather than using the triggers, or are they used in conjunction with one another? For example, if I want to make the first task to board a helicopter, I just use this:

case "task_1";
{
if (_taskState == "") then
{
	[units group player,_taskID,
		[
			"Board the helicopter.",
			"Board the helicopter",
			"BOARD"
		],
		[position Heli1 select 0, position Heli1 select 1,0],
		TRUE
	] call BIS_fnc_taskCreate
} else {
			if (_this == "Current") then {_taskID call BIS_fnc_taskSetCurrent} else {[_taskID, _this] call BIS_fnc_taskSetState}
		}
};

And then have the second task as "investigate" use a similar one on a trigger or object named Task_2?

(I got the heli option to work, but the second task isn't working.

Thanks again.

Share this post


Link to post
Share on other sites

Yes but you dont need to put in:

[position Heli1 select 0, position Heli1 select 1,0] 

You can just use

getpos Heli1.

Share this post


Link to post
Share on other sites

An end condition for your mission would like this. Mines are named mine1 mine2 mine3.

{mineActive _x} count [mine1, mine2, mine3] == 0

Just would like to say that this worked a treat for AT/AP mines also. Been googling for a bit and there is a lot of old stuff about detecting mine deactivation regarding getpos as the mines change pos once deactivated. However, this is much simpler and simple is good.

Thanks!

Share this post


Link to post
Share on other sites
The showcase scuba version uses an FSM to check the state of the mine. What you are looking for is this mineActive. I would recommend you download the BI tools and open up the mine FSM to see how it works. Good luck!

An end condition for your mission would like this. Mines are named mine1 mine2 mine3.

{mineActive _x} count [mine1, mine2, mine3] == 0

Great info @cobra, works a treat!

Share this post


Link to post
Share on other sites

{mineActive _x} count [mine1, mine2, mine3] == 0

Worked in editor single player & if you host a mission.... But once again NOT (at the moment) for us on a Dedicated server, the mines are not seen as alive at the start of mission & the trigger activates at the start without needing to disarm the mines. Dont know if an update patch has caused this or what?

Found a basic simple solution using two triggers & the !alive name of mines with a second trigger for the hint text, that will (at the moment work on dedicated)

Example;

FIRST TRIGGER.

Condition

!mineActive mine1 AND !mineActive mine2 AND !mineActive mine3 AND !mineActive mine4 AND !mineActive mine5 AND !mineActive mine6

Activation

Obj1 = true;publicVariable "Obj1";

SECOND TRIGGER

Condition

Obj1

Activation

hint"All the mines are deactivated"

You need a second trigger with a few seconds delay for the hint to show on a dedicated server, wont work if it's in the first trigger, no idea why jusy one of the many vagaries of dedicated servers.

But the above seems to work at the moment.

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  

×