Jump to content
Sign in to follow this  
M.Evans

Popup target? a little easier than most

Recommended Posts

here is the thing, I just want targets to get shot go down then come back up. No counting no scoring, just targets that pop up. What is the code for this. And from what I have seen they do not do this by themselves.

I am also using the SR5 MOUT script could this be the problem? I changed the parameters in the script and it seemed to keep everything popping up, but when I did the mout course, the targets on the course would pop back up as well. I want it so I have other ranges that are just pop up targets and the Mout course which was the same before I edited the script.

The script

// INITIALIZATION

//if (!isServer) exitWith{};

private ["_MOUTstart","_MOUTend","_MOUTcenter","_MOUTsize","_maxTime","_targets","_MOUTaction01","_MOUTaction02"];

_MOUTstart = _this select 0;

_MOUTend = _this select 1;

_MOUTcenter = getMarkerPos (_this select 2);

_MOUTsize = _this select 3;

_maxTime = _this select 4;

waitUntil {!(isNull _MOUTstart)};

waitUntil {_MOUTstart == _MOUTstart};

nopop = true; // Prevents targets from popping back up (useful for MOUT) this is a PUBLIC variable!

// Acquire targets and put them all down

_targets = nearestObjects [_MOUTcenter, ["targetE","targetTraining","targetEPopup","ACE_Box_Target_1","ACE_Box_Target_2","ACE_Box_Target_3","ACE_Hostage_Target_1","ACE_Hostage_Target_2","ACE_Hostage_Target_3","ACE_Hostage_Target_4","ACE_Hostage_Target_5","ACE_Hostage_Target_6"], _MOUTsize];

{

_x animate ["terc", 1];

} forEach _targets;

// Initalizes the MOUT course as NOT busy

MOUT_busy == 0;

// Adds the action to the MOUT start object

_MOUTaction02 = _MOUTstart addAction ['<t color=#EE8700">'+"Get last results"+'</t>', "scripts\MOUT\MOUT_getlast.sqf];

_MOUTaction01 = _MOUTstart addAction ['<t color="#FF9800">'+"Begin MOUT course"+'</t>', "scripts\MOUT\MOUT_start.sqf", [_MOUTstart,_MOUTend,_MOUTcenter,_MOUTsize,_maxTime], 0, false, true, "",""];

if (true) exitWith{};

It seems like this line here is the problem, but I am not sure how to get around this problem

nopop = true; // Prevents targets from popping back up (useful for MOUT) this is a PUBLIC variable!

any suggestions?

Edited by M.Evans

Share this post


Link to post
Share on other sites

Hi, arent popup targets default objects you can place in the editor?

Empty > Targets

Or ive probably misunderstood.

Share this post


Link to post
Share on other sites

no they are, it is just that this script is ruining every target I put on the map, that one line when set to false for some reason effects every target on the map not just the ones determined by the init.sqf line

nul0 = [MOUT_start,MOUT_end,"MOUT_center",100,265] execVM "scripts\MOUT\MOUT_init.sqf";

100 is the distance in meters and the 265 is the time limit.

I am wondering if the script got messed up somehow.

Share this post


Link to post
Share on other sites

I don't really see the problem.

nopop=true only disables the auto popup.

You then have manual control of them

{_x animate ["terc", 0];} forEach _targets;//  popup

{_x animate ["terc", 1];} forEach _targets;// pop down

Share this post


Link to post
Share on other sites

then why is it telling every single target on the map to lie down after they have been shot, even when they are outside of the MOUT script radius. It should not work that way.

Share this post


Link to post
Share on other sites

It's not telling every object to lie down it's telling them not to pop up.

By default all popup targets and simple targets lie down when shot.

Share this post


Link to post
Share on other sites

is there a way I could edit the script so that only certain targets would be able to be used by the mout script? because If i can do that everything would be good from there on out. and that way the ones that could lie down could lie down and the ones that needed to pop up could pop up.

I think that has to do with this line.

_targets = nearestObjects [_MOUTcenter, ["targetE","targetTraining","targetEPopup","ACE_Box _Target_1","ACE_Box_Target_2","ACE_Box_Target_3"," ACE_Hostage_Target_1","ACE_Hostage_Target_2","ACE_ Hostage_Target_3","ACE_Hostage_Target_4","ACE_Host age_Target_5","ACE_Hostage_Target_6"], _MOUTsize];

Share this post


Link to post
Share on other sites

I haven't used Ace targets so I don't know what default behaviour they have.

It sounds like You want some to popup and some to stay down?

If that's the case then use popup false;

When you shoot a target it stays down until you tell it to get up again.

objectname animate ["terc", 0];// popup

Your better off making an array of the target names rather than types.

That way you make an array of those you want to popup the rest stay down.

I'll try and make some examples tonight.

Share this post


Link to post
Share on other sites

Here's a simple example of three targets behaving differently.

Target action examples

Stay down when shot

Stay up when shot

Pop back up when shot.

All three report when they are Hit.

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  

×