Page MenuHomeFeedback Tracker

onEachFrame draws one frame and stops looping
Closed, ResolvedPublic

Description

The behaviour of onEachFrame seems to have changed since the last patch. It does not seem to draw frames continuously like before.

Details

Legacy ID
2095532690
Severity
None
Resolution
Fixed
Reproducibility
Have Not Tried
Category
Scripting
Steps To Reproduce

Reproducible in editor, vanilla Altis mission and also MP hosted PBO.

The repro code below draws a quad bike icon, a diagonal line in front of the player and also KK's frame number hint.

The icon and the line is drawn for a few seconds and then disappears. At the point where the icon and line disappears, the frame number hint freezes.

  • spawn {

onEachFrame {

		_i = getText (configFile >> "CfgVehicles" >> "B_Quadbike_01_F" >> "icon");
		
		_ep0 = position player;
		
		_d = direction player;
		_ep1 = [
			(_ep0 select 0) + 10 * sin _d,
			(_ep0 select 1) + 10 * cos _d,
			(_ep0 select 2) + 1
		];
				
		drawIcon3D [
			_i,
			[1,0,0,1],
			_ep1,
			1,
			1,
			0,
			"should see a quadbike icon here",
			0,
			0.04,
			"PuristaMedium"
		];
		
		_d = (direction player) - 30;
		_ep2 = [
			(_ep0 select 0) + 5 * sin _d,
			(_ep0 select 1) + 5 * cos _d,
			(_ep0 select 2)
		];

		_d = (direction player) + 30;
		_ep3 = [
			(_ep0 select 0) + 5 * sin _d,
			(_ep0 select 1) + 5 * cos _d,
			(_ep0 select 2) + 1
		];

		drawLine3D [_ep2,_ep3,[1,0,0,1]];
		
		hintsilent str diag_frameno;

};
};

Event Timeline

cyckuan edited Steps To Reproduce. (Show Details)Nov 11 2014, 1:06 AM
cyckuan edited Additional Information. (Show Details)
cyckuan set Category to Scripting.
cyckuan set Reproducibility to Have Not Tried.
cyckuan set Severity to None.
cyckuan set Resolution to Fixed.
cyckuan set Legacy ID to 2095532690.May 7 2016, 7:48 PM

Hello.

Could you please provide simple repro steps?
Thank you.

works for me

oneachframe {hintsilent str diag_frameno}

Updated repro works for me no problem.

cyckuan added a subscriber: cyckuan.May 7 2016, 7:48 PM

Hmmm local problem to my machine? I tried the following. The number scrolls then stops.

  • spawn { oneachframe {hintsilent str diag_frameno}; };

You maybe need to verify cache or something.

Verified cache. Still happening. But have confirmed that this is localised. Friend's sessions are not experiencing this. I'll provide more info when I find out local circumstances leading to this.

Please note that OnEachFrame does not stack by itself, is instead overridden.

onEachFrame { hint "Blue"; };
onEachFrame { hint "Red"; };

Would hint Red only. Can you try on a empty/clean mission in editor? Maybe the problem is that your OnEachFrame is being overridden.

Also, if you would like to stack it, see: https://community.bistudio.com/wiki/BIS_fnc_addStackedEventHandler

Yes the reproduction is on a clean new mission in editor. Stacking event handlers is not the answer.

onEachFrame works for me when not running CBA. With CBA it only lasts one frame. My current versions are CBA v1.09 and ArmA3 1.36 stable

It works with CBA when using BIS_fnc_addStackedEventHandler:
["uniqueID", "onEachFrame", { drawIcon3D ["", [1,1,1,0.5], getPos player, 1, 1, 0, format["%1\n%2", "Dreaded", "Entity"]]; }] call BIS_fnc_addStackedEventHandler;

This problem seems to only be an issue if using CBA - confirmed that CBA RC4 breaks onEachFrame.

Seems problem was community addon/mod.
Closing here.