OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Killzone on 09 Dec 2005, 03:50:05

Title: Detecting enemies
Post by: Killzone on 09 Dec 2005, 03:50:05
Is there a script I can use that if a jeep is driving with some soldiers in it and if they detect an enemy they stop the vehicle (A safe distance away) and get out to fight? The problem I am having is they are getting destroyed while in the jeep by an enemy tank.

BTW: I am controlling this unit by scripts and they are not part of my group. Dont know if this matters.

Thanks people
Title: Re:Detecting enemies
Post by: Trapper on 09 Dec 2005, 11:04:58
I think the best you can do is to script the jeep like it has detected the tank in the moment you need it.

The jeep has no "radar" like the tank and will always be detected first. - And if you reveal the tank for them, you've already started to script the encounter, so just do it completely. :)
Title: Re:Detecting enemies
Post by: hardrock on 09 Dec 2005, 11:43:06
The best solution would probably be to check, at which distance the tank recognises the jeep and set a trigger with that radius on the tank (if it's static) or doing it in a script checking the distance between jeep and tank (if it's moving).
Title: Re:Detecting enemies
Post by: macguba on 09 Dec 2005, 12:14:25
It's perfectly possible to use a combination of triggers and waypoints to get the loons out of the jeep and behaving how you want.    (And, as always in ofp, there are various ways to do it - you could use a script if you want.)  But as Trapper says, the tank will almost always detect the jeep first so it's all likely to be academic.

Have a think about this ... what do you really want to happen?   Do you really want a tank there?



Assign the loons to the jeep and put them in it.

Trigger1:-
East detected by West, repeatedly
On Activation:  units grp1 orderGetIn false
On Deactivation:    units grp1 orderGetIn true

Loop:-   (either in script or waypoint)
Trigger1 setPos getPos leader grp1
[grp1, 2] setWPPos getPos leader grp1   (Seek & Destroy)
[grp1, 3] setWPPos getPos leader grp1    (Cycle)

Not guaranteed, that's just a sketch.   You'll need a couple of switch triggers synchroed to waypoints if you want this to be able to happen more than once.