OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: majoroz001 on 22 Jul 2008, 21:37:43

Title: Vehicles in an Ambush
Post by: majoroz001 on 22 Jul 2008, 21:37:43
Hi, i've been looking all over for the answer to my question. I found another post with my question, but the answer didn't help me at all. so... here's my question:

I have a 3 car convoy a Humvee w/ 50 cal in the lead, 5 Ton truck with my squad in the middle, and another humvee with a 50 cal protecting the rear. My squad, in the 5 ton, is not part of the convoy's group. In the middle of my mission, i make it so that the trucks run into an ambush. My problem is, the trucks swurve all over the road and go off-road. Is it possible to make the trucks speed through the ambush while the two gunners are returning fire?

Would putting civillian drivers in the trucks (while keeping the gunners friendly) help?
Title: Re: Vehicles in an Ambush
Post by: schuler on 23 Jul 2008, 12:11:44
this might help.
5tonname doFollow hummer
make an object like another truck or man or a marker,, ect where you would like the 5ton to retreat too
then add a trigger at the ambush for the truck to retreat by using this code, this is set to move to a marker on you map
5tonname doMove getMarkerPos "Markername"
hope thats right with what your tring to do
cheers schuler

oh and  :welcome: to the forums!
Title: Re: Vehicles in an Ambush
Post by: dr. seltsam on 23 Jul 2008, 18:52:27
I think your idea with the civilian drivers has potential...

Or, have the drivers and the gunners devided in different groups:

driver: setBehaviour "careless"; setCombatMode "blue"; setSpeedMode "full"  --> if you say  humvee set... "whatever", it always refers to the driver

gunner: setBehaviour "combat"; setCombatMode "yellow"

Now you say, that the driver is totally stupid and will not defend in case he disembarks..
Therefor we use this eventhandler:

Code: [Select]
humvee addEventHandler ["getout",{if ((_this select 1) == "driver") then {(_this select 2) setCombatMode "yellow"; (_this select 2) setBehaviour "combat"}}]

:) :) :D
Title: Re: Vehicles in an Ambush
Post by: majoroz001 on 23 Jul 2008, 19:27:12
Thank You both for giving ideas to try and solve my problem. Dr's idea is more what I am looking for. I am going to try it out. I just hope the driver keeps going and doesn't swurve around the road, or go off-road when he starts to get shot at  :)

UPDATE:

Thank you Dr.Seltsam, your solution worked great! now if only the ai would be more willing to open up on the ambushers rather than giving them one or two round bursts ;)