Flashlight (TEX)




To be updated*


I've made some tests and had little progress since I've started to use this type of flashlight, in one of these tests the SHD was nulled and it still working. It was when I realize that it can work only with the TEX file. The only part that seems to matter is the header and the bottom of the TEX file. I wasn't able to cast two textures at the same time, or blend the texture with fade other than filling the room with fog.


Offset 20: How many entries there are in the bottom of the file pointing to texture packs, however I wasn't able to choose different textures. The entries have 96 bytes length and start with "12345678". Maybe forcing the game to load a second header with a different offset 24 may make it possible, but even then, the models can't interact with more than 1 casted texture as far a I know. More research is needed.


Offset 24: The LIT entry "ShadowHeight = xx" must match the value here, otherwise the light will not be casted.


Offset 44: Seems to be related to the texture pack, maybe the distance 4256 bytes. When the value is lowered, bytes should be deleted accordingly in order to not crash, but it breaks the projection for some reason even if the value matches the distance (If the value is set wrong it always crashes). It creates the same result as setting ShadowHeight = 0 in LIT. 


ShadowHeight = 0


Offset 10A4:  Breaks the projection when changed apparently.

Offset 10C8:  Breaks the projection when changed apparently.

Offset 10FC: How many bytes to the start of texture pack id.



Example 1: 

38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 0D 03 00 44 09 03 00 00


Example 2: 

3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 0D 03 00 44 09 03 00 00