Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review request "script_macros_mission.hpp" #142

Closed
Dorbedo opened this issue Aug 29, 2015 · 8 comments
Closed

review request "script_macros_mission.hpp" #142

Dorbedo opened this issue Aug 29, 2015 · 8 comments

Comments

@Dorbedo
Copy link
Contributor

Dorbedo commented Aug 29, 2015

Since Arma Version 1.50 #include '..\parent' is possile.
This results in a posiblillity to make mission modular.
Therefore i'd like to request a review of "script_macros_mission.hpp".

@Killswitch00
Copy link
Contributor

What kind of review? Please explain.

@Dorbedo
Copy link
Contributor Author

Dorbedo commented Oct 11, 2015

I'll try to explain.
In my opinion, at the current state, CBA is removing to much macros.
There is no more need to remove the #define MODULAR.

the compile macros should be changed too:
Since we are already in a mission folder, i think, that we shouldn't use prefix as an folder
This is, in my opinion, the current practice of the most usermade mission
My proposal:
Is: #define PREP(var1) TRIPLES(ADDON,fnc,var1) = compile preProcessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))'
proposal: #define PREP(var1) TRIPLES(ADDON,fnc,var1) = compile preProcessFileLineNumbers 'PATHTO_SYS(COMPONENT_F,functions,DOUBLES(fnc,var1))'

another posibillity:
Is: #define PATHTO_SYS(var1,var2,var3) ##var1\##var2\##var3.sqf
proposal: #define PATHTO_SYS(var1,var2,var3) ##var2\##var3.sqf

@Killswitch00
Copy link
Contributor

Perhaps MODULAR and the related macros could be kept for missions aswell.

Next, the prefix thing. In order to "not use the prefix as a folder", define CUSTOM_FOLDER instead. Taking your first proposal for PREP(), would mean doing this:

// Set PREFIX and COMPONENT as usual
...
...
// Do not use the prefix in the mission folder
#define CUSTOM_FOLDER COMPONENT\functions
#include "\x\cba\addons\main\script_macros_mission.hpp"

We do not know how many missions there are that depend on script_macros_mission.hpp behaving like it currently does with regards to the prefix use in paths, so changing the default behavior is probably not a good idea.

@Dorbedo
Copy link
Contributor Author

Dorbedo commented Oct 11, 2015

Your solution is an easy and a better one. I didn't come up with this myself. My solution was to redefine the macros.

Nevertheless the file sould get an review e.g.:
Line 46 can be removed, since it is redefined under CUSTOM_FOLDER

Maybe the whole ****MODIFIED**** part should be integrated, instead of moved at the end of the file. This could remove the redefinitions.

Some macros could be added too (maybe even in script_macros_common)
#define QGVARMAIN(var1) QUOTE(GVARMAIN(var1))
#define QEGVAR(var1,var2) QUOTE(EGVAR(var1,var2))

shorten: #define EGVAR(var1,var2) DOUBLES(DOUBLES(PREFIX,var1),var2)
into: #define EGVAR(var1,var2) TRIPLES(PREFIX,var1,var2)

@jonpas
Copy link
Member

jonpas commented Oct 11, 2015

We do not know how many missions there are that depend on script_macros_mission.hpp behaving like it currently does with regards to the prefix use in paths, so changing the default behavior is probably not a good idea.

Maybe a new script_macros_mission.hpp can be made if it's worth it then.

@Killswitch00 Killswitch00 modified the milestone: 2.1.2 Oct 11, 2015
@Dorbedo
Copy link
Contributor Author

Dorbedo commented Oct 11, 2015

It would be interesting if there are some A3 missions are using the cba macros.
I must admit, I don't know any.

@jonpas
Copy link
Member

jonpas commented Oct 11, 2015

That never means there aren't any, communities might have in-house ones, they might simply not be published. Either way backwards compatibility must stay.

@Dorbedo
Copy link
Contributor Author

Dorbedo commented Oct 11, 2015

Yes of course. My intention was to get an overview how/which the macros are used and how the missions are structured. This could be useful to decide if an additional version should be made or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants