SchwEde Posted April 10, 2015 Report Share Posted April 10, 2015 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Schwede's improved Flashlighst <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< What it does? It simply add a bit more light to your surrounding so flashlights are more effective then they are by default. Screenshot: How it works: This Scripts is completly local and is not visible by other players, since the light of the flashlight should be enough attraction for them. How to install You need to make changes in: init.sqfvariables.sqfcompiles.sqfdayz_spaceInterrupt.sqf first we make our new file called: flashlight.sqf and paste this in there and place it somewhere you like: /** Schwedes Flashlight improvement **/ Private ["_num","_light","_type"]; _type = _this select 0; switch (_type) do { case 0: { _light = "#lightpoint" createVehicleLocal (getPosATL player); _light setLightBrightness 0.01; systemChat format['currentWeapon player: %1',(currentWeapon player)]; if ((currentWeapon player) == "MeleeFlashlightRed") then { _light setLightColor [0.5,0,0]; _light setLightAmbient [0.2,0.01,0.01]; } else { _light setLightAmbient[.9, .9, .6]; _light setLightColor[.9, .9, .6]; }; _light lightAttachObject [player, [0.1,2,0.5]]; }; case 1: { player action ["GunLightOff", player]; _light = nearestObject [player, "#lightpoint"]; deleteVehicle _light; Schwede_flashlicht = false; }; }; Next we create another file called and place it somewhere you like: lightcheck.sqf and paste this in there: /** Schwedes Flashlight improvement Light Check **/ Private ["_light"]; waitUntil {!isNull (findDisplay 46)}; //making sure player is spawned while {true} do { waitUntil {Schwede_flashlicht}; if !((currentWeapon player) in Schwede_FlashlightWeapons) then { player action ["GunLightOff", player]; _light = nearestObject [player, "#lightpoint"]; deleteVehicle _light; Schwede_flashlicht = false; }; sleep 0.1; }; Time to make this thing to work: variables.sqf: search for // DayZ Epoch Client only variables and add right after: if(isNil "Schwedes_flashlicht") then { Schwedes_flashlicht = false; }; search for if(!isDedicated) then { and place this somewhere in this area: Schwede_FlashlightWeapons = ["M4A3_CCO_EP1","SCAR_L_CQC_Holo","SCAR_H_CQC_CCO","MeleeFlashlight","MeleeFlashlightRed"]; //This array wants to be filled with weapons with flashlights compiles.sqf add this Schwedes_flashlight = compile preprocessFileLineNumbers "PathTo\flashlight.sqf"; to the if(!isDedicated) then { area dayz_spaceInterrupt.sqf place this somewhere in it: //flashlight if (_dikCode in actionKeys "Headlights" && ((currentWeapon player) in Schwede_FlashlightWeapons) && ((vehicle player) == player)) then { if (Schwedes_flashlicht) then { Schwedes_flashlicht= false; _id = [1] spawn Schwedes_flashlight; } else { Schwedes_flashlicht= true; _id = [0] spawn Schwedes_flashlight; }; }; init.sqf add this [] execVM "PathTo\lightcheck.sqf"; to the if(!isDedicated) then { area Save everything and load up everything. Suggestions? Post them here Like my work? why not spend me a beer then ;D Link in my Sig :) CartoonrBOY, calamity, Gr8 and 6 others 9 Link to comment Share on other sites More sharing options...
Guest Posted April 11, 2015 Report Share Posted April 11, 2015 It is kinda alread Link to comment Share on other sites More sharing options...
Guest Posted April 11, 2015 Report Share Posted April 11, 2015 The amount of people who will write "pathto" is already funny :D Link to comment Share on other sites More sharing options...
McToots Posted April 11, 2015 Report Share Posted April 11, 2015 Does this affect vehicle lights? Link to comment Share on other sites More sharing options...
SchwEde Posted April 13, 2015 Author Report Share Posted April 13, 2015 no this is just for guns Link to comment Share on other sites More sharing options...
CartoonrBOY Posted April 16, 2015 Report Share Posted April 16, 2015 Awesome script SchwEde. My server spends 12 hours per day in the dark so this will prove very useful. Many beans my friend. Link to comment Share on other sites More sharing options...
SchwEde Posted April 16, 2015 Author Report Share Posted April 16, 2015 same for us, that why the idea was born to make a flashlight more usefull then it was ^^ Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2015 Report Share Posted April 16, 2015 Umm i just noticed the Topic (read carefully): Schwede's improved Flashlighst Link to comment Share on other sites More sharing options...
SchwEde Posted April 16, 2015 Author Report Share Posted April 16, 2015 now it stays this way ;D Just to keep it recognizable ^^ Link to comment Share on other sites More sharing options...
Guest Posted April 17, 2015 Report Share Posted April 17, 2015 I don't get this: //flashlight if (_dikCode in actionKeys "Headlights" && ((currentWeapon player) in Schwede_FlashlightWeapons) && ((vehicle player) == player)) then { if (Schwedes_flashlicht) then { Schwedes_flashlicht= false; _id = [1] spawn Schwedes_flashlight; } else { Schwedes_flashlicht= true; _id = [0] spawn Schwedes_flashlight; }; }; If schwedes licht is true, then... Where do you define Schwedes Licht, so that script knows if that's true or not? Link to comment Share on other sites More sharing options...
SchwEde Posted April 18, 2015 Author Report Share Posted April 18, 2015 oh you are right i forgot the step with the isNil part to the variables.sqf ^^" whopsie Post #1 updated search for: variables.sqf // DayZ Epoch Client only variables and add right after: if(isNil "Schwedes_flashlicht") then { Schwedes_flashlicht = false; }; Link to comment Share on other sites More sharing options...
Guest Posted April 18, 2015 Report Share Posted April 18, 2015 Noch was (sorry, will deine Arbeit nicht schlecht machen):_id = [0] spawn Schwedes_flashlight; Schwede_flashlight = compile preprocessFileLineNumbers "PathTo\flashlight.sqf"; Die Function die du aufrufen willst existiert nicht, weil du ein "S" vergessen hast :) Link to comment Share on other sites More sharing options...
SchwEde Posted April 18, 2015 Author Report Share Posted April 18, 2015 Verbesserungen sind immer erwünscht und gern gesehen :) liegt daran, dass meine Variablen anders hießen und ich sie für den release etwas umbenannt habe ^^ ryker 1 Link to comment Share on other sites More sharing options...
BigCrazyCat Posted June 27, 2015 Report Share Posted June 27, 2015 Client RPT Errors: File mpmissions\__CUR_MP.Napf\custom\flashlight\lightcheck.sqf, line 6 Error in expression <ay 46)}; while {true} do { waitUntil {Schwede_flashlicht}; if !((currentWeapon> Error position: <Schwede_flashlicht}; if !((currentWeapon> Error Undefined variable in expression: schwede_flashlicht File mpmissions\__CUR_MP.Napf\custom\flashlight\lightcheck.sqf, line 6 To fix this error add second variable (near first) in variables.sqf.It looks like this: if(isNil "Schwedes_flashlicht") then { Schwedes_flashlicht = false; }; if(isNil "schwede_flashlicht") then { schwede_flashlicht = false; }; Link to comment Share on other sites More sharing options...
chi Posted July 31, 2015 Report Share Posted July 31, 2015 Should this work fine with Overpoch? Seems like I had it working on Epoch then changed my client server to overpoch and it doesn't work anymore. Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted July 31, 2015 Report Share Posted July 31, 2015 Should this work fine with Overpoch? Seems like I had it working on Epoch then changed my client server to overpoch and it doesn't work anymore. There's no reason this shouldn't work on Overpoch. Double check to be sure that you didn't replace any of the files required for this script with the same files when installing Overpoch. Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted July 31, 2015 Report Share Posted July 31, 2015 Just installed this script and I found a bug. If you have your flashlight on and you switch weapons, there's still an ambient glow, which is basically the effect that this script adds to the flashlight to make it brighter. See these screenshots for a better explanation. Flashlight turned on. You see the ambient light effect here. Flashlight left on, switched weapons. You still see the ambient light. Flashlight turned off, no ambient light. Switched to weapon, after flashlight was turned off, still no ambient light. Link to comment Share on other sites More sharing options...
chi Posted August 1, 2015 Report Share Posted August 1, 2015 Just installed this script and I found a bug. If you have your flashlight on and you switch weapons, there's still an ambient glow, which is basically the effect that this script adds to the flashlight to make it brighter. See these screenshots for a better explanation. Flashlight turned on. You see the ambient light effect here. Flashlight left on, switched weapons. You still see the ambient light. Flashlight turned off, no ambient light. Switched to weapon, after flashlight was turned off, still no ambient light. I saw this last night as well. Link to comment Share on other sites More sharing options...
chi Posted August 1, 2015 Report Share Posted August 1, 2015 So i just checked the bug again from last night that you described above and the bug doesn't happen either. Everything seems to be in place... >:-l Link to comment Share on other sites More sharing options...
chi Posted August 1, 2015 Report Share Posted August 1, 2015 Ok, figured out what was causing the problem with the flashlight not working. I installed Advanced Alchemical Crafting v3.3 and the Crafting_Compiles was conflicting with the dayz_spaceinterrupt. i used diffmerge to merge the two and now it works fine. I need to find out how to make the "F" key make the object stay still though for Advanced Alchemical Crafting v3.3. Haven't checked the forums yet, but if anyone can save me some time I would appreciate it. ;-) Thanks for making me take another look BetterDeadThanZed. Appreciate it!! Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted August 10, 2015 Report Share Posted August 10, 2015 Just installed this script and I found a bug. If you have your flashlight on and you switch weapons, there's still an ambient glow, which is basically the effect that this script adds to the flashlight to make it brighter. See these screenshots for a better explanation. Flashlight turned on. You see the ambient light effect here. Flashlight left on, switched weapons. You still see the ambient light. Flashlight turned off, no ambient light. Switched to weapon, after flashlight was turned off, still no ambient light. Anyone have a solution for this yet? Link to comment Share on other sites More sharing options...
chi Posted August 10, 2015 Report Share Posted August 10, 2015 I wish there was. Seems like it would be something simple to end the script on weapon change, but i'm no coder. Link to comment Share on other sites More sharing options...
SapioiT Posted August 10, 2015 Report Share Posted August 10, 2015 It would be great to also see the other players' light, so when you're in a group and only one haves a flashlight, you get to use it properly... maybe the other ones struggling to meele the zedz... Link to comment Share on other sites More sharing options...
chi Posted August 12, 2015 Report Share Posted August 12, 2015 Anyone have a solution for this yet? Bump Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now