Page 1 of 1

How to add a custom effect to a chunk [Solved]

Posted: Fri Jun 21, 2013 3:16 pm
by Loopy53
Basically, when you destroy a mesh, a few on fire chunks shoot out. I want a huge smoke cloud to show up instead. I have the smoke cloud made, I just don't know how to implement it. If you need more information or screenshots let me know.

Re: How to add a custom effect to a destroyed mesh?

Posted: Fri Jun 21, 2013 4:24 pm
by Noobasaurus
You could have it so when the object gets down to 0% health it makes a smoke effect. Look in the vehicle odfs for what I'm talking about. You'll have to make the smoke effect really crowded though depending on what you're going for.

EDIT:

Code: Select all

DamageStartPercent = "0.001"
DamageStopPercent = "0"
DamageEffect = "youreffecthere"
DamageEffectScale = "1"
DamageInheritVelocity = "0.0"
DamageAttachPoint = "hp_damage1"
Try that. You'll need a point to attach the effect to though.

Re: How to add a custom effect to a destroyed mesh?

Posted: Fri Jun 21, 2013 5:10 pm
by kinetosimpetus
I think that type of damage effect will disappear when the building actually dies, although not a bad idea as the building takes damage to have a little smoke, then a little flame and a little more smoke and when nearly dead, lots of fire and smoke, like most of the vehicles. But I think once dead it'll all go away, like when a fighter is spinning out after being killed, I think the smoke and fire stop.

The few fireballs that it has right now are probably chunk trails in the buildings explosion odf.

Re: How to add a custom effect to a destroyed mesh?

Posted: Fri Jun 21, 2013 6:15 pm
by Noobasaurus
You could also make a lua function so when the object dies another invisible object is spawned that has the effect attached to it.

Re: How to add a custom effect to a destroyed mesh?

Posted: Fri Jun 21, 2013 6:16 pm
by Marth8880
An infinite smoke plume is really going to rack up your global particle count. I'd suggest having the "main" chunk not really go anywhere upon destruction (set a low omega and speed factor), give it a decently long lifetime (30-60), and attach your smoke effect to it - the geometry would probably be the largest and central part of your original mesh.

Re: How to add a custom effect to a chunk (please read botto

Posted: Thu Jun 27, 2013 6:45 pm
by Loopy53
I was thinking of a smoke plume that last 5-10 seconds after you destroy the mesh. I will try what Noobasaurus suggested.

EDIT: Didn't work. Marth and I shall discuss this via x-fire.

EDIT2: I got the effect working as its supposed to. When I destroy the mesh, the effect appears. My problem is its in the wrong position, and it lasts for too long. Here is the ODF im working with http://sharetext.org/2hPh

EDIT3: Thanks marth, together we got it working!! :D I will post some more proof of concept on my 3D Art WIP page! Thanks again! Here is the most recent ODF.
Hidden/Spoiler:
[GameObjectClass]

ClassLabel = "armedbuilding"
GeometryName = "tstwall.msh"


[Properties]

GeometryName = "tstwall"
DestroyedGeometryName = "tstwalldest"
AINoRepair = 1
HealthType = "building"
HideHealthBar = 1
MaxHealth = 1000.9

CHUNKSECTION = "CHUNK1"
ChunkGeometryName = "tstwall_chunk1"
ChunkNodeName = "hp_chunk1"
ChunkTerrainCollisions = "0"
ChunkTerrainEffect = "eap_bldg_exp"
ChunkTrailEffect = "eap_bldg_exp"
ChunkTrailNodeName = "hp_chunk1"
ChunkPhysics = "STATIC"
ChunkLifetime = "3.0"
ChunkOmega = "0.0 0.0 0.0"
ChunkSpeed = "0.0"