Data Realms Fan Forums
http://45.55.195.193/

How do I make a missile explode in mid-air?
http://45.55.195.193/viewtopic.php?f=1&t=21346
Page 1 of 3

Author:  Asklar [ Mon Jan 31, 2011 6:54 am ]
Post subject:  How do I make a missile explode in mid-air?

I am creating a Flare gun, and I don't know much about AEmiters and such, so I created a flare gun using as a template the coalition's rocket launcher.

Until now it works perfect, the only thing I need to do is making the flare gib in mid-air.

Thanks.

Author:  ludsoe [ Mon Jan 31, 2011 7:08 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

Asklar wrote:
I am creating a Flare gun, and I don't know much about AEmiters and such, so I created a flare gun using as a template the coalition's rocket launcher.

Until now it works perfect, the only thing I need to do is making the flare gib in mid-air.

Thanks.


My guess is using lua with a create(self) and a wait(5) then gib(self)
Although im not sure the wait() is even a CC lua thing. :oops:

Here it is in code format
Code:
Create(self)
       Wait(5)
       Gib(self)
end


Im not much of a good scripter.

Author:  Asklar [ Mon Jan 31, 2011 7:12 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

So the only way to do it is via lua?

Author:  ludsoe [ Mon Jan 31, 2011 7:13 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

Asklar wrote:
So the only way to do it is via lua?

That I know of. Ask whitty he does a bunch of ini stuff, if luas to hard.

Author:  dragonxp [ Mon Jan 31, 2011 7:18 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

You could do it by Lua or use a TDExplosive which has the variable TriggerDelay and just attach an AEmitter on that for the rocket which isn't really very convenient or anything.

Author:  CaveCricket48 [ Mon Jan 31, 2011 7:24 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

Several methods of doing this.

1. Have the gun fire a TDExplosive with an attached emitter. The TDExplosive can be invisible and the emitter create whatever effects you need.

2. Have an emitter only. Use StartTimeMS to time the emission of a particle that will cause the emitter to gib itself. Make sure PushesEmitter is 1, and the suicide particle has high mass and the emitter has low GibImpulse Limit.

3. Lua.
Code:
function Create(self)
       self.explodeTimer = Timer();
end
function Update(self)
       if self.explodeTimer:IsPastSimMS(5000) then
              self:GibThis();
       end
end

Author:  Asklar [ Mon Jan 31, 2011 7:28 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

That means that I should use as a template a grenade launcher rather than a rocket launcher?

Author:  dragonxp [ Mon Jan 31, 2011 7:29 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

Asklar wrote:
That means that I should use as a template a grenade launcher rather than a rocket launcher?

Not really, since you've already got everything ready, i recommend you use CC48's script.

Author:  CaveCricket48 [ Mon Jan 31, 2011 7:30 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

Asklar wrote:
That means that I should use as a template a grenade launcher rather than a rocket launcher?

You could, yes.

dragonxp wrote:
Not really, since you've already got everything ready, i recommend you use CC48's script.

Doing things on your own gives you more experience.

Author:  dragonxp [ Mon Jan 31, 2011 7:32 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

CaveCricket48 wrote:
dragonxp wrote:
Not really, since you've already got everything ready, i recommend you use CC48's script.

Doing things on your own gives you more experience.


The truth.
However, i wouldn't like to undo work either.

Author:  Asklar [ Mon Jan 31, 2011 7:33 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

I know what I'll do! I'll change only the AddAmmo = AEmitter to an AddAmmo = TDExplosive.
Later I'll use the flare as a hand-usable flare.

After I finish this, I just need to learn enough lua to make this flares into spot-markers-for-artillery-strikes.

Edit: Question. How do I attach an AEmitter into the TDExplosive?

Author:  411570N3 [ Mon Jan 31, 2011 7:36 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

They are barely different. Either is fine.

Author:  CaveCricket48 [ Mon Jan 31, 2011 7:38 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

Asklar:
Code:
   AddEmitter = AEmitter
      CopyOf = <Emmitter PresetName>

Author:  Asklar [ Mon Jan 31, 2011 7:42 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

CaveCricket48 wrote:
Asklar:
Code:
   AddEmitter = AEmitter
      CopyOf = <Emmitter PresetName>


That answer made me feel like a noob.
Thanks!

Author:  Asklar [ Mon Jan 31, 2011 8:03 am ]
Post subject:  Re: How do I make a missile explode in mid-air?

Hey, I got a doubt.
If I want to make a gib that creates the effect of the lit flare, how would I create that gib?
It would go like:
AddGib = Gib
GibParticle = AEmitter
PresetName = FlareGib
Mass = 0.5
HitsMOs = 0
GetsHitByMOs = 0
SpriteFile = ContentFile
ContentFile = Bla/Bla/Bla.bmp
AddEmission = Emission
EmitedParticle = MOPixel
PresetName = Light Thingy
Mass = 0.01
HitsMOs = 0
GetsHitByMOs = 0
ScreenEffect = ContentFile
FilePath = BLA.rte/Devices/YellowSmall.bmp
Color = Color
R = 255
G = 0
B = 255
Atom = Atom
Material = Material
CopyOf = Air
TrailColor = Color
R = 255
G = 0
B = 255
TrailLength = 3
ParticlesPerMinute = 180
BurstSize = 1
Spread = 3
MaxVelocity = 5
MinVelocity = 1
PushesEmitter = 0

Is this ok? What else does it need?

Page 1 of 3 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/