Home   Help Search Login Register  

Author Topic: IED explosions  (Read 1158 times)

0 Members and 1 Guest are viewing this topic.

Offline snozzdog

  • Members
  • *
IED explosions
« 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

Offline schuler

  • Contributing Member
  • **
Re: IED explosions
« Reply #1 on: 29 Jun 2008, 17:50:30 »
hi snozzdog

Code: [Select]
[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
« Last Edit: 29 Jun 2008, 17:54:11 by schuler »
Semper Fi

Offline snozzdog

  • Members
  • *
Re: IED explosions
« Reply #2 on: 30 Jun 2008, 10:07:13 »
Ahh cheers, do i put that all in the 'init' field of the trigger?

Offline Gcfungus

  • Members
  • *
Re: IED explosions
« Reply #3 on: 30 Jun 2008, 18:27:45 »
I think
Code: [Select]
[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
The object of war is not to die for your country, but to make the other bastard die for his.
~George Patton