OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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:
-
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 ;)
-
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.
-
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 >:(
-
If the unit is close enough, isnt there something like:
unit action ["deactivate"]
Or something like that? :scratch:
-
If the unit is close enough, isnt there something like:
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:
-
Does deleting the mine actually work?
-
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".
-
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.
-
Re-checked and the mines are deleted without problems. This is what executes per each engineer:
_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"