Home   Help Search Login Register  

Author Topic: Gunsmoke  (Read 1572 times)

0 Members and 1 Guest are viewing this topic.

Pickett

  • Guest
Gunsmoke
« on: 04 May 2004, 18:23:19 »
Hi to everybody.
I'm working on a muzzle loaded rifle for the "Civil War" Mod.
To make it more realistic i'd like to have a smoke cloud right at the muzzle,
like a tank or fieldgun for example.
(Not the normal flash that's defined in the P3D)
Can anybody give me a hint how to do that ?

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Gunsmoke
« Reply #1 on: 05 May 2004, 02:59:44 »
Use the drop command.  There is a tutorial in the editors depot on how to use the drop command.  You can also download the drop_dialog demo which lets you change the drop parameters and watch the effect.  Once you get the effect you want you can cut and past the drop parameters dispalyed at the bottom of the dialog screen (just drag the mouse cursor over the text and do ctrl-C to copy).

Its a great tool.  Ive been using it to get good smoke/flame effect for the Tomahawk Cruise Missile addon Wizzywig and I have been working on.  What I did was I modified the demo so instead of a stationary object defining the spot where smoke/flame occurs I substituted a flying Tomahawk missile.  You could do the same thing, just substitute a unit that will fire the weapon in question.  You will have to make sure the unit is holding the weapon and aiming it as it will be when fired or esle you will not get accurate x,y,z offset values.  Also you will have to do some trig as the x,y,z offset values will change as the unit faces different directions.

Grendel

  • Guest
Re:Gunsmoke
« Reply #2 on: 05 May 2004, 22:32:05 »
Quote
Also you will have to do some trig as the x,y,z offset values will change as the unit faces different directions

well, not really...as long as you use the firing unit as the reference for the particle (by placing the unit name at the very end of the drop array), the drop effects are created at a point relative to the object, not the standard map x,y,z.  So if you set it up to appear at [0,1,1.5] it would always appear one meter in front of the unit, 1.5 meters above the ground, regardless of orientation.  But (and a big one at that), this way it would only work for the hieght you set, so if the unit went prone, the smoke would still appear at 1.5 meters...

There is a way to place the drop effects at the muzzle by defining some line in the addon's config.cpp file.  I don't know how myself, but perhaps someone with experience in cpp editing could help...(I could use this info as well)

It would look a lot better, and take a lot less scripting to do.

-Grendel

Tactician

  • Guest
Re:Gunsmoke
« Reply #3 on: 06 May 2004, 00:35:00 »
You can grab the position of the bullet as soon as it's fired and create the drop-smoke there, giving it velocity based on the velocity of the bullet..

Grendel

  • Guest
Re:Gunsmoke
« Reply #4 on: 06 May 2004, 02:27:16 »
I thought of that too...Only problem is that the distance the nearestobject command picks up the bullet can vary depending on processor speed/cycle usage.  I have a pretty fast Alienware Rig, and it still picks up the bullet a few meters away from the muzzle.  If this distance was fairly consistant, you could theorticaly have the drop particles appear behind where the bullet is picked up, but then you would still have a problem:  how would you figure out the z angle that the rifle was pointing at (up/down) so the smoke wouldn't just billow out parallel to the ground?  I guess you could get the bullet's z coordinates at two locations and use trig to calculate the angle, but wouldnt it be easier to define it in the config as a muzzle blast effect? Anyone...?

-Grendel


Tactician

  • Guest
Re:Gunsmoke
« Reply #5 on: 06 May 2004, 04:12:26 »
Use a function and it will work 100% of the time.  Scripts aren't fast enough.

DBR_ONIX

  • Guest
Re:Gunsmoke
« Reply #6 on: 18 May 2004, 17:58:05 »
Hmmm
If someone finds a way to do this
And someone makes a drop command thing to get a muzzleflash type explosion, make it at the muzzle, and GET RID OF THE 2D MUZZLEFLASHES :D

For direction of the gun places.. Surely get the velocity/position of the bullet, and again a second (ish) later, and get the angle from that :)
- Ben