Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 10:37 pm
All times are UTC + 0
Smoke coming out of the turret
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [9 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
MI6007198920162000
Soldier


Joined: 16 Jul 2016

PostPosted: Fri Jul 29, 2016 10:52 pm    Post subject:  Smoke coming out of the turret Reply with quote  Mark this post and the followings unread

how can i make the tank turrets smoke after firing?

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Sat Jul 30, 2016 12:38 am    Post subject: Reply with quote  Mark this post and the followings unread

Make the smoke part of the firing anim.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
silverwind
Cyborg Firebomber


Joined: 11 Jun 2016

PostPosted: Sat Jul 30, 2016 5:58 am    Post subject: Making Smoke come out of tank barrels on firing. Reply with quote  Mark this post and the followings unread

Use a customized smoke particle in the weapon section coupled with a spark particle declaration. The advantages are that the smoke can be made to be effected by wind (but not with the code below), you won't have to make separate animations for each muzzle flash animation, and it'll be easier to implement on many tanks.

Weapon Code
Spoiler (click here to read it):
Code:
[120mm]   ;or any other tank weapon
...
UseSparkParticles=yes   ;makes the particle only appear at the barrel tip
AttachedParticleSystem=MuzzleSmokeSys   ;a very low-duration smoke particle to avoid ROF issues


Lists
Spoiler (click here to read it):
Code:
[Particles]
...
##=MuzzleSmoke   ;replace ## with the last number in the list +1

[ParticleSystems]
...
##=MuzzleSmokeSys   ;replace ## with the last number in the list +1


Particle Code
Spoiler (click here to read it):
Code:
; a system for small amounts of smoke (damaged units)
[MuzzleSmokeSys]
HoldsWhat=MuzzleSmoke   ; the particle it holds
Spawns=yes
SpawnFrames=1   ;this is important to keep it short
SpawnRadius=5   ;low figures make sure the smoke appears to come from the muzzle
Slowdown=.0025
ParticleCap=3   ;an ideal value for a more smokey-appearance
SpawnCutoff=1.0   ;no need for multi-level transparency
SpawnTranslucencyCutoff=1.0   ;this too
BehavesLike=Smoke   ;this makes it move slightly upwards after being drawn

[MuzzleSmoke]
Image=SGRYSMK1   ;the actual image. change it if you want a different look
MaxEC=40
Translucency=50   ;remove the translucency if you experience slow downs.
Velocity=6.0   ;speed of the smoke particle
Deacc=.05
WindEffect=0   ;increase to increase the effect of wind on the smoke
BehavesLike=Smoke
DeleteOnStateLimit=no   ;so the particle can exist longer than the system
EndStateAI=20   ;tied to image frame count
StateAIAdvance=4


Note that the duration of the particle system effects the tank's ROF; it will not fire as long as a particle system is active. this is the reason I used a new particle system instead of the existing smoke particles.

Edit: thanks ApolloTD for confirming that Ares isn't needed for this.

Last edited by silverwind on Sat Jul 30, 2016 7:27 am; edited 1 time in total

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Sat Jul 30, 2016 6:29 am    Post subject: Reply with quote  Mark this post and the followings unread

No, ARES is not needed for that...even Tiberian Sun suffices.

However, I am sorry to say but if this was a tutorial it is a bad one on to particle systems, you just gave bunch of code for copy and paste practice but didn't really care to elaborate how the relevant codes can affect it so one can customize it like adjusting wind factor for one you mention.

Especially the oversight of UseSparkParticles=yes key, this will cause drawback of tank being unable to fire on the move thus tank must stop before it can fire, this may not be desirable outcome and should be mentioned.

Also if doing this for every tank in mod, should look into optimizing the particle codes further else frame rate drops very likely when using in mass.

Back to top
View user's profile Send private message
silverwind
Cyborg Firebomber


Joined: 11 Jun 2016

PostPosted: Sat Jul 30, 2016 7:20 am    Post subject: Reply with quote  Mark this post and the followings unread

I use this in all the tanks in my game, and I don't notice any frame drops, but of course, I can see it can be optimized further.

I hadn't actually known that UseSparkParticles=yes disables tanks firing while moving (I'll just confirm this in a while, because I don't recall this being such in any recent plays), and iirc, it is what makes the particle only appear at muzzle instead of following the bullet around like a trailer.

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Sat Jul 30, 2016 8:16 am    Post subject: Reply with quote  Mark this post and the followings unread

silverwind wrote:
I use this in all the tanks in my game, and I don't notice any frame drops, but of course, I can see it can be optimized further.

I hadn't actually known that UseSparkParticles=yes disables tanks firing while moving (I'll just confirm this in a while, because I don't recall this being such in any recent plays), and iirc, it is what makes the particle only appear at muzzle instead of following the bullet around like a trailer.


ARES optimized particles fairly recently to be fair but I see things that could be trimmed.

And no, UseSparkParticles key does not tell spawn location as such, it is merely activator key for AttachedParticleSystem just like UseFireParticles=yes etc are.
You define particle in weapon directly, it spawns at firing FLH thus barrel and won't follow...
You define at projectile, it follows projectile, you define at warhead, it is created at target and again follows nothing.

Back to top
View user's profile Send private message
silverwind
Cyborg Firebomber


Joined: 11 Jun 2016

PostPosted: Sat Jul 30, 2016 9:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Just checked this. You're right. UseFireParticles=yes instead of UseSparkParticles achieved a similar result, but for my code, that turnout out a bit more buggy -- enemy units not retaliating, occasional damageless shots, etc. that didn't happen with spark particles. Heck, units don't actually fire while moving in either case, which I just tested. Instead, they just point the turret nd wait till they at least momentarily stop moving.

I have not tested IsRailgun yet.

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Sat Jul 30, 2016 10:25 am    Post subject: Reply with quote  Mark this post and the followings unread

Right yeah, IsRailgun=yes works well if you want mobile fire, however do not use this key in an gattling gun system for every stage of weapon.

If using UseFireParticles key, you should add ApplyDamage=yes to weapon so ordinary damage is not disabled.

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sat Jul 30, 2016 11:11 am    Post subject: Reply with quote  Mark this post and the followings unread


_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [9 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1679s ][ Queries: 11 (0.0092s) ][ Debug on ]