Grenade that Explodes Multiple Times

Ask questions, discuss ideas, get answers
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Grenade that Explodes Multiple Times

Post 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.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
BotHunter
Posts: 480
Joined: Thu Jan 10, 2013 11:22 pm
Contact:

Re: Grenade that Explodes Multiple Times

Post 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
Walk quietly and carry a sniper rifle
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Grenade that Explodes Multiple Times

Post 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.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Grenade that Explodes Multiple Times

Post 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. :(
ImageImageImage
I have cameras in your head!
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Grenade that Explodes Multiple Times

Post 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. :?
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Grenade that Explodes Multiple Times

Post 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.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Grenade that Explodes Multiple Times

Post by Vilespring »

in that case, make it a shotgun. ;)
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
Diamondback
Posts: 617
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: Grenade that Explodes Multiple Times

Post 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.
See my Strasbourg map project here.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Grenade that Explodes Multiple Times

Post 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).
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Grenade that Explodes Multiple Times

Post 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
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
Post Reply