OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: terran4999 on 09 May 2008, 19:35:32

Title: Suicide Bomobing
Post by: terran4999 on 09 May 2008, 19:35:32
Hey

I know there is a suicide bombing script available, but the explosion created by vehicles aren't powerful enough to destroy tanks. I wonder does anyone know of a command that will destroy the target vehicle when the suicide bomber gets within a certain range of the target???

I know to destroy vehicle is

Code: [Select]
vehicle1 setdammage 1.0
but what is the command to destory them when they are within a certain range
Title: Re: Suicide Bomobing
Post by: Gcfungus on 09 May 2008, 20:25:28
Give that t1 is the tank which will explode and t2 is the target which a bomber must be close to, try this:

Code: [Select]
#check
~0.1
_dis = t1 distance t2
?(_dis < 5): goto "check"
~1
// this is optional
hint "Bomb Ignited"
~2
hint "3"
~1
hint "2"
~1
hint "1"
~1
_pos = getpos t1
_x = _pos select 0
_y = _pos select 1
// this could be different types of vehicle weapons (in the COMREF)
_bomb = LaserGuidedBomb camcreate [_x,_y,0]
// end of optional
t1 setdammage 1

Tell me what you think.  :D
Title: Re: Suicide Bomobing
Post by: Mandoble on 09 May 2008, 22:15:46
"LaserGuidedBomb", with ""
Title: Re: Suicide Bomobing
Post by: terran4999 on 10 May 2008, 07:22:28
how do i use this script?? Everytime i put this in the initi of a vehicle, t1 explode disregarding its distance and t1 is fine.
Title: Re: Suicide Bomobing
Post by: Mandoble on 10 May 2008, 09:06:58
Code: [Select]
?(_dis < 5): goto "check" ---->
Code: [Select]
?(_dis > 5): goto "check"
Title: Re: Suicide Bomobing
Post by: Gcfungus on 10 May 2008, 10:23:12
Well, it was just a quick thing I wrote, and hadn't tested it. There were bound to be flaws.  :)