Announcement
Collapse
No announcement yet.
How to Spawn/Attach a ParticleSystem Explosion Effect That Loops Once
Collapse
X
-
evernewjoy repliedyou need a global var
Code:var ParticleSystemComponent burnemitter;
Code:burnemitter = WorldInfo.MyEmitterPool.SpawnEmitterMeshAttachment(BurnTemplate, Mesh, BurnSocket,true,);
Code:burnemitter.SetHidden(true); burnemitter.DeactivateSystem(); burnemitter = none;
Rama
Leave a comment:
-
Kelt'ar replied*** works!!! Soldier! Get your team ready to go inside while I finish off!!!
How do I destroy the effect after burn time?
Leave a comment:
-
Kelt'ar repliedok here goes:
It works as an instant hit weapon.
I added this bood to my damage type
Code:Var Bool bcausesflames
Code://HazerBurn var ParticleSystemComponent Burn; var ParticleSystem BurnTemplate; var vector SocketLocL; var rotator SocketRotL; var name BurnSocket; Var float HBurnTime; Function SetHazerBurn() { BurnTemplate=ParticleSystem'WP_Hazer.Effects.FireHitFX_PS'; WorldInfo.MyEmitterPool.SpawnEmitterMeshAttachment(BurnTemplate, Mesh, BurnSocket,true,); } Function OffHazerBurn() { Dont know how to turn this off yet } simulated function PlayTakeHitEffects() { local class<SLDamageType> SLDamage; local vector BloodMomentum; local UTEmit_HitEffect HitEffect; local ParticleSystem BloodTemplate; if (EffectIsRelevant(Location, false)) { SLDamage = class<SLDamageType>(LastTakeHitInfo.DamageType); if ( SLDamage != None ) { *snipped* if ( SLDamage.default.bCausesBlood && !class'UTGame'.Static.UseLowGore(WorldInfo) ) { *snipped* } else if ( SLDamage.default.bCausesFlames && !class'UTGame'.Static.UseLowGore(WorldInfo) ) { Worldinfo.Game.Broadcast(self, "!!!!!!! I'm on Fire !!!!!!!!"); SetHazerBurn(); SetTimer(HBurnTime, false, 'OffHazerBurn'); } if ( !Mesh.bNotUpdatingKinematicDueToDistance ) { // physics based takehit animations if (SLDamage != None) { *snipped* } SLDamage.static.SpawnHitEffect(self, LastTakeHitInfo.Damage, LastTakeHitInfo.Momentum, LastTakeHitInfo.HitBone, LastTakeHitInfo.HitLocation); } } } } } defaultproperties { *Snipped* SBurnTime = 20.5f }
In my NPC Pawn Class:
Code:defaultproperties { *Snipped* BurnTemplate(0)=ParticleSystem'WP_Hazer.Effects.FireHitFX_PS' BurnSocket=BurnSocket BurnTemplate(0)=ParticleSystem'WP_Hazer.Effects.FireHitFX_PS' Begin Object Class=ParticleSystemComponent Name=Burn SecondsBeforeInactive=10.0 End Object Burn=BurnTemplate Components.Add(Burn) HBurnTime = 20.5f }
Leave a comment:
-
evernewjoy repliedya you just need to explain how your flame thrower works, does it do distance checks or does it have projectiles?
Rama
Leave a comment:
-
Kelt'ar repliedIs there a way I can use this for my pawns when they get hit by a flame thrower?
Leave a comment:
-
evernewjoy repliedOriginally posted by p1ll View PostOMG thanks!))
Havnt tried it yet, but here is a vid of what I'm working on:
http://youtu.be/M_XLkBExyqs
thanks again, great work by the way!
Wow! your project is very colorful!
Looks awesome!
Great work!
Rama
Leave a comment:
-
CodeHei repliedThansk a lot!
For people like me, this is certainly not basic at all. I will try this tutorial in holiday, I will definitely need it.
Please continue to make tutorials when you have spare time
Leave a comment:
-
p1ll repliedOMG thanks!))
Havnt tried it yet, but here is a vid of what I'm working on:
http://youtu.be/M_XLkBExyqs
thanks again, great work by the way!
Leave a comment:
-
thommie repliedCode:var array<ParticleSystem> ProjExplosionTemplates; function createExplosion(vector HitLocation, vector HitNormal){ //local ParticleSystemComponent ProjExplosion; //create explosion //ProjExplosion = WorldInfo.MyEmitterPool.SpawnEmitter( ProjExplosionTemplates[Rand(ProjExplosionTemplates.Length - 1)], HitLocation, rotator(HitNormal), None); } defaultproperties { ProjExplosionTemplates(0)=..... ProjExplosionTemplates(1)=..... }
Leave a comment:
-
p1ll repliedhey question, how do I set things up so that every time an explosion is triggered it chooses a random effect from an array? so every explosion looks a little different.. The part in bold I want to pick a random effect from an array that I create...
defaultproperties
{
ProjFlightTemplate=ParticleSystem'WP_p1llGun.Effec ts.P_WP_p1llGun_Ball'
ProjExplosionTemplate=ParticleSystem'newglufo.FX.newexop1b'
ExplosionDecal=DecalMaterial'june2012.Material.new impact_1'
DecalWidth=400.0
DecalHeight=700.0
~p
Leave a comment:
-
evernewjoy repliedyay!
I'm happy to help!
you might also want to to check out my tutorial on making a shield with a mesh that fades in and then out over time.
i spent huge amount of time to figure out that color and alpha over time should only go from 0 to 1 even if the life span of particle is 17 seconds, the 0 to 1 in time gets mapped to the duration of the particles life.
Leave a comment:
-
SolaceEternal repliedYou literally just saved my team and I a crapload of trouble. Thank you for this!
Leave a comment:
-
How to Spawn/Attach a ParticleSystem Explosion Effect That Loops Once
Dear Community,
For some of you this is basic, but I could not find all this info in one place, so I'm making a compilation / tutorial
This tutorial tells you all the steps needed to:
1. set up your particle system to only loop once, and to loop guaranteed at the time of its spawning, and then disappear, as is needed for just about any explosion effect.
2. spawn this explosion/particle system in-game using unrealscript
3. attach particle effect to an actor, so that the actor does not pass through the effect as the actor moves, but instead the effect stays constantly in front so it is fully visible
~~~
Part 1 - Setting Up Your Particle System
Please look elsewhere for how to actually make a Particle System
For each of the components of your particle system,
you must set the Required and Spawn modules as follows:
Required Module
Emitter
Kill on Deactivate = true
kill on Completed = true
Duration
Emitter Duration = small number like 0.1
Emitter Loops = 1
~~~
Spawn Module
Spawn
Rate
constant = 0
Burst
Count = 1 (use green Plus sign to add a value)
Count Low = -1
time = 0 (runs at time 0, which is spawning time of emitter, which we spawn in-game with code)
~~~
Use the Lifetime module to control how long the single cycle of your particle effect lasts
~~~
Once you have your particle system, let's say you've called it: VictoryPackage.Particles.JoyParticle
Find out the unrealscript name of your particle system by right click and selecting "Copy full name to clipboard"
~~~
Part 2 - UnrealScript
Here is the unrealscript!
In whatever class you want to spawn your explosion effect / particle system:
I commented out the local variable because it is not used, but I wanted to show you how you could track the effect you created if you needed to modify it after it spawned.
Code:function createExplosion(vector HitLocation, vector HitNormal){ //local ParticleSystemComponent ProjExplosion; //create explosion //ProjExplosion = WorldInfo.MyEmitterPool.SpawnEmitter( ParticleSystem'VictoryPackage.Particles.JoyParticle', HitLocation, rotator(HitNormal), None); }
look at various UTProjectile classes including the link gun to see how you can pass in the HitNormal and HitLocation for events like HitWall.
If you just want to spawn an explosion at a specific location, use
Code:createExplosion(LocationForExplosion, rot(0,0,0));
What if you want to spawn the explosion in front of the object your projectile hit, you can use something like:
Code:HitLocation + HitNormal * 96
3. Attach to an actor
the final parameter of the spawning function allows you to attach the particlesystem to an actor
Code:WorldInfo.MyEmitterPool.SpawnEmitter( ParticleSystem'VictoryPackage.Particles.JoyParticle', HitLocation, rotator(HitNormal), YayanActor);
Required Module
use local space = true
(same module as where Kill on Completed is located)
If you want the particle effect to have the same orientation as the actor it is attached to:
useCode:YayanActor.Rotation
Code:rotator(HitNormal)
Code:HitLocation + Vector(YayanActor.Rotation) * 96;
Let me know if this helps!
♥
RamaTags: None
Leave a comment: