Jason Campbell Posted March 31, 2019 Share Posted March 31, 2019 Here is a very simple flashlight that uses the weapons fire light as a flashlight.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=1CreRU3RchgZ-4WQhLwEWz4Yh0NoeD417Install instructions:1) in game/scripts/client/default.bind.csadd 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.csadd 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.csadd to bottom: //Add Flashlight function serverCmdEnableFlashlight(%client) { %player = %client.player; %player.FlashlightEnable(); } function serverCmdDisableFlashlight(%client) { %player = %client.player; %player.FlashlightDisable(); }SimpleFlashlight.zipinstall Flashlight Quote Link to comment Share on other sites More sharing options...
Bishop Posted March 31, 2019 Share Posted March 31, 2019 Thanks very much for this Jason,....for my project I just need a flashlight so it's great resource....Thanks a lot. Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted March 31, 2019 Author Share Posted March 31, 2019 No problem, it does leave a bit to be desired. It was your night screenshots that made me think of posting this. It was just sitting there in my last project. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted March 31, 2019 Share Posted March 31, 2019 another addition to this is to add a cookie to the light Quote Link to comment Share on other sites More sharing options...
Bishop Posted April 1, 2019 Share Posted April 1, 2019 another addition to this is to add a cookie to the light ...what are the cookies for? Quote Link to comment Share on other sites More sharing options...
Azaezel Posted April 1, 2019 Share Posted April 1, 2019 https://en.wikipedia.org/wiki/Cucoloris Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted April 1, 2019 Share Posted April 1, 2019 exactly what az shared only in png format lol Do cookies need to be png format ? or can they be any format? Quote Link to comment Share on other sites More sharing options...
Bishop Posted April 2, 2019 Share Posted April 2, 2019 Thanks...i see!...projected shadows..I think the best is png....tga, jpge2000....only what they support the alpha channel. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.