Page MenuHomeFeedback Tracker

Add BIS_fnc_compileFinal function to functions library
Reviewed, WishlistPublic

Description

so if I have written my code

myCode = {

hint "this is my code"

};

in order to lock it with compilefinal i need to edit my script in this manner

myCode = compileFinal "

hint ""this is my code""

";

Fine with one simple function, but what if I have dozens of them and more complex? What if I could just pass the name of my variable to a BIS function and get it all recompiled? Like this:

["myCode"] call BIS_fnc_compileFinal;

For inspiration:

http://killzonekid.com/arma-scripting-tutorials-bis_fnc_compilefinal/

Details

Legacy ID
2396212759
Severity
None
Resolution
Open
Reproducibility
Always
Category
Feature Request
Steps To Reproduce

try to recompile existing code

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Feature Request.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 2396212759.May 7 2016, 3:46 PM
neokika added a subscriber: neokika.May 7 2016, 3:46 PM

That's the idea :)

I'm confused, because CfgFunctions is already implemented in Arma 3 since Alpha. Can you elaborate?

I'm starting to think I misunderstood your comment about using CfgFunctions. What exactly do you mean by it?

He's wondering why you aren't using CfgFunctions to create rewrite protected functions such as that instead of manually compiling them at runtime.

Functions defined in CfgFunctions are compileFinal'd by default and bring plenty of other benefits.

Here is a better link that describes CfgFunctions better than I can: http://community.bistudio.com/wiki/Functions_Library_(Arma_3)

Interesting sections are "Adding a function" in regards to the benefits and "Recompiling". But I suggest reading it all, Karel has recently updated it and it's a very good read.

Because what if my function is in uiNamespace? CfgFunctions as far as I can see all missionNamespace.

Also because you have to define your function in CfgFuntions and then create a separate file for it. I like to have a bunch of functions in one file.

His suggestion is to add the function to have it easily available for everyone.

Addon config functions are available in uiNamespace and missionNamespace as usual. You can call them from parsingNamespace by doing <arguments call (uiNamespace getVariable "functionName");>

Mission functions are available to uiNamespace and parsingNamespace by doing <arguments call (missionNamespace getVariable "functionName");>

As for your preference towards a single file loaded with functions, well that's your thing. :)

No it is not my thing. If I have small function which is three line, I have to define it in CfgFunctions and make a file with it. It makes it somewhat of a chore to alter it. Also CfgFunctions might be available in uiNamespace but they are not available in profileNamespace or parsingNamespace. What if I want my function in one of those?

I don't understand why are you so against it. It is a simple function I have already provided template for. It will only make life easier and allow for greater flexibility. It is very easy to use, 100x easier than stick a function in CfgFuntions. It also allows for backwards compatibility with your existing projects. Instead of spending days moving all your functions to CfgFunctions you can just use the library function on each of them. 10 lines of code or 10 hours of mess?

I'm not "so against it", I'm just trying to explain what neokika meant when he said that you can use CfgFunctions instead.

I'll leave it at that as I don't want to cause more friction in regards to this.