Page MenuHomeFeedback Tracker

Pop-up targets need script adjustment
Acknowledged, WishlistPublic

Description

It's possible to disable the animated sequence for raising/lowering pop-up targets. Solution is known: this setVariable ["nopop",true,true];

A remaining problem is when you fire at target, target lowers but raises 3 seconds after even if the variable nopop is set to true.

The reason is that the EH of this object is fired and it calls the \training\data\scripts\targetP_Inf_F_Hitparts.sqf (in arma3\addons\structures_F.pbo).

This little script doesn't work as intended when the target is hit, because it ends by an animation raising again the target, instead of let it downed.

This is a problem for each script invoking nopop variable for scheduling all target apparitions with randomized delays. Shooting at them should not lead to an immediate raise (3seconds in fact), but let the scripter decide when this raise occurs.

Details

Legacy ID
1600251894
Severity
None
Resolution
Open
Reproducibility
Always
Category
Config
Steps To Reproduce

Place one or more (more demonstrative) pop-up target(s) via editor.

In init field of each of them add:
this setVariable ["nopop",true,true];

At this time you can have raised or lowered target with:
this animate ["terc",0] (raised); or this animate ["terc",1]; (lowered).
Choose to raise or lower target(s) (raised by default).

preview the mission
Situation of target(s) is stable (no more anim). They are lowered or raised as you chose.

Now, fired at a raised target. This will lower then raise it. Target is animated in its cycle even if nopop is true.

You can't randomize pops-up delay, like at a firing range. The situation is weird with several pop-up targets.

Additional Information

A poor solution is to counter-act the scripted raise of the target in applying a "hit" EH and then manage the sequence:
in init field of target(s):
this setVariable ["nopop",true,true];
this animate ["terc",1];
this setVariable ["nopop",true,true];
this addEventHandler ["hitpart", {

_this spawn {
  waituntil {(_this select 0 select 0) animationPhase "terc" ==1};
  waituntil {(_this select 0 select 0) animationPhase "terc" <1};
 (_this select 0 select 0) animate ["terc",1];

}}];
0 = this spawn {

while {true} do {
  waitUntil {_this animationPhase "terc" >0.5};
  sleep (4 + random 4);
  _this animate ["terc",0];
  waitUntil {_this animationPhase "terc" <0.5};
  sleep (1 + random 1);
  _this animate ["terc",1];
};

};

Note: The Arma's script targetP_Inf_F_Hitparts.sqf fails as the following loop is breaking (after 10000 iterations?):
scopeName "root";
....
if (!isNil "nopop") then
{

		if (nopop) then 
		{
			breakTo "root";	
		};

};
anyway, you could modify the last part of your script, to read:
if (!isNil "nopop") exitwith
{
if !(nopop) then {_target animate ["Terc", 0]};

};

_target animate ["Terc", 0]

Event Timeline

PiepMGI edited Steps To Reproduce. (Show Details)Jan 21 2016, 7:25 PM
PiepMGI edited Additional Information. (Show Details)
PiepMGI set Category to Config.
PiepMGI set Reproducibility to Always.
PiepMGI set Severity to None.
PiepMGI set Resolution to Open.
PiepMGI set Legacy ID to 1600251894.May 8 2016, 1:32 PM
PiepMGI edited a custom field.