anfo 118 Posted September 27, 2016 Hello all Has anybody seen a script resembling if a BLUFOR is initially configured as setcaptive true, but then player changes to setcaptive false if an OPFOR detects a weapon as unholstered or visible? For example BLUFOR are covert (setcaptive true) until such time as the BLUFOR unholster or make visible a weapon in LOS of OPFOR that changes them setcaptive false? Share this post Link to post Share on other sites
theend3r 83 Posted September 27, 2016 currentWeapon combined with some kind of detection script should work. (Although knowsAbout and getHideFrom aren't really ideal for this. You'd need to raytrace the unit/weapon memory point and the enemy's eyes and check if it's unobstructed, which I guess shouldn't be that hard.) Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted September 27, 2016 Why not leave out the detection part? AI won't fire at targets they don't know about anyway. Cheers 1 Share this post Link to post Share on other sites
theend3r 83 Posted September 27, 2016 Why not leave out the detection part? AI won't fire at targets they don't know about anyway. Cheers Sure, but that'd mean that you can kill an enemy squad, throw away your weapon and walk away like it has nothing to do with you. I meant that if both conditions are true then your cover is blown. Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted September 27, 2016 Sure, but that'd mean that you can kill an enemy squad, throw away your weapon and walk away like it has nothing to do with you. I meant that if both conditions are true then your cover is blown. How so? If you pull the weapon, setcaptive turns false. As long as you don't setcaptive true again the AI will shoot you, no matter if armed or not. Cheers Share this post Link to post Share on other sites
theend3r 83 Posted September 27, 2016 How so? If you pull the weapon, setcaptive turns false. As long as you don't setcaptive true again the AI will shoot you, no matter if armed or not. Cheers Yes, that is what I wrote. The detection check is there to permanently blow your cover if you're seen. Share this post Link to post Share on other sites
Tajin 348 Posted September 27, 2016 I agree with Grumpy. Just disable setCaptive once the weapon is out and let the AI do the spotting on their own. Then you'll just have to check if anyone nearby still knows about the player when he holsters his weapon again, to decide wether to enable setCaptive again.. I'd probably combine these two: https://community.bistudio.com/wiki/nearEntities https://community.bistudio.com/wiki/targetKnowledge Share this post Link to post Share on other sites