mwpowelllde 0 Posted January 4, 2020 Hello, I ran into a curious issue, I have a compiled function our framework is treating like a callback. The context does not really matter, but we pass it _x and we expect an _x to be returned, whatever that _x may be. Anyway, I can verify using the in game debugger that the variable capturing the compileFinal result does have a value and it is correct. However, when we invoke it, we get a nil back. In spite of virtually the first line of the script is, if (true) exitWith {_this select 0}, should return immediately with the first parameter, the _x. But we get nil back. Can this be verified at all? Nature of compileFinal in the A3 engine, possible limits on that? If so, what is our recourse? We could introduce the same callbacks as "simple" ad hoc function variables? Seems like a less robust way of approaching it, more prone to hacks, etc. Someone should probably note this on the compileFinal wiki. Share this post Link to post Share on other sites
mwpowelllde 0 Posted January 4, 2020 So a couple of examples, one returning what we expect, literally, _L, whereas the other returning nothing, nil. This works: _L = ["7e799156-0a6b-18ce-e4a1-096f6e939c62",0,-1,[-1,0,0,0],[[],[0,0,0]],[[],[0,0,0]],[[0,0,0]]]; _args = ["7e799156-0a6b-18ce-e4a1-096f6e939c62",[[7463,1795.1,0],[1000,1000,1000]],[[7922.86,1859.42,0.00143433],[0,0,0]]]; _cache = [["7e799156-0a6b-18ce-e4a1-096f6e939c62",0,-1,[-1,0,0,0],[[],[0,0,0]],[[],[0,0,0]],[[0,0,0]]],["c4cba0a4-735d-568c-453b-764fa0c09670",0,-1,[-1,0,0,0],[[],[0,0,0]],[[],[0,0,0]],[[0,0,0]]],["cd94d761-dd63-2e0a-9305-0ea4f91167ce",0,-1,[-1,0,0,0],[[],[0,0,0]],[[],[0,0,0]],[[0,0,0]]],["6b4cfb84-9afe-f680-ebfe-71ae18917b8f",0,-1,[-1,0,0,0],[[],[0,0,0]],[[],[0,0,0]],[[0,0,0]]],["74fc80fa-2c52-336d-f820-e6e783f1cc4f",0,-1,[-1,0,0,0],[[],[0,0,0]],[[],[0,0,0]],[[0,0,0]]],["30afd71e-e93a-6742-4c66-e61a321a929a",0,-1,[-1,0,0,0],[[],[0,0,0]],[[],[0,0,0]],[[0,0,0]]]]; _cid = 2; _confirm = { if (!isServer) exitWith {}; if (true) exitWith {_this select 0}; }; [_L, _args, _cache, _cid] call _confirm; Whereas, this does not work, // ... _confirm = compile { if (!isServer) exitWith {}; if (true) exitWith {_this select 0}; }; // ^^^^^^^ // ... The only difference between these is that we compile one and do not compile the other. We are experiencing a similar snafu with compileFinal, and we suspect that perhaps we have met a hard ceiling in the A3 engine for supported compiled functions, but we want to confirm this so at least we know what we are dealing with. We are compiling a number of low level API style functions, maybe we should not be doing that quite as much, but we would still like to have some comprehension as to the limitations of the A3 engine. We know, for instance, that there are limitations in the while loop, for instance, under certain conditions, for starters. So it would not surprise us in the least there are limitations around compiled code. Code running "on the server" is it were in a hosted environment, vetted using the debug console. Share this post Link to post Share on other sites
mwpowelllde 0 Posted January 4, 2020 As for repros... Don't know what to tell anyone. Start compiling bunches and bunches of code, and include some baked in tests and see what you get. I don't know hot to quantify that boundary for you, what the constraints might be, etc, however, without knowing more about the A3 compiled code engine. Share this post Link to post Share on other sites
Dedmen 2680 Posted January 4, 2020 31 minutes ago, mwpowelllde said: Whereas, this does not work, well its invalid syntax, so yes. of course it doesn't work. I would recommend you start reading the error messages you get, could've spared you that whole post. 31 minutes ago, mwpowelllde said: The only difference between these is that we compile one and do not compile the other. what? The difference is that one is syntax error and the other is not. 31 minutes ago, mwpowelllde said: and we suspect that perhaps we have met a hard ceiling in the A3 engine for supported compiled functions That doesn't exist, which I already told you 3 times in Discord before you made this forum post. But apparently you don't care about what people tell you. 1 hour ago, mwpowelllde said: I can verify using the in game debugger In game debugger? Arma doesn't have a debugger. The only publicly available debugger is my modded one, which noone uses. 1 Share this post Link to post Share on other sites
mwpowelllde 0 Posted January 4, 2020 I am taking a step back and introducing lines from the script that is breaking down. Not sure that the breakage is, it "compiles", and I have debug console code variable showing for it. But apparently something is breaking down in the actual execution. Not sure what yet. Taking the lines one at a time until something breaks. Share this post Link to post Share on other sites
Lou Montana 101 Posted January 4, 2020 I suggest you read the wiki, and especially https://community.bistudio.com/wiki/compile compile takes a String , which you never provide. 1 1 Share this post Link to post Share on other sites
mwpowelllde 0 Posted January 4, 2020 Hmm, looks like a typo in the script, _x params ["_oldUuid", "_1", "_2", "_3, "_destA", "_destB"]. Although, curious this is "disabled" by a preprocessor guard, #ifdef LOGISTICS_CONFIRM_MISSION_DEBUG/#endif, why is that being evaluated at all? Share this post Link to post Share on other sites
pierremgi 4840 Posted January 5, 2020 10 hours ago, Lou Montana said: I suggest you read the wiki, and especially https://community.bistudio.com/wiki/compile compile takes a String , which you never provide. Well answered @Lou Montana Concise, precise. Share this post Link to post Share on other sites