Page 1 of 2

Grenade that Explodes Multiple Times

Posted: Mon Sep 23, 2013 4:11 pm
by Swaffy
I'd like to make a thrown grenade (projectile) that explodes 10 times before disappearing.

Does anyone have any ideas how I can pull this off? It's been on my mind but I can't figure out how to do it without throwing 10 separate grenades that explode at different times.

Re: Grenade that Explodes Multiple Times

Posted: Mon Sep 23, 2013 4:58 pm
by BotHunter
Create 10 different with different explode times, then fire them all using the method Apache thunder figured out:
http://bfmods.com/viewtopic.php?f=6&t=1664

Re: Grenade that Explodes Multiple Times

Posted: Wed Sep 25, 2013 4:20 am
by Swaffy
That's actually what I'm trying to refrain from doing. I was asking if I can get a projectile (one projectile, not 10 of them) to explode ten times, or perhaps an infinite amount of times withing a set time frame.

Re: Grenade that Explodes Multiple Times

Posted: Thu Sep 26, 2013 9:55 pm
by Apache Thunder
As far as I can tell, there is no way to have a projectile detonate or explode multiple times. Once it explodes, that's it. You could have it spawn a PCO copy of the grenade as part of the explosion effect, but unfortunately I have found this to cause CTDs in multiplayer testing. Seems PCOs can't be spawned via the damage system at all without trouble being caused in multiplayer. :(

Re: Grenade that Explodes Multiple Times

Posted: Thu Sep 26, 2013 11:36 pm
by Vilespring
I have an idea, but there would be trouble getting the first fire to work. There would be an... object... (a bundle, most likely) fired out of the fire arm, and the projectile has 10 fire arm bundles on it that have fire delays set to when they should detonate, and fire projectiles that instantly explode when spawned. The problem would be getting the autofire code to start immediately after spawn. :?

Re: Grenade that Explodes Multiple Times

Posted: Sat Sep 28, 2013 7:16 am
by Swaffy
Okay, thanks for the feedback, I'll be trying some interesting things. How about this: you know that German rifle grenade from SWoWWII? I was thinking about making a panzershreck that fires six of those like a shotgun and they explode using random timing. Of course I'll need to make a weaker damage table for them or just make the reload really slow.

Re: Grenade that Explodes Multiple Times

Posted: Sat Sep 28, 2013 7:01 pm
by Vilespring
in that case, make it a shotgun. ;)

Re: Grenade that Explodes Multiple Times

Posted: Sun Sep 29, 2013 5:18 pm
by Diamondback
Swaffy wrote:Okay, thanks for the feedback, I'll be trying some interesting things. How about this: you know that German rifle grenade from SWoWWII? I was thinking about making a panzershreck that fires six of those like a shotgun and they explode using random timing. Of course I'll need to make a weaker damage table for them or just make the reload really slow.
Nice thinking. Plus the Allied shotgun is in the same add-on as the Mauser K98 Rifle Grenade.

Re: Grenade that Explodes Multiple Times

Posted: Mon Sep 30, 2013 5:07 am
by Swaffy
Well, I already made some better working shotguns in my mod, I just have to use the same coding on the Panzershreck but with less FireArmsPosistions, then make a different texture (or die trying) with some extra weird stuff on the 3D model. Maybe make it look like some scrappy junk gun from Fallout New Vegas (since I've been wasting my life on that lately).

Re: Grenade that Explodes Multiple Times

Posted: Tue Oct 01, 2013 3:02 am
by Vilespring
I think I actually have a solution. :) I got it from lying on my bed thinking about how to make tanks when they die just have their turrets fly off. If you cannot see where I am going, I'll explain. :)

Code: Select all

ObjectTemplate.create Emitter Em_Bomb1
ObjectTemplate.template Em_bomb2
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.lodDistance 375
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_NONE/1/0/0
ObjectTemplate.relativePositionInDof CRD_NONE/0/0/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/0/0/0
ObjectTemplate.positionalSpeedInUp CRD_UNIFORM/0/0/0
ObjectTemplate.positionalSpeedInRight CRD_UNIFORM/0/0/0
ObjectTemplate.startRotation CRD_UNIFORM/0/0/0

ObjectTemplate.create bundle Bomb1
ObjectTemplate.addTemplate Em_Bomb1
(stuff that makes bombs go here)

ObjectTemplate.create Emitter Em_Bomb2
ObjectTemplate.template Em_bomb3
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.lodDistance 375
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_NONE/1/0/0
ObjectTemplate.relativePositionInDof CRD_NONE/0/0/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/0/0/0
ObjectTemplate.positionalSpeedInUp CRD_UNIFORM/0/0/0
ObjectTemplate.positionalSpeedInRight CRD_UNIFORM/0/0/0
ObjectTemplate.startRotation CRD_UNIFORM/0/0/0

ObjectTemplate.create bundle Bomb2
ObjectTemplate.addTemplate Em_Bomb1
(stuff that makes bombs go here)
............
and, make sure you count up the bomb number to 9 (the 1st is fired from the gun), because if it emits its self when it dies, you got a endless explosion! :lol:
that maybe useful for other things to.
I have not tested this, but if the newer bombs don't wanna make effects because they are dead, make the bombs PCOs taking critical damage continuously.

it might work!!!! :D