OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mandoble on 02 Oct 2006, 22:58:51

Title: Engineers and mines
Post by: Mandoble on 02 Oct 2006, 22:58:51
So, there is no way to order your engineers to deactivate mines on a minefield?  :blink:
Title: Re: Engineers and mines
Post by: XCess on 02 Oct 2006, 23:06:34
Select the engineer with F button, press six for action menu, and if the the engineer is right on top of the mine he will be able to deactivate it. If he aint, move him on top ;)
Title: Re: Engineers and mines
Post by: macguba on 02 Oct 2006, 23:19:01
That works in gameplay, if you are the group leader and have engineer loons in your group.

If you are the mission editor, it's very, very difficult because mines are, how shall I put it, "special" objects in OFP.

Sui and I both developed methods for dealing with this problem.    Tell us more about what you are trying to do.
Title: Re: Engineers and mines
Post by: Mandoble on 02 Oct 2006, 23:40:42
Quite easy, there is a mine field, that is a lot of "Mine" objects, and the player is the leader of a group with several engineers. I dont want to force the player to place each engineer just over each mine to order them to deactivate it. I was expecting some more dynamic way to do that, similar way as when you order your men to heal at medic, pick up ammo, etc.

I ended up with a small script attached to each engineer, as soon as there is a nearestobject of type "Mine" and range is closer than 2.5, the engineer switchmoves to medic "watching" the mine and the mine is deleted. This way you just need to order them to walk through the minefield for a bit. Anyway, I'm quite disappointed with OFP engineers and Black Ops  >:(
Title: Re: Engineers and mines
Post by: JasonO on 02 Oct 2006, 23:59:38
If the unit is close enough, isnt there something like:

Code: [Select]
unit action ["deactivate"]

Or something like that?  :scratch:
Title: Re: Engineers and mines
Post by: Mandoble on 03 Oct 2006, 00:07:22
If the unit is close enough, isnt there something like:

Code: [Select]
unit action ["deactivate"]

Or something like that?  :scratch:

There are actions to deactivate ("DEACTIVATE MINE") or pickup mines ("TAKE MINE
" placed by other units, but these actions do not work with mine objects placed in the map editor  :blink:
Title: Re: Engineers and mines
Post by: macguba on 03 Oct 2006, 00:18:52
Does deleting the mine actually work?
Title: Re: Engineers and mines
Post by: Mandoble on 03 Oct 2006, 00:22:59
Yes, that works fine. Curiously, the type of the object is not MineMine (which is what you see if you open the mission.sqm), but just "Mine".
Title: Re: Engineers and mines
Post by: macguba on 03 Oct 2006, 00:28:29
Curious ... when I struggled with this mines could not be deleted.   But that was a long time ago and I do vaguely remember something about it being fixed in a patch.
Title: Re: Engineers and mines
Post by: Mandoble on 03 Oct 2006, 00:47:17
Re-checked and the mines are deleted without problems. This is what executes per each engineer:

Code: [Select]
_unit = _this select 0
#check
_obj = nearestObject [_unit, "Mine"]
?(typeOf _obj == "Mine") && (_obj distance _unit < 3): goto "delete"
~2
goto "check"

#delete
_unit doWatch _obj
~1
_unit switchMove "Medic"
~1
deleteVehicle _obj
~2
goto "check"