OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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
vehicle1 setdammage 1.0
but what is the command to destory them when they are within a certain range
-
Give that t1 is the tank which will explode and t2 is the target which a bomber must be close to, try this:
#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
-
"LaserGuidedBomb", with ""
-
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.
-
?(_dis < 5): goto "check" ----> ?(_dis > 5): goto "check"
-
Well, it was just a quick thing I wrote, and hadn't tested it. There were bound to be flaws. :)