View unanswered posts | View active topics It is currently Fri Oct 04, 2024 3:43 am



Reply to topic  [ 6 posts ] 
 help with spread of shrapnal in a cannon like weapon 
Author Message

Joined: Sat Feb 21, 2009 7:11 pm
Posts: 27
Reply with quote
Post help with spread of shrapnal in a cannon like weapon
hi
what i'm trying to do is make a "cannon ball" that explodes into a concentrated burst of particles (with a spread of a bout 15 degrees or less) forward in relation to the "cannon ball" i tried using s the spread variable of a MOSRotating by changing it to 0.1 but whenever it gibs the explosion is always going right, it looks like cc takes the spread as being in relation to the scene and not the round i would appreciate a solution, thanks

heres th code of the MOSRotating

Code:
AddEffect = MOSRotating
   PresetName = Fraglet
   Mass = 0.1
   OrientToVel = 1
   RestThreshold = -500
   HitsMOs = 1
   GetsHitByMOs = 0
   SpriteFile = ContentFile
      FilePath = Base.rte/Devices/Cannons/CannonRound.bmp
   ScriptPath = phalax.rte/airbirst.lua
   FrameCount = 1
   SpriteOffset = Vector
      X = -2
      Y = -2
   EntryWound = AEmitter
      CopyOf = Dent Metal
   ExitWound = AEmitter
      CopyOf = Dent Metal
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff
      Resolution = 2
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff
      Resolution = 4
      Depth = 1
   DeepCheck = 1
   GibImpulseLimit = 1
   GibSound = Sound
      AddSample = ContentFile
         FilePath = Base.rte/Sounds/Explode2.wav
//   AddGib = Gib
//      GibParticle = MOPixel
//         CopyOf = Flash Particle Yellow Big
//      Count = 1
//      Spread = 2.25
//      MaxVelocity = 0.1
//      MinVelocity = 0
//      InheritsVel = 0
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Grenade Fragment Gray
         LifeTime = 100
      Count = 10
      Spread = 0.1
//      MaxVelocity = 50
//      MinVelocity = 75
      InheritsVel = 1
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Grenade Fragment Yellow
      Count = 15
      Spread = 0.1
//      MaxVelocity = 50
//      MinVelocity = 75
      InheritsVel = 1
//   AddGib = Gib
//      GibParticle = MOSParticle
//         CopyOf = Side Thruster Blast Ball 1
//      Count = 10
//      Spread = 2.25
//      MaxVelocity = 20
//      MinVelocity = 0
//      InheritsVel = 0
//   AddGib = Gib
//      GibParticle = MOPixel
//         CopyOf = Air Blast
//      Count = 15
//      Spread = 2.25
//      MaxVelocity = 30
//      MinVelocity = 0
//      InheritsVel = 0


the air burst lua should make it explode befor it hits the ground or wall or whatever and detonate it such that the shapnal goes into the target instead of being emitted away from it because of the round rebounding but i cant see if it works untill i sort this problem out.


Mon Dec 28, 2009 7:21 pm
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: help with spread of shrapnal in a cannon like weapon
One possible solution is using inherit velocity like the Base.rte flak cannon. For a more precise method create a separate shrapnel emitter and try adding something like this to your script:

Code:
function Create(self)
   self.lastRot = self.RotAngle   -- don't bounce
end

function Destroy(self)
   local Blast = CreateAEmitter("HEAT Blast", "ModName.rte")
   Blast.Pos = self.Pos
   Blast.RotAngle = self.lastRot
   MovableMan:AddParticle(Blast)
end

function Update(self)
   self.lastRot = self.RotAngle
end


Mon Dec 28, 2009 10:21 pm
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: help with spread of shrapnal in a cannon like weapon
With significantly arced trajectories, that script might be a little weird. You might want to update lastRot every 100 ms or something like that instead.

Just a suggestion, make the explosion partially radial too. Sure, shaped charges, directed blast, etc, but it will look better and more believable if there's some explosion going backward, even if the main focus of the effect is directed. This can be added to the blast emitter just by making emissions with more spread and less velocity.


Tue Dec 29, 2009 3:58 am
Profile

Joined: Sat Feb 21, 2009 7:11 pm
Posts: 27
Reply with quote
Post Re: help with spread of shrapnal in a cannon like weapon
so why is spread tied to the scene instead of the round that the particles come from then?


Thu Dec 31, 2009 12:52 pm
Profile
User avatar

Joined: Fri Feb 16, 2007 8:43 pm
Posts: 1695
Location: AH SHIT FUCK AUGH
Reply with quote
Post Re: help with spread of shrapnal in a cannon like weapon
What you should do is to make the shrapnel inherit the projectiles velocity, have them gib in a spread of 3.14, and then give them a somewhat low maximum velocity, like 10-20 or so, depending on the speed of your projectile, like so:
Code:
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Grenade Fragment Gray
         LifeTime = 100
      Count = 10
      Spread = 3.14
      MaxVelocity = 15
      MinVelocity = 0
      InheritsVel = 1

Give it a shot. To make the spread wider/narrower, increase/decrease MaxVelocity. This is because of the fact that an object, that detonates in the air, doesn't have its gibs inherit the objects angle, but rather is fixed at 0, meaning horizontally to the right. This is solely due to the game engine, so there's not much we can do about that one problem. There are numerous workarounds, however.


Thu Dec 31, 2009 2:24 pm
Profile WWW
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: help with spread of shrapnal in a cannon like weapon
But then, if the initial projectile hits something, the velocity inherited is after the collision. The problem with that is made obvious when some vanilla explosives are used on the side of a rocket. The explosion bounces off. This can be counteracted with tweaked projectile material properties, but not entirely undone.

If it's a cluster bomb or something like that, gibs are probably the way to go, but if you want a directional explosion like a shaped charge, using an emitter as described will give more consistent results.


Mon Jan 04, 2010 3:50 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.035s | 14 Queries | GZIP : Off ]