Jump to content
Sign in to follow this  
Nephris1

AI de/activate mines

Recommended Posts

1.Is there a command for the new ingeneer AI to drop mines and to deactivate mine?

I guess i will be sth like "unit action ["deactivate" ....."

Has anyone already figured out how to use this?

2.Is the state of a mine then asked by "mine isNull", if it got deactivated?

Share this post


Link to post
Share on other sites

I'd like to bump this up.

Really want to know how the heck you can detect if a (editor placed) mine is armed or deactivated??

Mines are very resistant to almost all of the script commands to detect objects and classes to begin with. The only exception is nearestObject which at least returns something - yet not really usable afterwards...

Share this post


Link to post
Share on other sites

Hi buddy,

i guess i spend feeled 24h to get a solution for those editor placed mines.

But adressing any scripts to it becomes senseless like fish with tits.

I can remember a mission in the BAF campaign, where u have to deactivate as engineer a few mines.

But as we are not allowed anymore to open at least missions or campaigns,

a little sneak into the scripts/functions is impossible.

Maybe we would have found a solution there.

But to be honest i gave up looking for a solution, which doesnt intend i am not interested in it anymore.

Maybe it is possible to get the animstate of a unit instead of the mine.

But that solution is faar from being waterproof.

Share this post


Link to post
Share on other sites

I found this Detecting mine defusal topic at ofpec.com

It boils down to this code posted by Mandoble:

_mines = [mine1, mine2 ...];

_defused = {(isNull _x) || ((vectorUp _x select 2) < 1) ) } count _mines;
if (_defused > 0) then
{
  hint format["%1 mines defused", _defused];
};

Unfortunately I can't test it right now.

Nephris, maybe you can test it and report your findings here?

Share this post


Link to post
Share on other sites

Well I'm a noob so forgive me if this is gibberish but wouldn't attaching a repeating trigger to an AI work?

If you set it to a 1 or 2m area set with a condition "_mine1 or _mine2 etc... in thislist;" to detect the mines - then hideObject, animation or run a script of your choice (detect if mine is activated or not etc)?

Give the unit a name, give the trigger a name. Then in the unit's init:

triggername attachTo [unitname, [0,0,0]];

The trigger will move wherever the AI goes I think.

Don't ask me how to write a script for all that lol!

Edited by PELHAM

Share this post


Link to post
Share on other sites

This might be what you are looking for:

http://community.bistudio.com/wiki/ArmA_2:_Actions

Deactivate

Description: Causes a unit to deactivate and take a active satchel charge placed by any unit. This action can be performed upon a satchel object from any distance.

Syntax: unit action ["deactivate", targetUnit, targetObject]

Where unit is any unit (they will perform the action animation as if deactivating a satchel charge). targetUnit will have the deactivated satchel charge added to it's inventory. targetObject is the armed satchel object to be deactivated (class "pipeBomb" or "timeBomb").

Examples: soldierOne action ["deactivate", soldierOne, mySatchelCharge]

soldierOne action ["deactivate", soldierOne, nearestObject [soldierOne, "pipeBomb"]]

DeactivateMine

Description: Causes a unit to deactivate any armed landmine that is within about two meters of a unit. Neither unit requires the ability to disable landmines.

Syntax: unit action ["deactivateMine", targetUnit]

Where unit is any unit, who will perform the action animation. The closest landmine to targetUnit will be deactivated.

Example: soldierOne action ["deactivateMine", soldierOne]

Share this post


Link to post
Share on other sites

The best solution would be to have any unit able to ID a satchel or mine unless they are hidden somehow. Then only special EOD units are likely to find them.

Only Special EOD units should be able to deactivate mines, maybe satchels deactivated can be for everyone as if there is a simple off switch. But mines and IED's require special skills. If non skilled units try it there could be a roll the dice to give them a chance of explosion.

Then the EOD should get the deactivate abilities only when he is at the site.

To get an ai unit or group to do this dynamically would require complex scripting. Not impossible, just not easy, but possible. The player can direct the AI more easily than having the AI direct themselves into random areas that may have explosives. Im thinking other AI groups can run scripts with nearobjects command and can activate the AI scripts if they detect explosive objects in their nearobjects array.

_list = position unit1 nearObjects 10 

You could run this every few seconds like a radar pulse.

Then if any of these strings are IN the _list....

;Put this in an init script or onactivation of an object....
Bombs = ["PipeBomb","TimeBomb","Mine","MineE"]

Sorry if thats not all the bombs its just a quick list.

You will have to check each item that is in the _list array and find out if it is IN a certain array.

_counter = 0
_item = _list select _counter
_typeofitem = typeof _item
? _item in Bombs:hint format ["There is a %1 here!",)_typeofitem]

Simple example and you have to iterate through the array by incrementing counter + 1 with a loop.

I personally would like a whole group that dispatches to an area and can scan autonomously for explosives or follow directions to deactivate specific artifacts.

For this example and just to get going I would just make a group and in the leader init put:

eodteam = group this

Then in the first script you could get started by putting some code in the condition right after the hint....

? _item in Bombs:hint format ["There is a %1 here!",)_typeofitem]
? _item in Bombs:[getpos _item,eodteam] exec "Dispatch_EOD.sqs"

In that script you will have the position of the bomb and the team to tell to come and deactivate it. You could use addwaypoint to get the whole team to move there or domove command for an individual unit of the group to go there. You can use the deactivate actions once they get there. You can give them playmove command to play animations to better simulate the work they are doing. You can make a loop to check the distance and health of the team on its way, exit out if they got killed in transit.

It would also be nice to have a specialist in group for convenience. A seperate set of scripts can be used for this with much of the code from the group scripts copied in....

Share this post


Link to post
Share on other sites

My desire is to detect if mines have been deactivated which would require mines to be accessible with any commands which work for other objects (naming mines, finding them with nearObjects etc.).

Making AI units deactivate mines is not a big problem I think.

I adopted a solution I found in Sui's Ofp mission "Facile Ground":

Place the mines normally in the editor to create your minefield. Then place reference objects on top of the mines - invisible H works well if you don't want to land AI helicopters near the minefield.

You have to name the reference objects and call a script which checks distances between engineer units and the named reference objects.

I'm going to post an example tomorrow.

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  

×