Jump to content
ShiftyFR

Firing range and scoring

Recommended Posts

Ok, so we already have a list of targets which should not automatically pop up. In your original code, you called them:

_targetList = nearestObjects [(getMarkerPos "fr_init") , ["TargetPopup_ACR"], 1000];

 

From now on, I'm going to refer to this set of targets as: manual_popups

 

Now, I'm going to assume you have a bunch of other targets of type TargetPopup_ACR outside of marker fr_init which we want to automatically pop up after being hit. I'm going to refer to this set of targets as: automatic_popups

 

Now, to do set difference I am going to create a set which contains all targets of type TargetPopup_ACR within your mission (call this set all_popups) and then subtract from this set the manual_popups to get automatic_popups.

 

Basically, we want:

automatic_popups = all_popups - manual_popups

 

Ok, with that out of the way let's get to code you can actually use in your mission:

_manual_popups = nearestObjects [(getMarkerPos "fr_init") , ["TargetPopup_ACR"], 1000];
_all_popups = nearestObjects [(getMarkerPos "fr_init") , ["TargetPopup_ACR"], 20000];
_automatic_popups = _all_popups - manual_popups;

{
    _x addMPEventHandler ["MPHit", {_this execVM "bwi_Func_Pop.sqf";}];

} forEach(_automatic_popups);

bwi_Func_Pop.sqf:

params["_target"];

// Do not want target to pop back up instantly
sleep 5;

_target animate ['terc', 0];

Now, if you have targets 20,000 meters away from marker fr_init, increase the radius as necessary.

 

Note: I have not tested the code above.

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

×