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

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Loopy53
1st Lieutenant
1st Lieutenant
Posts: 456
Joined: Thu Nov 01, 2012 2:27 am
Projects :: Earth Apocalypse
Games I'm Playing :: swbf2 bf3 cod
xbox live or psn: Dont have one
Location: On earth, I guess.

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

Post 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.
Last edited by Loopy53 on Thu Jun 27, 2013 10:18 pm, edited 3 times in total.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

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

Post 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.
kinetosimpetus
Imperial Systems Expert
Imperial Systems Expert
Posts: 2381
Joined: Wed Mar 25, 2009 4:15 pm
Projects :: A secret project
Games I'm Playing :: Warframe STO

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

Post 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.
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

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

Post 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.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

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

Post 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.
Loopy53
1st Lieutenant
1st Lieutenant
Posts: 456
Joined: Thu Nov 01, 2012 2:27 am
Projects :: Earth Apocalypse
Games I'm Playing :: swbf2 bf3 cod
xbox live or psn: Dont have one
Location: On earth, I guess.

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

Post 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"
Post Reply