Jump to content
Sign in to follow this  
anfo

setcaptive false on wpn unholster

Recommended Posts

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

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

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

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

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×