This uses the new spotlight actors in GZDoom.
Preview: https://my.mixtape.moe/dfnlrl.m4v Click and your browser should just play.
Needs a release from at least 2018-02-10.
Assign a key to toggle the flashlight in your controls menu right at the bottom of "customise controls".
Under options, you can select Flashlight and customise it. Options take affect next time it switches on.
There is some jitter in the changing of location and orientation of the spotlight. Using the target pointer of lights doesn't solve the jitter and is not suitable anyway as the light should emit from the actor's "shoulder". I'm not sure this will ever be fixed or can even be fixed given the way ZDoom updates actors. You can stop it right now by turning off rendering interpolation off but then you only get 35 FPS. Suggestions very welcome.
12 Feb, 2018
https://www.dropbox.com/s/kz4tp5nhog772 ... 2.pk7?dl=1
- You may now choose a location for the light to emit from.
- The light now reacts to crouching.
- Multiplayer now supported. Settings are shared.
https://www.dropbox.com/s/vbwsji4l6e85m ... 0.pk7?dl=1
Unlicense. (That means do what you want, no credit needed.)