Sticking a CEG on a hit target

Sticking a CEG on a hit target

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Sticking a CEG on a hit target

Post 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?
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Sticking a CEG on a hit target

Post 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).
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Sticking a CEG on a hit target

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Sticking a CEG on a hit target

Post 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
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Sticking a CEG on a hit target

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

Re: Sticking a CEG on a hit target

Post 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:
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Re: Sticking a CEG on a hit target

Post 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.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Re: Sticking a CEG on a hit target

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Sticking a CEG on a hit target

Post 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?
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Re: Sticking a CEG on a hit target

Post 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. :)
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Sticking a CEG on a hit target

Post 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*
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Sticking a CEG on a hit target

Post by smoth »

shag her tired then go back to modding.
Post Reply

Return to “Game Development”