Page 1 of 2

Can CEGTag be applied to debris?

Posted: 28 Nov 2007, 21:59
by REVENGE
Notice that when you have a severely killed unit that fragments, the fragments of the model emit particles. Can these be customized?

Posted: 28 Nov 2007, 22:04
by Argh
Not yet. Lurker said something about hard-coded FX issues, I put just about the whole "sm├â┬Ârg├â┬Ñsbord" of hard-coded stuff in front of him, hopefully he'll look into this and make it so that we can customize this... maybe (gasp) per unit. Not going to worry about any of it, until it actually happens.

Posted: 28 Nov 2007, 22:24
by Kloot
Would be trivial to add at first glance, I'll
try to cook something up in the next few
days.

Posted: 28 Nov 2007, 22:47
by KDR_11k
Would help if we could somehow define different CEGs to use on the pieces, don't just make that a global setting please.

Posted: 29 Nov 2007, 14:58
by REVENGE
I'd prefer the option to define both a global default and specifics per unit. This coupled with death animations would make blowing things up a whole lot prettier.

Posted: 29 Nov 2007, 16:29
by Zpock
Can't you just use emitsfx to make a weapon that's just there to look like debris?

Posted: 29 Nov 2007, 18:00
by KDR_11k
Yeah but that takes more work (especially if you want different parts of a unit to break off) and adds a weapon. On a second though, the ballistic property would be difficult.

Posted: 07 Dec 2007, 15:55
by Kloot
In case you missed the changelog entry, this can now be
done using the new unit FBI tags pieceTrailCEGTag and
pieceTrailCEGRange (where Tag is a string and Range is
an integer). If Tag is given, each piece of an exploding
unit randomly loads one of <pieceTrailCEGRange> CEG's
whose tag starts with the prefix <pieceTrailCEGTag> and
ends with a number in the range [0, pieceTrailCEGRange - 1]:

Code: Select all

// CEG definitions
[Fire0]
	...
[Fire1]
	...
[Fire2]
	...
[Fire3]
	...

Code: Select all

// unit FBI
pieceTrailCEGTag = "Fire";
pieceTrailCEGRange = 4;
If range is 1 (default) then you only need Fire0 defined,
otherwise all possible <pieceTrailCEGRange> tags are
expected to be valid.

Posted: 07 Dec 2007, 16:20
by KDR_11k
Is there a way to make a piece pick a certain CEG or have it not use one at all?

Posted: 07 Dec 2007, 16:38
by Kloot
Nope, both of those would require specific
per-piece data to be set from COB prior to
the projectile's creation. It's all-or-nothing
for now.

Posted: 07 Dec 2007, 16:41
by KDR_11k
Can't you at least make it depend on the FIRE bit?

Posted: 07 Dec 2007, 17:50
by Kloot
Sure, although I consider it something of
a hack to use that flag as an on/off switch
(might be better to define a new one, eg.
PP_CEGTrail).

Posted: 07 Dec 2007, 17:57
by KDR_11k
Just as well, as long as it means I won't get blood trails on dropped weapons.

Posted: 08 Dec 2007, 00:00
by jK
hmmm since r4951 it doesn't work for me anymore (r4939 worked). I add the CEGTRAIL to the cob :(

Btw I prefer the fbi-only system, cus changing the cob of >100 units is a pain :? (perhaps add a 3. fbi param to overwrite cob values?)

Posted: 08 Dec 2007, 01:21
by Kloot
Yeah, it seems the bitflags from COB do
not correspond to the actual flags used
by the projectiles. This is in CCobInstance:

Code: Select all

int newflags = 0;
if (flags & 2) newflags |= PP_Explode;
// if (flags & 4) newflags |= PP_Fall;
if ((flags & 8) && ph->particleSaturation<1) newflags |= PP_Smoke;
if ((flags & 16) && ph->particleSaturation<0.95f) newflags |= PP_Fire;
Whereas this is in CPieceProjectile:

Code: Select all

const int PP_Fall     = (1 << 0); // 1
const int PP_Smoke    = (1 << 1); // 2
const int PP_Fire     = (1 << 2); // 4
const int PP_Explode  = (1 << 3); // 8
const int PP_CEGTrail = (1 << 4); // 16
I'm tempted to equalize them, but that will
mean a lot of mods will have a lot of COB
scripts to edit. ;) In the meantime, r4955
should work again (PP_CEGTrail has been
renamed to PP_NoCEGTrail and is now 64
for backward-compatibility).

Posted: 08 Dec 2007, 09:32
by KDR_11k
Kloot wrote:I'm tempted to equalize them, but that will
mean a lot of mods will have a lot of COB
scripts to edit. ;)
Why not just equalize the Spring internal side instead of changing the interface?

Posted: 10 Dec 2007, 09:39
by jK
it still doesn't work for me. is it still bugged?
(I added the fbi values and reseted the cob - this way it worked in r4939)

Posted: 10 Dec 2007, 18:18
by Kloot
Ya, it was. r4978 has the fix.

Posted: 11 Dec 2007, 07:22
by jK
yup, works now again. BIG THX :3

Re: Can CEGTag be applied to debris?

Posted: 29 Apr 2011, 05:42
by Forboding Angel
Can someone luaize this so it makes more sense to me?
Kloot wrote:In case you missed the changelog entry, this can now be
done using the new unit FBI tags pieceTrailCEGTag and
pieceTrailCEGRange (where Tag is a string and Range is
an integer). If Tag is given, each piece of an exploding
unit randomly loads one of <pieceTrailCEGRange> CEG's
whose tag starts with the prefix <pieceTrailCEGTag> and
ends with a number in the range [0, pieceTrailCEGRange - 1]:

Code: Select all

// CEG definitions
[Fire0]
	...
[Fire1]
	...
[Fire2]
	...
[Fire3]
	...

Code: Select all

// unit FBI
pieceTrailCEGTag = "Fire";
pieceTrailCEGRange = 4;
If range is 1 (default) then you only need Fire0 defined,
otherwise all possible <pieceTrailCEGRange> tags are
expected to be valid.
Particularly the fire0, fire1, etc part.