• Image

Dynamic (flash-) lighting

ModderFlugente

StatusRELEASED

Go to Project

As I can’t stand cuddly bears crying in the dark, I added dynamic lighting to the game. How dynamic it is really depends on wether I caught all relevant spots, so don’t expect wonders. Basically, every item can now be defined to be a flashlight. A flashlight has the ability to light a few tiles in front of the merc who has the thing in his hands. I update the lighting to his movements, thereby creating (more or less convincing) the illusion that the light source moves.

Flashlights need batteries to work (they drain relatively slow). They can be turned on and off via item transformation. Only those items in your hands that are flashlights/have flashlight attachments and have batteries are considered to be on – only they will make light. Flashlights also don’t work on the surface during the day, because there is no need to.

This video shall serve as demonstration.

Take special note of the fact that Raider only sees the enemy when the light is on, and that the flashlight does not go through walls.The only new tag in Items.xml is , an UINT16-entry. Items that have a value > 0 are considered flashlights, this is also the range in tiles that the light shines. This is in the trunk as of r6061 and GameDir r1667. Useable flashlights are the Rifle LAM-Flashlight Combo and the new Flashlight item (#1636), which also works as a melee weapon (remember, anything can be a flashlight, including attachments).

Note that there may still be some instances that should cause a light redraw but don’t – please notify. This is actually the hard part.

And before you ask: No, I will not make flashlights work out of the inventory. ‘Cause its uncool.