OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: shadow99 on 09 Jul 2004, 14:05:55
-
Is there anyway, without using add-ons, to just make an explosion activate on any spot of choice at any time of choice through the mission editor?
If not, how do I kill something using 'setDamage' but also make an explosion occur, rather than the unit just turning into toast? (I'm using M113s)
After I get the explosions sorted, my intro will finally be complete. :)
Thank you!
-
Save this script (explosion.sqs) in your mission folder:
;Script by MP - markpalmer@hotmail.com
;Based on script created by David Berka (David.Berka@nmi.at) respect is due
;creates a large explosion at an object location, vehicle, infantry etc..
;can be easily modified to accept coords, but you know that already ;-)
;
;modified a little by ponq, added shell selection.
;and number of explosions wanted
;syntax: [Location/unit to explode, ammotype, 1] exec "explosion.sqs"
;eg [m113A, "LaserGuidedBomb", 2] exec "explosion.sqs"
;would create 2 big booms (LGB's) at the M113A.
;?!(local server):exit
; if you want the this for MP, add a gamelogic at your map named Server. UNcomment the previous line.
_Unit = _this select 0
_AmmoType = _this select 1
_AantalBommen= _this select 2
_keer=1
#loop1
_Explosion = GetPos _Unit
_cx = _Explosion select 0
_cy = _Explosion select 1
_cz = _Explosion select 2
_tempObj = _AmmoType camCreate[_cx, _cy, _cz]
~0.3
;this creates a short delay between the bombs. You could modify this without probs.
_tempobj = objNull
_keer = _keer + 1
? _keer > _aantalBommen : exit
~0.1
goto "loop1"
exit
-
If you want a certain coordinate to get blasted, use a gamelogic or marker that's invisible or empty.
But cool script, I'll take it too if I ever need some explosion of sorts. :)
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAWESOME.
Thanks man.
Boom...
-
An easier way to do this is put the following code in a units INIT Field
explo01 = "bomb" camcreate [getpos this select 0, getpos this select 1, getpos this select 2]
If your puting it in a trigger, change "this" to the unit's name
Oh, you can change the bomb bit to loads of stuff, some are ::
laserguidedbomb (Thats the biggest OFP explosion)
mortar (I think)
heat102 (Again, I think)
Theres loads more :)
- Ben
-
Even better...
But do I have to create a camera view of the explosion? I already have camera views scripted in my Intro and I just want an M113 to explode as the camera is moving past.
-
But do I have to create a camera view of the explosion?
In this case, the camcreate command is being used to create a shell, not a camera ;) .
-
Amen, bro, amen.
-
Excellent. So is there a list anywhere with all the different methods of using this code?
Eg "bomb"?
-
Weapon and ammo list in the ed depot.
-
Thanks.
-
check the scripts on ofpec for artillery scripts - in a mission im making at the moment i used one called "barragearea.sqs" which can create single explosions or giagantic barrages so dense it could crash your PC :o. i'd recommend this to you, even if you weren't doing single explosions!