Jump to content

The Real Bunc

Member
  • Content Count

    178
  • Joined

  • Last visited

  • Medals

Community Reputation

136 Excellent

3 Followers

About The Real Bunc

  • Rank
    Sergeant

Recent Profile Visitors

1639 profile views
  1. The Real Bunc

    [RELEASE] DynamicCamo Script

    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.
  2. The Real Bunc

    [RELEASE] DynamicCamo Script

    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!
  3. The Real Bunc

    [RELEASE] DynamicCamo Script

    Now released on Steam Workshop as an Addon. Search for DynamicCamo MOD VERSION author: Bunc
  4. The Real Bunc

    [RELEASE] DynamicCamo Script

    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.
  5. The Real Bunc

    using a function to spawn scheduled code

    That feels really helpful Larrow but its going to take me more than one pass through on that to get my head round it. LOL I think I get the jist though. Actually I want the function to run on player probably always postinit so its there for them ( once they load the mod) for any scenario or campaign they want to play. I think that's what many will likely want - to be able to load the mod and then get extra camo whatever campaign or scenario they are playing rather than relying on scenario maker having designed it in. But I'm still mulling all this over. I'm really appreciative of your assistance.
  6. The Real Bunc

    [RELEASE] DynamicCamo Script

    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.
  7. The Real Bunc

    using a function to spawn scheduled code

    Thanks Imlay. Thanks for pointing that out. I also note on reading the Function Library page of the Wiki that it says this about the use of the Postinit attribute "the postInit attribute can be set to 1 to call the function upon mission start, after objects are initialized. Passed arguments are ["postInit", didJIP]. The function is run in a scheduled environment so suspension is allowed, but any long term suspension will halt the mission loading until suspension is done." Which is interesting. So, I seem to have two options 1) use the postinit that I already have in my code which will call the function at mission start after objects are initialized or 2) don't use an attribute - n which case I assume the function is not run at all but simply compiled and is then only run (either by call or spawn) when explicitly called on by the coder within a script or init etc. I want to give people two options 1) to have the script run Postinit so its running automatically (on player) whenever they go into any mission/ scenario or campaign and 2) give them the option to only have the function called when they explicitly call it in one of their scripts or a unit ini. Thinking about this Im beginning to doubt that I can do both these things within the one addon. I suspect Im going to have to do one addon which runs automatically and then a second one which isnt run automatically but only runs when called in script or init. Assuming Im understanding the Postinit attribute right of course and that if there is not attribute set the function is simply compiled. Does this sound right? My script/function can be run either on player or AI units though for the latter that wouldn't be automatically but would have to be using a specific script/or init call/spawn by the coder.
  8. The Real Bunc

    using a function to spawn scheduled code

    Ah I see, that's helpful DreadEntity and Larrow. My quest continues armed with your nuggets of gold.
  9. I'm making an addon of a script which isn't actually a function. ie it doesn't just get called, do something and then return. The script contains sleeps, waitUntils and loops which are not allowed within the unscheduled environment of a called function. Is it possible to spawn code from within a function and to pass to that spawned code the parameters from the function call?
  10. The Real Bunc

    Solved -Help with Config please

    Ok solved I think. Apparently, the script file has to be named as follows for some reason fn_dynamicCamo.sqf rather than simply dynamicCamo.sqf. Strange because I had thought Id seen in PBOs where the scripts didn't have fn_ as a prefix in their name.
  11. The Real Bunc

    Solved -Help with Config please

    Solved the douuble slash bt taking the trailing slash out of this part of the config.cpp file="@dynamiccamo\functions\"; // Where my functions are Its still reporting its not finding my function file though. Im stuck now.
  12. The Real Bunc

    Solved -Help with Config please

    trying to trak down what the problem is I looked again at the function viewer. My tag and the name of the function show up in the function viewer. In the function viewer in very feint text below the name of functions it shows the path. Interestingly for other functions there is no \ double slash in the path as there is in the error report I am receiving and in the entry for what should be my function it's also showing the path with a double slash as follows @dynamicCamo\functions\\fn_dynamiccamo1.sqf So clearly something in my config or the construction of my folders is causing Arma to think there is a double slash in my path to the script. Anyone?
  13. I'm working my way towards encapsulating one of my scripts as an addon but am hitting a brick wall with my config and a file not being found. My folder structure is: Arma 3\@dynamicCamo with two subfolders \functions and \Addons in the functions folder I have dynamicCamo1.sqf - the function Im trying to convert to an addon ( currently using a placeholder function till I get the details of how to do this right) I had a look at the Arma 3 Samples Addons - there is one for functions and I adapted that to produce my configs. This is the config.cpp --------------------------------------------------------------------------------------------------------------- /* */ #include "basicDefines_A3.hpp" #include "cfgPatches.hpp" class cfgFunctions { class BNC // tag { class dynamicCamo // This represents a group of functions { file="@dynamiccamo\functions\"; // Where my functions are class dynamicCamo1 {}; // [] call BNC_fnc_dynamiccamo1 description = "dynamic camo for Player when using cover, at night etc" postInit =1 // 1 to call the function upon mission start, after objects are initialized. //Passed arguments are ["postInit"] }; }; }; ------------------------------------------------------------------------------------------ and this is cfgPatches ------------------------------------------------------------------------------------------- class CfgPatches { class DynamicCamo { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {}; }; }; --------------------------------------------------------------------------------- Ive kept it pretty bare bones until I get the basics right. I can pack the files config.cpp and cfgPatches and the function folder into PBO and then I drop that PBO into the @dynamicCamo\addons folder. I can load the packed mod then in launcher but when I go in game I get the message that fn_dynamiccamo.sqf can't be found. I'm struggling to work out what is wrong with the configs or what Im doing wrong. My tag shows up in the functions viewer. Any help or pointers would be appreciated. The EXACT error message Im getting is "Script @dynamicCamo\functions\\fn_dynamicCamo1.sqf can not be found"
  14. Ok Ive solved this. I'm trying to turn one of my functions into a module and I'm following the guidance page in the WIKI at https://community.bistudio.com/wiki/modules Unfortunately, the very first step lacks a little detail. It says to create a folder MYTAG_addonName and then create config.cpp within it. Unfortunately, it omits to say where to create this folder. I assume it's not inside the mission folder (as it wouldn't be available in other edited scenarios) so, should it be in the root ARMA installation folder? Or perhaps in the Addons folder? Somewhere else? Any help would be greatly appreciated as Ive never tried creating a module before.
  15. Solved it. Using Bis_fnc_enemy detected to flip modes worked. I had to put the test for this at the start of the loop to get it to work. Script now plays swinging rifle idle loop animation until enemy detected at whcih point unit engages in contact. When no enemy detected switches back t idel animation. Both switching into and switching out of are now reasonably quick. Refinement will be including a transition animation. ============================================================================= this setBehaviour "SAFE"; 0 = this spawn { waitUntil {time > 0}; _this switchMove "c4coming2cDf_genericstani1"; while {alive _this} do { if (_this call BIS_fnc_enemyDetected) then {_this setbehaviour "AWARE"}; if not(_this call BIS_fnc_enemyDetected) then {_this setbehaviour "SAFE"}; detected = _this call BIS_fnc_enemydetected; behaviour1= behaviour _this; if (toLower (behaviour _this) == "safe") then { waitUntil {animationState _this != "c4coming2cDf_genericstani1"}; _this switchMove "c4coming2cDf_genericstani1"; } else { _this switchMove ""; waitUntil { sleep 1; toLower (behaviour _this) == "AWARE"}; group _this setbehaviourStrong "SAFE"; }; }; };
×