Flare effect using emit-sfx - Page 3

Flare effect using emit-sfx

Requests for features in the spring code.

Moderator: Moderators

User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Just scriptor being gay, it's working now. Thanks
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

W00tzies

Image
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Post by knorke »

Looking good!
Which mod is this unit from? (or just testing)
User avatar
Soulless1
Posts: 444
Joined: 07 Mar 2006, 03:29

Post by Soulless1 »

is that GEM? :-)
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Caydr, you DO know that the exhausts won't stop when the unit has landed?
How ever you could be using MoveRate1() (up to MoveRate3()) and set a var depending on moverate...

Ok imagine you have 3 different AFT effects on your unit (one being occasional smoke, one a flame + smoke and the other a heavy flame, e.g. afterburner)...
Now what you could do is set a variable in these functions to either 0, 1 or 2 and add this var to the 1024 in the emit-sfx section... a good idea would be to increase the sleep value depending on move rate so the unit doesn't produce too much particles when idle (it will slow some people down :P).

Anyway a function to determine the ground height of the root object and start/stop emitting then if it differs would be the best approach I think. Hell you could even have vertical thrusters for taking off landing...
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

exhausts won't stop when the unit has landed?
Ah-ah-ah! I can specify when I want explosions to happen, so I've turned off the flame effect and most of the smoke when it's on the ground :D
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I knew these ground, air, underwater and water tag's weren't just for show... yeah didn't think about that :P. The script still emits though...
User avatar
LathanStanley
Posts: 1429
Joined: 20 Jun 2005, 05:16

Post by LathanStanley »

ummm... the only engines I've EVER seen that give off that much smoke that ARE NOT BROKE!!.. are freakin solid fuel booster rockets...

lol

Image

and booster rockets are a 1 click THRUST BURN! die... there is no throttle, there is no fuel... it just burns, then is gone...

and frankly... a fightercraft, spacecraft.. on those.. isn't plausable..

consider removing most of the smoke... :wink:
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Wondering how many of the birds were fried during the launch... :)
Man there needs to be a KFC co-worker with a bucket collecting any roasted birds that fall down... :P

Caydr about the exhaust flame, the intial values I posted do work, build on them instead.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Since this thread is about replacing the actual hackish show/hide flare effect I'm gonna show something nice Yeha made (and now finally fixed):

Image

Code: Select all

[LARGE_MUZZLE_FLASH_FX]
{
	[LargeMuzzleFlame]
	{
		class = CBitmapMuzzleFlame;
		[properties]
 		{
			dir = dir;
			colorMap=0.9 0.8 0 0.01 0.9 1 1 0.01;
 			size=9;
 			length=15;
 			sizeGrowth=-1;
 			ttl=10;
 			frontOffset=0;
 			sideTexture=muzzleside;
 			frontTexture=muzzlefront;
		}
	water=1;
 	air=1;
	underwater=1;
	ground=1;
	count=1;
	}
}
Now some explanation on the tags:

dir - Direction of the particle, simply leave it "dir=dir;"

size, lenght - self explanatory

sizeGrowth - How much it grows in time TTL. -1 means it'll shrink until it's gone, TTL defines how fast it will shrink then.

frontOffset - Self explanatory, sets the effect x gameunits off the emitted piece

frontTexture, sideTexture - Defines which textures to be used. Uses keywords from the resources.tdf.

TTL - Time To Live - probably in frames or ms.

colorMap
Color map can use an unlimited amount of RGBA values (according to Tobi?). The textures are then going to be blended from the first RGBA color statement to the next and so on. Keep the alpha values low (0.01) in order to get some nice additive alpha blending. Also I found that textures with a black background and no alpha channel to blend nicer than the same with alpha channel (and transparency).

Now that Yeha finally fixed it, it can be emitted from an empty piece (a "flare" for instance) and it uses the pieces roation so it can be rotated by script.

The same class also is pretty useful for thruster like effects I found.

This is probably going to be in 0.73b1 cause it's in the latest SVN. It was already in the test releases (at least I think it was) but it's bugged because it was using the first two vertices from the object to determine the direction before.
Yeha is the man :)
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Yeah... there was way too much smoke. I didn't really have much to work with though. Without a LOT of smoke, the engine glow trailed the fighter too much.

I'm glad to see more generic fire/explosion stuff works now. I just need to find a new build.
Yeha
Posts: 96
Joined: 13 Aug 2004, 19:12

Post by Yeha »

An update on this topic.

For next release emit-sfx 2048 will allways fire the weapon even if there is less than 2 vertices.
emit-sfx 4096 will instead be used for detonating a weapon at a specific piece.

This is so rotation from the piece can be used if there is no vertices to determine direction for the weapon.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Cool. Thanks.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Sweetness! I am playing with this stuff now... expect some nifty muzzle-flashes... and a few other tidbits... in the next NanoBlobs, heh...
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Post by Sheekel »

Could this be used to add some neat effects to planes, like this?

http://www.playfuls.com/images/screensh ... r/0046.jpg
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

Could that system be adapted to:

Code: Select all

	[SFXTypes]
	{
		explosiongenerator0=custom:EXPLOSION1;
		explosiongenerator1=custom:EXPLOSION2;
		explosiongenerator2=custom:CreateZerglings;
	}

Code: Select all

[CreateZerglings]
{
	[CreateUnit]
	{
		class = CCreateUnit;
		[properties]
 		{
			dir = dir;
			Distance=0;
 			Unit=ScZergling;
		}
	water=1;
 	air=1;
	underwater=1;
	ground=1;
	count=2;
	}
}
Making it call, into the position defined by the custom explosion generator script, the "cheat" «.give count zergling».

That would allow us to create units by scripts.
And shouldn't be very hard to implement. Code for unit creation is already there of when we ".cheat" + ".give ArmCa"...
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Post by Sheekel »

Caydr wrote:W00tzies

Image
svecksy
Crampman
Posts: 117
Joined: 22 Dec 2005, 12:17

Post by Crampman »

Sorry for rez this topic, but I think there is maby a little bug with the 'emit 2048+n'
If the weapon triggered by the script have a 'burst' tag, it seems that it is ignored.

Thx :wink:
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Yes but you can just repeatedly emit-sfx.
Post Reply

Return to “Feature Requests”