smithers282 0 Posted January 22, 2017 (edited) Hi everyone! First thread post so bear with me here for a sec . Concept of the mission I'm making is the players will be members of American resistance to Russian invasion (a la Red Dawn). The script I need help crafting will need to set players as "civilians" when they have no weapons in their hands/on their backs so OPFOR won't immediately shoot on sight, yet as soon as they take weapons out, they again are labeled as threats (BLUFOR) and shot at by the OPFOR. I think I have this part figured out using a script I found on this forum: Quote [ "checkWeapon", "onEachFrame", { if (currentWeapon player != "") then { player setCaptive false; } else { if (currentWeapon player isEqualTo "") then { player setCaptive true; } }; } ] call BIS_fnc_addStackedEventHandler; This works quite well, however I also want to add on top of this a feature where if a player gets within a certain radius of an OPFOR AI, his status as setCaptive true is switched to setCaptive false so the players in my mission cannot abuse their "civilian" status and go into military installations unimpeded. This is the part where I seem to be stuck as all my research on forums has come up dry. I did find austin(medic)'s Combatant Detection script in the compilation thread, but while working flawlessly in SP I am unable to get it to work on my private server. If anyone has suggestions on how to alter his script to work on a server I would love to hear those as well. Thanks for any help yall can give! Edited January 22, 2017 by smithers282 clarification Share this post Link to post Share on other sites
theend3r 83 Posted January 22, 2017 Calling setCaptive on each frame is, imo, stupid. As for your question, it's rather easy no? If you want to check if there is any opfor unit in the vicinity then... check it? while {sleep 1; true} do { _nearUnits = (nearestObjects [player, ["Man"], 50]) select {side _x == east}; if (currentWeapon player != "" || count _nearUnits > 0) then { player setCaptive false; } else { player setCaptive true; }; } Edit: It still doesn't make much sense since you can holster, run away and just come back like nothing happened. You should implement some persistent cover variable, possibly with a timer or the need to change uniforms. Share this post Link to post Share on other sites
smithers282 0 Posted January 22, 2017 How would I go about adding a variable like that? I'm relatively new to Arma scripting so trying to learn as much as I can, but adding something that would require a uniform change would fit my needs perfectly. If someone could point me in the right direction that would be greatly appreciated. Share this post Link to post Share on other sites
theend3r 83 Posted January 22, 2017 You'll just declare a var holding info of whether your cover is blown or not. Like blown = false. Then when you call player setCaptive false, you also call blown = true and prevent going captive until blown = false. Blown will change to false when you hide for long enough or pick up an uniform. As for the uniform thing, can you even pick up uniforms in A3? If you can then https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Take would work, if not then you nedd to do it through addAction. Share this post Link to post Share on other sites
accuracythruvolume 547 Posted January 23, 2017 Look up INCON's undercover script: http://alivemod.com/forum/2486-incon-scripts-for-alive-alpha-soft-release You can even configure the distance at which the enemies wioll spot you. The integrated hints that the system uses to tell you when your cover is good is really handy. Share this post Link to post Share on other sites