Renegade Projects Network Forums
Combat Lighting - Printable Version

+- Renegade Projects Network Forums (https://forums.renegadeprojects.com)
+-- Forum: Modding (https://forums.renegadeprojects.com/forumdisplay.php?fid=3)
+--- Forum: C&C Modding Encyclopedia (https://forums.renegadeprojects.com/forumdisplay.php?fid=7)
+--- Thread: Combat Lighting (/showthread.php?tid=997)



Combat Lighting - Vinifera7 - 04.06.2008

This thread is for the purpose of research into combat lighting.

V7's Combat Lighting Test

This test was conducted to formally gather data regarding the way Bright (for weapons and warheads) and Bullets effect combat lighting.

I performed two sets of tests for each combination; one with Damage=500 and one with Damage=1. This was done in YR1.001 and repeated in FS2.0 (sorry if that's not the latest patch).


Raw Data

Key
[weapon]->Bright=yes (1)
[warhead]->Bright=yes (2)
[warhead]->Bullets=yes (3)

Code:
Flags                Observed Effects
A. _ _ _    ->        no combat light
B. 1 _ _    ->        combat light, size based on damage
C. _ 2 _    ->        no combat light
D. _ _ 3    ->        no combat light
E. 1 2 _    ->        combat light, size based on damage
F. 1 _ 3    ->        combat light, size based on damage
G. _ 2 3    ->        no combat light
H. 1 2 3    ->        combat light, size based on damage

It is assumed that Bright and Bullets default to no. This is essentially confirmed in test A.


Conclusion

Only [weapon]->Bright=yes generates combat lighting. [warhead]->Bright and [warhead]->Bullets seem to have no effect.


RE: Combat Lighting - DCoder - 04.06.2008

Bullets= is indeed unused. The Bright brothers are more complex (and stupid). I looked into this part a while ago when Marshall asked me to.

A Combat Light flash is generated by a function that is told how much damage was dealt (before any verses or other stuff), the Warhead to use, which shades to disable (same as CLDisablexx most of the time), and a bool to force a flash even without the warhead's approval. (Is Department Of Redundancy Department hiring?)

When a weapon is fired, it creates a Bullet (projectile). It is told, among other things, the Warhead to use on impact, the maximum Speed , and "Brightness" (in most cases that is Weapon->Bright).

When a bullet impacts, if it was given a "Brightness" of true, it calls on the flash maker function. It gives that function the right damage, the right warhead, the right CL flags, but tells it to force a flash. Hence, Warhead->Bright is ignored in this case.

When a bullet airbursts, it spawns child projectiles. But those projectiles are always told "Speed = 50, Brightness = 0". IOW, airburst weapons never get flashes even when the INI code tells them to.
Cluster weapons receive the correct settings though.

Projectiles are also created without firing a weapon:
NukeMaker=yes spawns a Bullet which takes its stats from [NukePayload], but "Brightness = 1".

Flashes are also created without a projectile, and these do obey Warhead->Bright most of the time:
An expiring Animation with an ExpireAnim and Warhead set - Animation->Damage, Animation->Warhead, obeys Warhead settings.
An activating Laser Fence post killing a unit - Unit->Health, Rules->C4Warhead, obeys.
Unit collecting Crate containing Explosives - Unit->Health, Rules->C4Warhead, obeys.
Old hardcoded IonCannon firing - Rules->IonCannonDamage, Rules->IonCannonWarhead, obeys.
Map Actions "Small/Medium/Large Light Flash" - 50/100/300, Rules->C4Warhead, obeys.
Map Action "Do Explosion" - assignedWeapon->Damage, assignedWeapon->Warhead, obeys.
Bullet hitting an Iron Curtained unit - Bullet->Damage * 2, Bullet->Warhead, forces a Red flash.
(What I assume to be) Magnetron dropping a unit on an obstacle - Unit->Health, Rules->C4Warhead, obeys.
Voxel Anim on impact - VoxelAnim->Damage, VoxelAnim->Warhead, obeys.


RE: Combat Lighting - Vinifera7 - 04.06.2008

So in other words, for projectile firing weapons, weapon->Bright is used. But when a warhead is invoked without the presence of a projectile, then warhead->Bright is obeyed.

WW could have just make warhead->Bright work for all cases..


RE: Combat Lighting - Marshall - 04.06.2008

They couldn't do that, on the grounds that it might have been helpful.