OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Gooner861 on 19 Apr 2004, 18:27:04

Title: Exploding car
Post by: Gooner861 on 19 Apr 2004, 18:27:04
I know this script has kind of been done wen the car reaches a particular speed but what im interested in is having a car just kamikaze into a truck or a house and explode. How and what do i need to write?
Title: Re:Exploding car
Post by: j-man on 19 Apr 2004, 21:26:51
Well, there is a Kamakazie script at the editors depot. You could use that along with:

Code: [Select]
?(CAR distance TRUCK < 2) : CAR setdammage 4
Title: Re:Exploding car
Post by: dmakatra on 20 Apr 2004, 20:17:04
Ya, I wrote a sucide bomber script ages ago that works with cars as well... It sucks so hard. I think I wrote it just after I finnished reading half Johan's Scripting Tute lol. :P

Anyway, it does work even though the code isn't the most beautiful. ;D

:beat: *Gets Shot* :beat:
Title: Re:Exploding car
Post by: Grendel on 20 Apr 2004, 22:11:35
Haven't seen the others, but heres one that should work nicely with cars, people (suicide bombers), anything really:

Code: [Select]
_bomber=nameofbomber
_target=bombertarget

;_detdist is distance from target that detonation occurs
_detdist=10

;change explosive for more/less bang if you want
_explosive="shell125"


;Check distance and close with target
#discheck
_bomber move getpos _target
_dis=_bomber distance _target
?(_dis > _detdist):goto "discheck"

;detonation
?(typeof _bomber==man):deletevehicle _bomber
;line above gets rid of body if bomber is a man

_explosive camcreate getpos _bomber
exit

Should work fine, but was not actually tested.

-Grendel