Some of it was from a few different posts from the old forum.
Some obvious problems are that the flash of light from your weapon is disabled while the flashlight is on. The AI Turret doesn't have light.
Really just a starting point but thought it might be useful.
lightRadius is equal to "range" so change that for distance of beam.
Download:
https://drive.google.com/open?id=1CreRU ... Yh0NoeD417
Install instructions:
1) in game/scripts/client/default.bind.cs
add to bottom:
//Add Flashlight $FlashlightVar = "1"; function toggleFlashlight(%val) { if (%val) { if($FlashlightVar) { $FlashlightVar = "0"; commandToServer('EnableFlashlight'); } else { $FlashlightVar = "1"; commandToServer('DisableFlashlight'); } } } moveMap.bind( keyboard, f, toggleFlashlight );
2) in game/scripts/server/player.cs
add to bottom:
//Add Flashlight function Player::FlashlightEnable(%player) { %player.getMountedImage($WeaponSlot).setFieldValue("lightType", "SpotLight"); %player.getMountedImage($WeaponSlot).setFieldValue("lightRadius", "25"); } function Player::FlashlightDisable(%player) { %player.getMountedImage($WeaponSlot).setFieldValue("lightType", "WeaponFireLight"); %player.getMountedImage($WeaponSlot).setFieldValue("lightRadius", "10"); }3) in game/scripts/server/commands.cs
add to bottom:
//Add Flashlight function serverCmdEnableFlashlight(%client) { %player = %client.player; %player.FlashlightEnable(); } function serverCmdDisableFlashlight(%client) { %player = %client.player; %player.FlashlightDisable(); }