OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect on 01 Sep 2005, 18:10:09
-
I have a pilot that gets shot down. I have no control over where he comes down.
When he hits the ground I want him to take cover. Unfortunatley he just sits there. I've tried the Stealth command but it doesn't work.
-
Could you fake it by using nearestobject to find the nearest bush? And then telling him to go here and lie down? Messy at best I know.
-
I don't understand the command.
I say,
nearestobject [Pilot1, ?]
Pilot move ?
What do I put in there in the place of the question marks? There are hundreds of bushes in the area.
-
what you're looking for is a type of bush. there could be hundreds, but there may only be a handful of types. unless the area you're talking about consists of an entire island, make a scout missionette with the neatestobject command linked to a hint which gives the type of object.
here's a wee script that will help out
#loop
_color= [[0.8,0.8,1,0.3],[0.8,0.8,1,0.6],[0.9,0.9,1,1],[1,1,1,0.5]]
drop ["halflight","","Billboard",2,1.5, [0,5,1],[0,0,0],0,1.275,1,0,[0.5,0.75,0.1],_color,[0],0,0,"","",player]
hint format ["%1", nearestobject [(getpos player select 0) + (5*sin(getdir player)), (getpos player select 1) +
(5*cos(getdir player)), getpos player select 2]]
~1
goto "loop"
whatever types are thrown up in the hint, take a note of them. then in your 'hiding' script, use
_obj = nearestobject [loon_name, bush_type]
loon_name domove getpos _obj
you could incorporate a loop through an array of all possible bush types and find which is the closest of them too. just remember there's only a 50m radius for nearestobject.
-
Hmmm.......Unfortunately no bushes have classnames.
Planck
-
How about creating a bush near where he lands and send him there? Unless the player might see that is.
-
Could I create trigger boxes and send him to a different location depending on what box he lands in?
I have an idea but I'm not sure about it.
My target is in the middle in a box. There are four boxes around the centre target box. If he lands in any of the outside boxes that's fine, he'll get sent to a pre-defined bit of cover within that box. If he lands in the centre box, I'm not sure what to tell him. I can't do away with the centre box because I don't want him walking through the target area on the way to his hide location.
-
which is a pretty good idea.
(http://www.tumeric.co.uk/mrb/flashpoint/boxes.jpg)
if the loon lands in the target box near to the objective, then as with reality, he may well get spotted and torn to bits, or he may well survive. as per the picture, he will always be in one of the four surrounding target boxes, and depending on that, you tell him where to hide...
-
Rather than triggers and boxes why not just check his distance from a few of the inbuilt objects on the map. From that you could customise how he reacts down to the finest detail where it is important.
-
Done. It's working well. The guys sccots off towards his hiding place nicely. Thanks fellas.