Can CEGTag be applied to debris?

Can CEGTag be applied to debris?

Share and discuss visual creations and creation practices like texturing, modelling and musing on the meaning of life.

Moderators: MR.D, Moderators

User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Can CEGTag be applied to debris?

Post by REVENGE »

Notice that when you have a severely killed unit that fragments, the fragments of the model emit particles. Can these be customized?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post 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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Would be trivial to add at first glance, I'll
try to cook something up in the next few
days.
Last edited by Kloot on 28 Nov 2007, 23:57, edited 1 time in total.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post 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.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Post 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.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Post by Zpock »

Can't you just use emitsfx to make a weapon that's just there to look like debris?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post 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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post 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.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Is there a way to make a piece pick a certain CEG or have it not use one at all?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post 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.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Can't you at least make it depend on the FIRE bit?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post 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).
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Just as well, as long as it means I won't get blood trails on dropped weapons.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post 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?)
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post 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).
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post 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?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post 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)
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

Ya, it was. r4978 has the fix.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

yup, works now again. BIG THX :3
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Can CEGTag be applied to debris?

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

Return to “Art & Modelling”