Trace coming out of a bomb

Ask questions, discuss ideas, get answers
Machi
Posts: 14
Joined: Sat Dec 11, 2010 6:51 pm

Trace coming out of a bomb

Post by Machi »

Hi to everyone!

Well i have been looking at your forum for a few months now, found it interesting and decided to post my first topic. I have been playing with the objects.rfa for some time now, making a Mod to help instruct pilots on basic piloting skills like bombing and strafing. I have done the bomb make a trace of smoke, so i can see where it landed and how the trayectory was. The thing is the trace only works when i can see the actual bomb flying, like using chasecam when dropping it or quickly changing from nosecam to another cam where i can see it. if i keep in nosecam, when i drop the bomb and after it has impacted, the trace is not shown.

here is the code:

Code: Select all

rem *** e_PanzShootTrail ***
ObjectTemplate.create EffectBundle e_PanzShootTrail2
ObjectTemplate.saveInSeparateFile 1
rem -------------------------------------
ObjectTemplate.addTemplate Em_PanzShootTrail2
ObjectTemplate.addTemplate Em_PanzShootTrail3
rem ObjectTemplate.addTemplate Em_PanzShootTrail4
ObjectTemplate.timeToLive CRD_NONE/30/0/0
rem -------------------------------------

rem *** Em_PanzShootTrail***
ObjectTemplate.create Emitter Em_PanzShootTrail2
ObjectTemplate.template Fx_PanzShootTrail2
ObjectTemplate.looping 0
ObjectTemplate.startAtCreation 1
ObjectTemplate.addEmitterSpeed 0
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.startProbability 1
ObjectTemplate.lodDistance 900
ObjectTemplate.timeToLive CRD_NONE/10/0/0
ObjectTemplate.intensity CRD_NONE/50/0/0
ObjectTemplate.startRotation CRD_NONE/1/0/0
ObjectTemplate.relativePositionInDof CRD_NONE/-2.5/0/0
ObjectTemplate.relativePositionInUp CRD_NONE/0/0/0
ObjectTemplate.relativePositionInRight CRD_NONE/0/0/0
ObjectTemplate.CullRadiusScale 1


ObjectTemplate.create SpriteParticle Fx_PanzShootTrail2
ObjectTemplate.timeToLive CRD_NONE/120/0/0
ObjectTemplate.size CRD_NONE/0.4006/0/0
ObjectTemplate.lodDistance 900
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.drag CRD_NONE/3/0/0
rem ObjectTemplate.sizeOverTime 0/0.40006|5/1|100/10
ObjectTemplate.texture e_muzs2_I
ObjectTemplate.useMipMaps 1
ObjectTemplate.CullRadiusScale 1
ObjectTemplate.initRotation CRD_UNIFORM/0/180/1
ObjectTemplate.XYSizeRatio CRD_NONE/1/0/0
ObjectTemplate.destBlendMode BMInvSourceAlpha
ObjectTemplate.rotationSpeed CRD_UNIFORM/50/100/1
ObjectTemplate.colorRGBAOverTime 0/255/0/0/99|90/255/0/0/70|100/255/0/0/0

rem *** Em_PanzShootTrail***
ObjectTemplate.create Emitter Em_PanzShootTrail3
ObjectTemplate.template Puto
rem Fx_PanzShootTrail3
ObjectTemplate.looping 0
ObjectTemplate.addEmitterSpeed 0
ObjectTemplate.startAtCreation 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.startProbability 1
ObjectTemplate.lodDistance 900
ObjectTemplate.timeToLive CRD_NONE/0.1/0/0
ObjectTemplate.intensity CRD_NONE/1000/0/0
ObjectTemplate.positionalSpeedInDof CRD_EXPONENTIAL/2000/1000/0
ObjectTemplate.positionalSpeedInUp CRD_NONE/0/0/0
ObjectTemplate.positionalSpeedInRight CRD_NONE/0/0/0
ObjectTemplate.startRotation CRD_NONE/1/0/0
ObjectTemplate.CullRadiusScale 1

ObjectTemplate.create SpriteParticle Puto
rem Fx_PanzShootTrail3
ObjectTemplate.timeToLive CRD_UNIFORM/30/1/0
ObjectTemplate.size CRD_NONE/0.4006/0/0
ObjectTemplate.lodDistance 900
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.addEmitterSpeed 0
ObjectTemplate.drag CRD_NONE/50/0/0
ObjectTemplate.DragOverTime 0/0.5|1/1|2/1
rem ObjectTemplate.sizeOverTime 0/0.40006|5/1|100/10
ObjectTemplate.texture e_muzs2_I
ObjectTemplate.useMipMaps 1
ObjectTemplate.initRotation CRD_UNIFORM/0/180/1
ObjectTemplate.XYSizeRatio CRD_NONE/1/0/0
ObjectTemplate.destBlendMode BMInvSourceAlpha
ObjectTemplate.rotationSpeed CRD_UNIFORM/50/100/1
ObjectTemplate.colorRGBAOverTime 0/255/255/0/99|90/255/255/0/70|100/255/255/0/0
rem ObjectTemplate.colorRGBAOverTime 0/255/255/0/0|4/255/255/0/56|15/255/255/0/212|55/255/255/0/208|100/255/255/0/50
ObjectTemplate.CullRadiusScale 1
Any ideas?
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Trace coming out of a bomb

Post by fo0k »

I would guess at increasing the timeto live ObjectTemplate.timeToLive CRD_NONE/0.1/0/0 within the Em_PanzShootTrail but there are a couple of effects pro's here who will be able to help.

Additionally, when droppoing from very high or rockets etc shooting a long distance you can also find the actual projectile will vanish too at far range. This can be resolved by creating a custom bbox mesh for the projectile. Make it 50x bigger and then projectiles will be visible as far as the eye can see.

Welcome to the site!
Machi
Posts: 14
Joined: Sat Dec 11, 2010 6:51 pm

Re: Trace coming out of a bomb

Post by Machi »

fo0k wrote:I would guess at increasing the timeto live ObjectTemplate.timeToLive CRD_NONE/0.1/0/0 within the Em_PanzShootTrail but there are a couple of effects pro's here who will be able to help.
Welcome to the site!
Ahh yes i forgot to tell how the code works. the panzertrail3 is actually a straight line drawn to show the actual "direction of fire" at the instant you drop the bomb. The panzertrail2 is the actual trace of the bomb.

i´ll put an image showing both emitters:

Image
Image
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Trace coming out of a bomb

Post by fo0k »

ObjectTemplate.colorRGBAOverTime 0/255/0/0/99|90/255/0/0/70|100/255/0/0/0

Perhaps change that final 0 alpha value to 100.. (and the 70 in the middle too)
It may be that it it stil on screen but if alpha is zero then it will not be visible. Worth a shot..
Machi
Posts: 14
Joined: Sat Dec 11, 2010 6:51 pm

Re: Trace coming out of a bomb

Post by Machi »

fo0k wrote:ObjectTemplate.colorRGBAOverTime 0/255/0/0/99|90/255/0/0/70|100/255/0/0/0

Perhaps change that final 0 alpha value to 100.. (and the 70 in the middle too)
It may be that it it stil on screen but if alpha is zero then it will not be visible. Worth a shot..
I ll try it, but i think it has to do with the actual entity from which the smoke should come from (i dont know if that is the bomb or the emitter attached to the bomb) being out of the screen. Seems the only way to make it spawn smoke and leave its trace is to make it appear on screen.

Is there any page that shows and explains emitters and all the special effects on the engine? MDT is out, it had something explaining them...

I also wanted to ask if a weapon can shoot two different types of proyectiles at the same time, so i could spawn a bomb and another entity with the same characteristics but with no explosion nor damage falling with it.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Trace coming out of a bomb

Post by Swaffy »

ObjectTemplate.projectileTemplate NameOfProjectile
ObjectTemplate.projectile2Template NameOfProjectile2
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Machi
Posts: 14
Joined: Sat Dec 11, 2010 6:51 pm

Re: Trace coming out of a bomb

Post by Machi »

Swaffy wrote:ObjectTemplate.projectileTemplate NameOfProjectile
ObjectTemplate.projectile2Template NameOfProjectile2

Thanks a lot! ill try use this to solve the problem :)
User avatar
Dennis|8749236
Posts: 239
Joined: Sun Nov 29, 2009 6:02 am
Location: Earth
Contact:

Re: Trace coming out of a bomb

Post by Dennis|8749236 »

add another Firearm with same fire input on the firearm u want fire 2 kinds of projectile...
===========
and too see where the bomb hit... theres another way...
edit the explosion effect : add a smoke or some effect which can live longer into the explosion effect...
What is the meaning of Life?? (Don't think about it!)
Machi
Posts: 14
Joined: Sat Dec 11, 2010 6:51 pm

Re: Trace coming out of a bomb

Post by Machi »

8749236 wrote:add another Firearm with same fire input on the firearm u want fire 2 kinds of projectile...
===========
and too see where the bomb hit... theres another way...
edit the explosion effect : add a smoke or some effect which can live longer into the explosion effect...
I think i tried the first, but didnt worked.... i also tried the proyectile2 thing but no result...

the second one is a good idea, ill add it to the mod.
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Trace coming out of a bomb

Post by Apache Thunder »

A quick look at your code and I spotted that you didn't have looping turned on for either of the emitters

Code: Select all

ObjectTemplate.looping 0
Change it to this

Code: Select all

ObjectTemplate.looping 1
Also how is the effect tied to the projectile? Instead of addtemplating it to the projectile, try this instead:

Code: Select all

ObjectTemplate.startEffectTemplate (name of your effect)
This is how my trail effect is coded for tank projectiles in my BFH mod. It works in all view modes:

Code: Select all

ObjectTemplate.create EffectBundle e_TankShell
ObjectTemplate.saveInSeparateFile 1
rem -------------------------------------
ObjectTemplate.addTemplate Em_ATRocketFire
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/-1/0/0

ObjectTemplate.create Emitter Em_ATRocketFire
ObjectTemplate.template Fx_ATRocketFire
ObjectTemplate.looping 1
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.startProbability 1
ObjectTemplate.lodDistance 512
ObjectTemplate.delay CRD_NONE/0/0/0
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_NONE/30/0/0
ObjectTemplate.relativePositionInDof CRD_NONE/1/0/0
ObjectTemplate.relativePositionInUp CRD_NONE/0/0/0
ObjectTemplate.relativePositionInRight CRD_NONE/0/0/0
ObjectTemplate.positionalSpeedInDof CRD_NONE/-7/0/0
ObjectTemplate.positionalSpeedInUp CRD_NONE/0/0/0
ObjectTemplate.positionalSpeedInRight CRD_NONE/0/0/0
ObjectTemplate.rotationalSpeedInDof CRD_NONE/1/0/0
ObjectTemplate.rotationalSpeedInUp CRD_NONE/1/0/0
ObjectTemplate.rotationalSpeedInRight CRD_NONE/1/0/0
ObjectTemplate.startRotation CRD_NONE/1/0/0

ObjectTemplate.create SpriteParticle Fx_ATRocketFire
ObjectTemplate.cullRadiusScale 5
ObjectTemplate.texture e_fire4
ObjectTemplate.useMipMaps 1
rem ------------------------------------------
ObjectTemplate.timeToLive CRD_NONE/0.2/0.2/0
ObjectTemplate.size CRD_NONE/0.8/0/0
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.sizeOverTime 0/0.400006|21/0.789987|100/0.460005
ObjectTemplate.initRotation CRD_UNIFORM/1/180/1
ObjectTemplate.XYSizeRatio CRD_NONE/1/0/0
ObjectTemplate.srcBlendMode BMSourceAlpha
ObjectTemplate.destBlendMode BMOne
ObjectTemplate.rotationSpeed CRD_UNIFORM/200/300/1
ObjectTemplate.colorRGBAOverTime 0/255/255/255/0|4/255/255/221/56|15/255/255/128/212|55/255/195/67/208|100/255/128/0/204
Should make a good comparison to what your trying to do.
ImageImageImage
I have cameras in your head!
Post Reply