OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: shadow99 on 09 Jul 2004, 14:05:55

Title: Blowing stuff up!
Post 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!
Title: Re:Blowing stuff up!
Post by: ponq on 09 Jul 2004, 14:11:42
Save this script (explosion.sqs) in your mission folder:
Code: [Select]
;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
Title: Re:Blowing stuff up!
Post by: Dubieman on 09 Jul 2004, 16:43:09
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. :)
Title: Re:Blowing stuff up!
Post by: shadow99 on 09 Jul 2004, 17:15:29
AAAAAAAAAAAAAAAAAAAAAAAAAAAAWESOME.

Thanks man.

Boom...
Title: Re:Blowing stuff up!
Post by: DBR_ONIX on 09 Jul 2004, 21:44:08
An easier way to do this is put the following code in a units INIT Field
Code: [Select]
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
Title: Re:Blowing stuff up!
Post by: shadow99 on 10 Jul 2004, 03:56:26
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.
Title: Re:Blowing stuff up!
Post by: m21man on 10 Jul 2004, 06:02:45
Quote
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 ;) .
Title: Re:Blowing stuff up!
Post by: cameronmc on 10 Jul 2004, 06:16:49
Amen, bro, amen.
Title: Re:Blowing stuff up!
Post by: shadow99 on 10 Jul 2004, 06:25:55
Excellent. So is there a list anywhere with all the different methods of using this code?

Eg "bomb"?
Title: Re:Blowing stuff up!
Post by: macguba on 10 Jul 2004, 10:10:14
Weapon and ammo list in the ed depot.
Title: Re:Blowing stuff up!
Post by: shadow99 on 10 Jul 2004, 10:27:58
Thanks.
Title: Re:Blowing stuff up!
Post by: bored_onion on 11 Jul 2004, 15:08:51
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!