HazJ 1288 Posted February 21, 2019 I personally would use Stacked EachFrame EH for different things. Not split one up. https://community.bistudio.com/wiki/BIS_fnc_addStackedEventHandler Share this post Link to post Share on other sites
gc8 970 Posted February 22, 2019 15 hours ago, Leopard20 said: which one of the three methods mentioned is best for an on each frame code? I wouldn't use waitUntil because no matter how light weight code you put in there it maybe that rest of your scripts steal all the processing time making the waitUntil not run on every frame. So I'd say it's either onEachFrame or Draw3D and I would go with onEachFrame unless there's need to draw something or do something otherwise graphical. Share this post Link to post Share on other sites
HazJ 1288 Posted February 22, 2019 What is it you are using EachFrame for exactly? Just wondering. What code? Share this post Link to post Share on other sites
Leopard20 813 Posted February 22, 2019 4 hours ago, gc8 said: I wouldn't use waitUntil because no matter how light weight code you put in there it maybe that rest of your scripts steal all the processing time making the waitUntil not run on every frame. So I'd say it's either onEachFrame or Draw3D and I would go with onEachFrame unless there's need to draw something or do something otherwise graphical. I don't know. If you don't put sleep in there it works fine enough! 😉 But thanks for the advice. 4 hours ago, HazJ said: What is it you are using EachFrame for exactly? Just wondering. What code? Me? I posted the code and the reason in a few comments back! Share this post Link to post Share on other sites
Dedmen 2589 Posted February 25, 2019 On 2/21/2019 at 7:52 PM, Leopard20 said: So to recap, which one of the three methods mentioned is best for an on each frame code? (in this case, mine, which I have now fully posted!) Well, the waitUntil we can already throw out because it's not each frame. Already told you, you shouldn't be using Draw3D if you are not drawing, so that's also out. So there's only one left. you forgot the addMissionEH EachFrame though, but comparing that to the BIS function is not that easy. The BIS function evaluates the eventhandlers in script, meaning it adds a small script overhead to each execution. The engine one (the command) doesn't do that, however it recompiles the code before every execution. Hard to figure out which one has less overhead. 2 Share this post Link to post Share on other sites
Leopard20 813 Posted February 25, 2019 6 hours ago, Dedmen said: The engine one (the command) doesn't do that, however it recompiles the code before every execution. Does it also have the memory leak bug that you posted on the issue tracker? If so, it's out too IMO! Share this post Link to post Share on other sites
Dedmen 2589 Posted February 26, 2019 14 hours ago, Leopard20 said: Does it also have the memory leak bug that you posted on the issue tracker? If so, it's out too IMO! Yeah. That's the only bonus I see from the scripted eventhandler. No leak. But the leak will be fixed in next Arma update anyway so who cares? 1 Share this post Link to post Share on other sites