Home   Help Search Login Register  

Author Topic: library from logic, is that good?  (Read 2518 times)

0 Members and 1 Guest are viewing this topic.

Offline Denisko-Redisko

  • Members
  • *
library from logic, is that good?
« on: 25 Sep 2009, 09:08:20 »
Arma2 brought something new to the script-coding: the library functions defined in the config. The benefit of this method doesn't seem to me obvious.

What good is that the functions belonging to same library are described in separate files?
What good is that the function name and its code are located in different files?
What good is that to a mere coding is added to messing with the config?

For example, I read the script "AddOns\modules\Functions\variables\fn_areEqual.sqf" line 71:
Code: [Select]
_r = [_d1 select _j, _d2 select _j] call BIS_fnc_areEqual;What is BIS_fnc_areEqual? Search doesn't find it! Oh, this is a recursive call! Damn!

Why not simply write:
Code: [Select]
BIS_fnc_areEqual = (
     / / Code
     <argList> call BIS_fnc_areEqual
);
Of course, I mean that this issue should be addressed to the BIS, but I'm asking this also because this method is becoming popular.

Sorry that so emotionally  :confused:
I'm afraid that I just can't see some significant advantages.
sorry for my english

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: library from logic, is that good?
« Reply #1 on: 25 Sep 2009, 12:50:29 »
Tons of functions you will find in modules.pbo.

Unpack the PBO and look in the functions folder inside the resulting modules folder.

Inside the functions folder are 17 other folders, most of which have functions inside.

The folder 'variables' contains the function you mentioned fn_areequal.sqf.

Also inside the modules.pbo check the cfgfunctions.hpp file.


Planck
« Last Edit: 25 Sep 2009, 12:55:52 by Planck »
I know a little about a lot, and a lot about a little.

Offline Trexian

  • Members
  • *
Re: library from logic, is that good?
« Reply #2 on: 25 Sep 2009, 14:38:49 »
I've found AMAZING resources at dev-heaven:
http://dev-heaven.net/repositories/show/cmb

Functions:
http://dev-heaven.net/repositories/browse/cmb/scripts/A2/unformatted/ca/modules/Functions

For the fnc areEqual:
http://dev-heaven.net/repositories/changes/cmb/scripts/A2/unformatted/ca/modules/Functions/variables/fn_areEqual.sqf

It is a bit odd - look on the page for "view" and "download."  Clicking on the links that seem intuitive for me doesn't work. :D
Sic semper tyrannosauro.

Offline Denisko-Redisko

  • Members
  • *
Re: library from logic, is that good?
« Reply #3 on: 26 Sep 2009, 21:08:10 »
Thanks Plank for the answer.
My post isn't about that. All this is good for missionmakers.
But it is also an example to follow. Bad example.
BIS added namespaces, and when I heard about this, I thought - this is so cool. Three. I was shocked. BIS have a good sense of humor. Color TV? What specifically, purple or orange?

Trexian, thanks for the link.
sorry for my english