OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: snozzdog on 29 Jun 2008, 16:04:09
-
How do i make a trigger that will set off an IED next to a vehicle as it drives past?
If possible, can i have a formula to put in the trigger so the IED sets off at any west vehicle but doesnt destroy it completely, so my vehicle can go through a few before getting destroyed
In other words a whole convoy doesnt get destroyed by one IED
-
hi snozzdog
[thislist select 0, "grenadehand", 0, 1] exec "ied.sqs"
_vehicle = _this select 0
_ammo = _this select 1
_offset = _this select 2
_variance = _this select 3
_posX = (getPos _vehicle select 0) + (random _variance) - (_variance / 2)
_posY = (getPos _vehicle select 1) + (random _variance) - (_variance / 2)
_dir = getDir _vehicle
_speed = (speed _vehicle) / 15
_offset = _speed + (_offset + (random _variance) - (_variance / 2))
_cX = _posX + (sin(_dir) * _offset)
_cY = _posY + (cos(_dir) * _offset)
call format [{_boom = "%1" camCreate [%2,%3,0]},_ammo,_cX,_cY]
exit
the smaller the trigger size, the closer the exsplotion will be to the vehicle, and it will only be the power of a hand grenade
cheers schuler
-
Ahh cheers, do i put that all in the 'init' field of the trigger?
-
I think
[thislist select 0, "grenadehand", 0, 1] exec "ied.sqs"goes in the on activation of the trigger.
And the rest goes in a script called ied.sqs