Oddball-47 Ronin 28 Posted September 1, 2020 On 8/27/2020 at 1:37 PM, The Real Bunc said: Hey @Oddball-47 Ronin I haven't been on much for the last couple of months ( just had to get on with some other things). Great to see someone else incorporating my script into a mission. Il grab it from Steam and have a go. Thanks to Aussie battler as well for error spotting. I'll check that and sort it sometime soon. Thanks for the positive comments about the script as well. Edit: Oddball - I ve just read your blurb on steam - I'm blushing. Bah, no need to blush, Bunc. This truly is a really neat script and is a perfect fit for "Unsung". Sadly, for me, I've only been able to play the mission once in a group. My tiny band of warriors has either grown bored with Arma or are just so caught up in other things and real life, that we've not played it but once, and that was two weeks or so ago. Again, my thanks to you and Accuracythruvolume. I really had a wonderful time getting back into the editor and stumbling my way through making a mission with it. Best regards, Odd 1 Share this post Link to post Share on other sites
HolgerHolleBolle 2 Posted January 25, 2022 Hi Bunc, I have added a few features to your great script and would like to make a mod version of it. Would it be ok for you if I Publish that on the workshop with reference to your script? I feel this should be a mod available with CBA Parameters. 1 Share this post Link to post Share on other sites
The Real Bunc 137 Posted February 16, 2022 Sorry I havent been on here in months ( life) General information for anyone wanting to use this script in Mod or similar - You can, I would be delighted but please 1) Acknowledge this script in your Mod 2) Give a link back to this thread 3) Post a note here about your mod/use of it Other than that have at it and I thank you for your interest, (I really wanted to mod this myself but I doubt Im going to have the time now) Share this post Link to post Share on other sites
HolgerHolleBolle 2 Posted February 24, 2022 Hi Real Bunc, Thank you again for makying this great script. After checking a bit I am not sure I can make a Mod out of this. I would need to learn how to make a mod from Scratch. For The Community and maybe for your further Developement I want to share my little update I made here. I hope that is ok with you. (I wont share it anywhere else) So I basically added two Features. 1) Unit speed is taken into account. So when you stand still you get a better camouflage. 2) Also I Integrated a check if the Player is on Grass and prone. If you are prone and there is Grassterain you get a really high Camouflage boost. (I always found it unfair that AI could detect players lying in grass so easily. This fixes that. These where two things I missed and it is working great from my tests. I am a novice scripter. I hope I made the code clear to understand. It would be really great if you or any other person could make this into a mod. I can not play without this Script anymore. It adds so much to the gameplay if you like sneaky style missions. //The original script was made by The Real Bunc // https://forums.bohemia.net/forums/topic/223202-release-dynamiccamo-script/ // I just added 2 Features: // Unit speed is considered for Camouflage. So when you run you get detected easier than moving slow. // Best camo is achieved by standing still and prone. // Also I added that the Ground type gets checked. So if you are on a grass surfaces AND prone you get a better Camouflage ////////////////////////////////////////////////////////////// // Put this in Init of Player : // camo = [this,"DEBUG",0,1,0,1,5] spawn compile preprocessFile "camoscript_HB.sqf"; ////////////////////////////////////////////////////////////// // DynamicCamo by Bunc v 1.5 // Free to use but credit me please. // Script adjusts unitTrait camouflagecoef & audibleCoef based on environmental factors, stance and uniform. // makes it harder for ai to detect unit depending on weather, stance, camo, cover etc. // v1.5 Script call now passes the following arguments for easy adjustment // [this,"Debug", "Ghillie",camLo,CamHi,AudLo,AudHi,Autodelay] // Where CamLo = n and n>= 0 and n<=1 default 0 // where CamHi = n and n>= 0 and n<=1 default 1 // same for AudLo and AudHi. // Autodelay is delay bewteen each autorecalc in secs. // Script now detects specific uniforms. // script also impacts ai to ai perception - ai units will benefit from DynamicCamo re detection by other ai. // to use on non player ai simply put unique call to script in that units init. // FACTORS // fog. - (0 is no fog 1 is full fog.) // Camo - factor for uniform. 0 is high uniform camo. changed via Ghillie switch. // rain - rain density. 1 full rain 0 no rain. // lightlevel - Stepwise function accounting for night, dawn, midday, dusk. range 0 dark to 1 light. // overcast - 0 clear skies to 1 full overcast. // NB script allows for linear rescaling to give better weights for each factor as required. // NB camouflageCoef values in unit trait appear to have a subtle effect // until values are small. rescaling of values ensures calculation produces figure in appropriate range for desired impact. // NB units start with camouflageCoeff set to 1 as far as I can tell. // we want combination of these factors where they are all present to produce a small ccoef // approaching zero and perhaps not too near 1 when there are no factors in play. // linear rescaling is available on the output the output if further adjustment is required. // basic formula - // newcamcoef is the value that will be set as unit trait camouflageCoef // newcamcoef = sqrt( (1-fog) * camo * (1-rain) * darkvalue * (1-overcast) // NB 0 for a factor would set camocoef to zero and we might also want some // effect even when a factor is 1 so we can scale these inputs to a smaller range eg 0.01 to 0.99 // the specific scaling needs to be tested for best effect. // We start the main loop which continues while player alive // then waituntil player presses User1 assigned key or set autodelay _ad via param. //----------------------------------------------------------------------------------------------- params ["_unit","_debug","_cLo","_cHi","_aLo","_aHi","_ad"]; if (_debug == "DEBUG" ) then { _autoInfo = "autodelay " + str _ad; hint _autoInfo; }; _time = time; while {alive player} do { waitUntil {_newtime = time; inputAction "User1" >0 OR (_newtime >_time +_ad)}; //GET FACTORS AND SCALE THEM. //GET TREES BUSHES AND HIDE FACTOR _tbhf _ntb = count nearestterrainobjects [_unit,["Tree", "SMALL TREE","RUIN", "ROCKS", "BUSH", "ROCK"],4,false,true]; _nh = count nearestterrainobjects [_unit,[ "HIDE"],4,false,true]; //set default tb factor before if _tbf = 1; if (_ntb ==0 ) then {_tbf =1;}; if (_ntb == 1) then {_tbf = 0.5;}; if (_ntb >= 2) then {_tbf = 0.25;}; //Set Hide Factor _hf = 1; if (_nh ==0 ) then {_hf =1;}; if (_nh == 1) then {_hf = 0.5;}; if (_nh >= 2) then {_hf = 0.25;}; // get fog and rescale result to desired range. _foglevel = linearconversion [0,1,fog,0,0.8,true]; // Camo V1.5 includes uniform test. Default Camo is 1 _uniform = uniform _unit; _camo = 1; if ((str _uniform find "Combat" >=1) OR (str _uniform find "CTRG" >=1) OR (str _uniform find "Officer" >=1)) then {_camo = 0.5;}; if ((str _uniform find "Ghillie" >=1) OR (str _uniform find "Sniper" >=1) OR (str _uniform find "Viper" >=1)) then { _camo=0.4;}; // v 1.3 getwind strength and scale it _windstrength = vectormagnitude wind; _windscaled = linearconversion [0,7,_windstrength,0,0.9,true]; // get rain level and scale it v.13 added specific audible level _rainLevel = linearconversion [0,1,rain,0,0.6,true]; _rainLevelA = linearconversion [0,1,rain,0,0.9,true]; // NEW LIGHT LEVEL FACTOR // 1 is full light 0 is dark. Light will not impact audible. // initialise _lightlevel before if statements // now handles dusk and dawn. // get sunrise and sunset _sunriseSunsetTime = date call BIS_fnc_sunriseSunsetTime; _sunrise = _sunriseSunsetTime select 0; _sunset = _sunriseSunsetTime select 1; _lightlevel = .5; // get decimal time _timenow = daytime; // set required variables p= 1; _sre = _sunrise +p; _srs = _sunrise -p; _sss = _sunset -p; _sse = _sunset +p; // Test and assign _lightlevel values if ((_timenow >= 0) && (_timenow <=_srs)) then { _lightlevel = 0; }; if ((_timenow >= _sse) && (_timenow <=24)) then { _lightlevel = 0; }; if ((_timenow <= _sse) && (_timenow >=_sre)) then { _lightlevel = 1;}; if ((_timenow >=_srs) && (_timenow <= _sre)) then {_lightlevel = 0.5 *(_timenow-_srs);}; if ((_timenow >=_sss) && (_timenow <=_sse)) then {_lightlevel = -0.5 * (_timenow -(_sse));}; // Linear scaling to allow adjustment of lightlevel impact. _lightlevelscaled = linearconversion [0,1,_lightlevel,0.1,1]; // get overcast level and scale it. _overcastLevel = linearconversion [0,1,overcast,0,0.4,true]; // GET STANCE AND ASSIGN VALUES v1.3 added _stA stance audible impact. _stanceresult = stance _unit; _st = 1; _stA = .5; switch (_stanceresult) do { case "STAND" : {_st = 1; _stA =1;}; case "CROUCH" : {_st = 0.6; _stA=.7;}; case "PRONE" : {_st = 0.4; _stA =.5;}; case "SWIMMING": {_st = 0.75;_stA=.7;}; case "UNDEFINED" : {_st = 1;_stA=0;}; }; //GET GROUND _gtype = surfaceType position _unit; // set ground factor _gf = 1; if (_gtype == "#GdtGrassDry" and _stanceresult == "PRONE") then {_gf =0.3}; if (_gtype == "#GdtGrassGreen" and _stanceresult == "PRONE") then {_gf =0.3}; if (_gtype == "#GdtDirt" and _stanceresult == "PRONE") then {_gf =0.3}; //Unit Speed _speed = speed _unit; _sf = 1; if (_speed <= 15) then {_sf = 0.9;}; if (_speed <= 5.5) then {_sf = 0.8;}; if (_speed <= 3) then {_sf = 0.7;}; if (_speed == 0) then {_sf = 0.6;}; // RUN THE CALCULATION _newCamCoef = sqrt ( (1-_foglevel) * _camo * (1 - _rainLevel) * _lightLevelscaled * (1 - _overcastLevel) * _st * _tbf *_gf *_sf *_hf ); _newCamCoefA = sqrt ( (1-_foglevel) * (1 - _rainLevel) * (1 - _overcastLevel) * _stA * (1-_windscaled) ); // scale our new camcoefs to whatever ranges we desire // as given in arguments to the script _newCamCoefScaled = linearconversion [0,1,_newCamCoef,_cLo,_cHi,true]; _newaudibleCoefScaled = linearconversion [0,1,_newCamCoefA,_aLo,_aHi,true]; // set our calculated value as the UnitTrait for camouflageCoef and audibleCoef _unit setUnitTrait ["camouflageCoef", _newcamCoefscaled]; _unit setunitTrait ["audibleCoef", _newaudibleCoefScaled]; // DEBUG / ONSCREEN INFO if (_debug =="DEBUG") then { _known = man knowsAbout _unit; _testit = _unit getUnitTrait "camouflageCoef"; _testit1 = _unit getUnitTrait "audibleCoef"; // show calculated result for tuning - comment out if required _camCoeftest= "Camo "+ str _testit; _AudCoeftest= "Audio "+ str _testit1; _knowledge = "KnowsAbout " + str _known; _TBresult = "Bushes: " + str _ntb + " Ground: " + str _gf + " HIDE " + str _nh + " SPEED: " + str _sf; hint _TBresult; systemchat _camCoeftest; systemchat _AudCoeftest; systemchat str _knowledge; }; // sleep for a bit so that bobbing up and down in combat doesnt cause // too many runs on the script. Also allows player to go prone, // get extra camo then bob up again retaining prone camo for a short while. sleep 1; _time=time; }; 1 Share this post Link to post Share on other sites
The Real Bunc 137 Posted February 27, 2022 Your additions sound great and Im really looking forward to trying the script with these additions. 1 Share this post Link to post Share on other sites
Karl_Keesel 0 Posted March 24, 2022 Hi, i been trying to install the script on my campaign but the installation description is a bit confusing, so i don't know if its working or not, can you make a more detailed installation description please or a video so its easier to follow for those who we are not used to install scripts ✌🏻✌🏻✌🏻, thanks for your work it must be awesome. On 2/26/2022 at 9:31 PM, The Real Bunc said: Your additions sound great and Im really looking forward to trying the script with these additions. Share this post Link to post Share on other sites
The Real Bunc 137 Posted September 12, 2022 I finally decided to bite the bullet and have turned this script into an addon. Tested tonight and it appears to work fine at least as a local addon for me. I'm hoping I may be in a position to release this on Steam shortly (some tidying up of script to do first) Note -- I havent used HolgerHolleBelle's suggested additions at this point. I may update the addon later with them but, from memory, when I tested his changes one of them seemed to be duplicating to a degree something already in script. But I need to recheck this. Oh and before I forget - Bis added a light level related command in a previous update so I'm hoping to update the script and remove my relatively cumbersome proxy calc of this and replace it with an exact light level value. I tested the command at the time and it seemed to detect light from street lamps, sunlight etc. I think this would be a major uplift for the script. 1 1 Share this post Link to post Share on other sites
The Real Bunc 137 Posted September 15, 2022 Ok my addon is up and working. It runs automatically on player (assuming the mod is loaded) in any scenario, mission, campaign etc. It does this with no debug info and with the parameters set so that it gives fairly good camo but not so much that it is a ridiculous cheat. So it requires no further setup at all by the player once the mod is loaded. For scenario makers the autorun camo that the mod starts can be easily stopped with a simple command (usually in a trigger or say a waypoint) to terminate the script and then the script can be set on player and or AI units again (usually via trigger or waypoint) with the scenario makers desired choice of parameters. So basically, DynamicCamo be easily stopped and started within a scenario and parameters changed as desired. No script installations at all are required. Anyone wanting to test DynamicCamo to see how it is operating will be able to use the debug feature this way. I'm just working out now how to sign the addon and do the final bells and whistles. Quite surprised myself that I was able to do all this. It turned out not to be as complex as I thought it would be. Share this post Link to post Share on other sites
The Real Bunc 137 Posted September 15, 2022 Now released on Steam Workshop as an Addon. Search for DynamicCamo MOD VERSION author: Bunc 1 Share this post Link to post Share on other sites
The Real Bunc 137 Posted September 19, 2022 I'm pleased to see my mod is getting picked up on Steam. It's now showing as one of the most popular Arma 3 mechanics mods for the week on Steam. yay! 2 Share this post Link to post Share on other sites
Maff 248 Posted September 19, 2022 Nice one, @The Real Bunc! I haven't been keeping up with development since its early release, but I have a question. What is your favourite scripting command in Arma? Share this post Link to post Share on other sites
The Real Bunc 137 Posted October 6, 2022 Ok shameless self promotion here - Knightin on Steam very kindly offered to do a review/promotion video for my mod. So here it is. I like the way he does his videos. Anyway further updates of the mod are to be anticipated as I take on board the requests to see if I can decouple the mod from User action 1 ( without changing how the mod operates). Oh and Maff my favourite scripting command would be This. 4 Share this post Link to post Share on other sites
Warlocc 0 Posted October 22, 2022 Seems to still be spamming a ton of script errors if debug is on. Share this post Link to post Share on other sites
Maff 248 Posted October 22, 2022 What's the tonne of script errors you are receiving? Share your .RPT file. What happens when you disable debug? Share this post Link to post Share on other sites
ouchthathurt 0 Posted November 8, 2022 On 9/12/2022 at 11:44 PM, The Real Bunc said: Oh and before I forget - Bis added a light level related command in a previous update so I'm hoping to update the script and remove my relatively cumbersome proxy calc of this and replace it with an exact light level value. I tested the command at the time and it seemed to detect light from street lamps, sunlight etc. I think this would be a major uplift for the script. Love this script. I’m having a go at a script for natural night vision (so vision improves if you keep away from light sources). What’s this light level command you speak of? Share this post Link to post Share on other sites
kibaBG 53 Posted November 13, 2022 The script version of @HolgerHolleBolle have unknown variable "man" (line 211): _known = man knowsAbout _unit; What is this about? 🙄 Share this post Link to post Share on other sites
pierremgi 4843 Posted November 14, 2022 6 hours ago, kibaBG said: The script version of @HolgerHolleBolle have unknown variable "man" (line 211): _known = man knowsAbout _unit; What is this about? 🙄 That's an home-made debug part with a unit (probable enemy) called man in editor. You can skip the whole "debug" condition starting with knowsAbout command. 1 Share this post Link to post Share on other sites
kibaBG 53 Posted December 11, 2022 Quote to use on non player ai simply put unique call to script in that units init. What if the unit is spawning by script after mission start? I am trying to make this script work for JIP in SP (teamSwitch). You can just do: camo = [player,"DEBUG",0,1,0,1,5] execVM "camoscript_HB.sqf"; Tested and its working this way for the player. But for JIP this is not working. camo = [_newUnit,"DEBUG",0,1,0,1,5] execVM "camoscript_HB.sqf"; I tried to "re-deploy" the script to the JIP unit but is not working. waitUntil { sleep 1; !isNull player }; camo = [player,"DEBUG",0,1,0,1,5] execVM "camoscript_HB.sqf"; Any ideas? Edit: I think I made it working with this in JIP spawn script : _newUnit setVehicleVarName "BOB"; _newUnit call BIS_fnc_objectVar; //some other stuff and then camo = [BOB,"DEBUG",0,1,0,1,5] execVM "camoscript_HB.sqf"; This script change the tactics so much in the right direction, thanks @The Real Bunk. Share this post Link to post Share on other sites