Flare effect using emit-sfx
Moderator: Moderators
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
).
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...
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

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...
- LathanStanley
- Posts: 1429
- Joined: 20 Jun 2005, 05:16
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

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...
lol

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

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):

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 :)

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;
}
}
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 :)
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.
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.
Could this be used to add some neat effects to planes, like this?
http://www.playfuls.com/images/screensh ... r/0046.jpg
http://www.playfuls.com/images/screensh ... r/0046.jpg
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
Could that system be adapted to:
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"...
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;
}
}
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"...