I've got a thing for battlefield smoke, so after a long while of tinkering around with particle effects in my mod, I've come up with something that performs well without being a single puff of ugly grainy smoke. my computer isn't great, yet still runs this fairly well. I did some tests involving 400 bots all firing, and it didn't cause much lag.
Nothing special, but hopefully this will save time for people who aren't prepared to spend hours trial-ing and error-ing with the module system.
It's comprised of three particle effects in succession, and allow smoke to drift away in a single direction, without using the unpredictable "turbulence" effect.
1. Muzzle flare.
2. Normal muzzle smoke: Smoke fired from in the direction of fire. Lasts 5 seconds.
3. Drifting smoke: Smoke that drifts slowly in the same global direction to simulate wind. Lasts 20 seconds.
Add these lines to module_particle_systems.py
And add this trigger to each firearm. For pistols, simply omit psys_pistol_smoke_large, which is the drifting smoke element.
Finally, install this texture.
https://drive.google.com/file/d/0By7KvxJ31VhtMVh2VW9xam13TE0/edit?usp=sharing
Screenshots don't do it much justice, but here you go anyway:
Nothing special, but hopefully this will save time for people who aren't prepared to spend hours trial-ing and error-ing with the module system.
It's comprised of three particle effects in succession, and allow smoke to drift away in a single direction, without using the unpredictable "turbulence" effect.
1. Muzzle flare.
2. Normal muzzle smoke: Smoke fired from in the direction of fire. Lasts 5 seconds.
3. Drifting smoke: Smoke that drifts slowly in the same global direction to simulate wind. Lasts 20 seconds.
Add these lines to module_particle_systems.py
("pistol_flare", psf_billboard_3d, "prt_mesh_fire_1",
30, 0.2, 0.2, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0, 1.0), (1, 0), #alpha keys
(0, 1.0), (0.4, 0.7), #red keys
(0, 0.5),(0.4, 0.1), #green keys
(0, 0.3), (0.4, 0.2), #blue keys
(0, 0.4), (1, 1.0), #scale keys
(0.04, 0.04, 0.01), #emit box size
(0, 3, 0), #emit velocity
0.2, #emit dir randomness
200, #rotation speed
0.2 #rotation damping
),
("pistol_smoke", psf_billboard_3d, "prt_mesh_dust_1",
5, 4, 0.6, 0, 80.0, 2, #(was 30. 1.5) #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
#for testing purposes of the below, life has been changed to 5.
(0.0, 0.3), (1, 0), #alpha keys
(0.0, 0.62), (1, 0.3), #red keys
(0.0, 0.63),(1, 0.31), #green keys
(0.0, 0.63), (1, 0.4), #blue keys
(0, 2.5), (1, 20.0), #scale keys
(0.1, 0.1, 0.1), #emit box size
(0, 1.5, 0), #emit velocity
0.23 #emit dir randomness
),
("pistol_smoke_large", psf_billboard_3d|psf_global_emit_dir, "prt_mesh_dust_1",
1, 20, 0, -0.01, 80.0, 1, #(was 30. 1.5) #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.0, 0.3), (1, 0), #alpha keys
(0.0, 0.3), (1, 0.3), #red keys
(0.0, 0.31),(1, 0.31), #green keys
(0.0, 0.4), (1, 0.4), #blue keys
(0, 2.5), (0.3, 10.0), #scale keys
(1, 1, 1), #emit box size
(0.5, 1.5, 0), #emit velocity
0.1 #emit dir randomness
),
30, 0.2, 0.2, 0.0, 10.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0, 1.0), (1, 0), #alpha keys
(0, 1.0), (0.4, 0.7), #red keys
(0, 0.5),(0.4, 0.1), #green keys
(0, 0.3), (0.4, 0.2), #blue keys
(0, 0.4), (1, 1.0), #scale keys
(0.04, 0.04, 0.01), #emit box size
(0, 3, 0), #emit velocity
0.2, #emit dir randomness
200, #rotation speed
0.2 #rotation damping
),
("pistol_smoke", psf_billboard_3d, "prt_mesh_dust_1",
5, 4, 0.6, 0, 80.0, 2, #(was 30. 1.5) #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
#for testing purposes of the below, life has been changed to 5.
(0.0, 0.3), (1, 0), #alpha keys
(0.0, 0.62), (1, 0.3), #red keys
(0.0, 0.63),(1, 0.31), #green keys
(0.0, 0.63), (1, 0.4), #blue keys
(0, 2.5), (1, 20.0), #scale keys
(0.1, 0.1, 0.1), #emit box size
(0, 1.5, 0), #emit velocity
0.23 #emit dir randomness
),
("pistol_smoke_large", psf_billboard_3d|psf_global_emit_dir, "prt_mesh_dust_1",
1, 20, 0, -0.01, 80.0, 1, #(was 30. 1.5) #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.0, 0.3), (1, 0), #alpha keys
(0.0, 0.3), (1, 0.3), #red keys
(0.0, 0.31),(1, 0.31), #green keys
(0.0, 0.4), (1, 0.4), #blue keys
(0, 2.5), (0.3, 10.0), #scale keys
(1, 1, 1), #emit box size
(0.5, 1.5, 0), #emit velocity
0.1 #emit dir randomness
),
And add this trigger to each firearm. For pistols, simply omit psys_pistol_smoke_large, which is the drifting smoke element.
Finally, install this texture.
https://drive.google.com/file/d/0By7KvxJ31VhtMVh2VW9xam13TE0/edit?usp=sharing
[(ti_on_weapon_attack,[(position_move_x,pos1,0),(position_move_y,pos1,112),(particle_system_burst,"psys_pistol_smoke",pos1,15),(particle_system_burst,"psys_pistol_flare",pos1,15),(particle_system_burst,"psys_pistol_smoke_large",pos1,5)])]
Screenshots don't do it much justice, but here you go anyway: