Page 1 of 1

Sticking a CEG on a hit target

Posted: 02 Jun 2008, 07:04
by MadRat
Is there any non-LUA way to get a CEG to be emitted from a target after its been hit? I'd like something to show its burning for some variable duration. It works fine for immobile structures, but how do I do it to moving units? It would be nice in a tank battle for the weapons to basically spawn a lengthy fire at their point of impact, a fire that would slowly subside and turn to a smoke emission until it reaches a certain point when it just ceases.

The only two ways I've been thinking it can be done is with LUA (make it set a timer for a unit to emit the CEG when it's been hit) or to follow a similar path using the cob. Unfortunately to make it emit at the point of impact seems monumental in itself. Is there some ulterior way/setting I'm missing where you can tag the CEG on the targeted unit?

Re: Sticking a CEG on a hit target

Posted: 02 Jun 2008, 07:13
by Evil4Zerggin
Try the COB callin HitByWeaponID(). It's called whenever the unit is hit by a weapon. If you want it to be weapon-specific rather than unit-specific, you'll need to use the weapon ID (not sure how to set a weapon's ID, but HitByWeaponID() is called with the weaponID as the second argument).

Re: Sticking a CEG on a hit target

Posted: 02 Jun 2008, 07:21
by lurker
Pretty sure it goes in the tdf. And hitbyweaponID returns a percentage damage for the shot to do, so don't forget a return 100 at the end. Look at the chicken scripts in CA. I'll be fixing them soon to detect the queen's attack and not bleed from it.

Re: Sticking a CEG on a hit target

Posted: 02 Jun 2008, 07:31
by smoth
MadRat wrote:Is there any non-LUA way to get a CEG to be emitted from a target after its been hit? I'd like something to show its burning for some variable duration.
HUR HUR

Re: Sticking a CEG on a hit target

Posted: 02 Jun 2008, 07:39
by lurker
I would have been annoyed by this teasing, but I realized something. It's just going to come back and bite you with a bunch of people asking for status, to help take over, etc.

Re: Sticking a CEG on a hit target

Posted: 02 Jun 2008, 08:14
by REVENGE
smoth wrote:
MadRat wrote:Is there any non-LUA way to get a CEG to be emitted from a target after its been hit? I'd like something to show its burning for some variable duration.
HUR HUR
FUCK YOU!!!!!!








:cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:

Re: Sticking a CEG on a hit target

Posted: 02 Jun 2008, 10:10
by Saktoth
smoth wrote:
MadRat wrote:Is there any non-LUA way to get a CEG to be emitted from a target after its been hit? I'd like something to show its burning for some variable duration.
HUR HUR
Post again when you've released it.

Re: Sticking a CEG on a hit target

Posted: 02 Jun 2008, 13:36
by MadRat
Yeah, smoth, you got the idea. Ever see that old arcade game Tron?

I want some penetrator/anti-tank weapons to cause burning like in that game. Burns 3-5 seconds, then smokes for about the same amount of time in a heavy black, then gradually turns gray and fades out of the smoke until its just a fading wisp. Might be too graphics intensive for my hardware, but it should look nice.

Re: Sticking a CEG on a hit target

Posted: 02 Jun 2008, 14:50
by smoth
it is a doable thing and we have burning in TD. However, it can get pretty expensive pretty quick :P. I have given the code to quant and he made some cool LUA Particle System fire but I have not tried it yet. what do you need it for? or were you just curious if it could be done?

Re: Sticking a CEG on a hit target

Posted: 03 Jun 2008, 01:47
by MadRat
More curious than anything.

When I do a project I tend to gather pieces over time then compile them together in a few long weekends. I'm not one to just sit down and just plug away every day until its done because the wife suffers. It lets the creativity flow a little bit in between developing each of the intertwined ideas. And it keeps me off the wife's shit list at the same time. :)

Re: Sticking a CEG on a hit target

Posted: 03 Jun 2008, 11:17
by Pressure Line
MadRat wrote:And it keeps me off the wife's shit list at the same time. :)
Always a good thing *thumbs up*

Re: Sticking a CEG on a hit target

Posted: 03 Jun 2008, 16:21
by smoth
shag her tired then go back to modding.