-
Notifications
You must be signed in to change notification settings - Fork 310
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
Functions documentation #669
Comments
That would be great. Aecy. |
TLDR: If you want some documentation ask if you may can work on the wiki. Please don'T bloat up the code - read below why ...
Aside from that: I don't see how even more doc would help this project. If you want a good doc please do it here on the GitHub in the wiki (which is already filed in #645) but don'T bloat up the files any more. See it this way: Most server hosters just download the framework, tweak some stuff they read on some guide and use some tool to pack a PBO. But: There's no compiling happening. All of the source code comments end up in the final mission file, which everyone playin on your server has to download of the rather slow in-game connection. Slimming that down helps way more than bloating it up even more with a lot of doc no player will ever see. I already started to slim down my fork. Why? Cause Tanoa support is an afterthought hack-in mess need to be re-done from scratch. I don'T know enough for do this on my own and don't know anyone else may help me with it - so I can only hope that someone here may is good enough to do it. Hence I just started to scrap it. Why should I deliver lines of codes never get used? That'S not what I want my players to suffer from. Also: It's cool if I have some doc for some to play with or tweak how this all works, but I don't need it in the mission file - so I trim that down, too. |
Ok, I think I will make my fork and provide solid documentation for all the files.
It's completely not developer-friendly. Moreover, Arma 3 is not developer-friendly (where are the debugging option?) and know that I need to find the script to make my modification just simply drop all my conviction to do it. I just give you an example of a portion of code (from the fn_virt_buy.sqf): private ["_type","_price","_amount","_diff","_name","_hideout"];
if ((lbCurSel 2401) isEqualTo -1) exitWith {hint localize "STR_Shop_Virt_Nothing"};
_type = lbData[2401,(lbCurSel 2401)];
_price = lbValue[2401,(lbCurSel 2401)];
_amount = ctrlText 2404;
if (!([_amount] call TON_fnc_isnumber)) exitWith {hint localize "STR_Shop_Virt_NoNum";};
_diff = [_type,parseNumber(_amount),life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
_amount = parseNumber(_amount);
if (_diff <= 0) exitWith {hint localize "STR_NOTF_NoSpace"};
_amount = _diff;
private _altisArray = ["Land_u_Barracks_V2_F","Land_i_Barracks_V2_F"];
private _tanoaArray = ["Land_School_01_F","Land_Warehouse_03_F","Land_House_Small_02_F"];
private _hideoutObjs = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;
_hideout = (nearestObjects[getPosATL player,_hideoutObjs,25]) select 0;
if ((_price * _amount) > CASH && {!isNil "_hideout" && {!isNil {group player getVariable "gang_bank"}} && {(group player getVariable "gang_bank") <= _price * _amount}}) exitWith {hint localize "STR_NOTF_NotEnoughMoney"};
if ((time - life_action_delay) < 0.2) exitWith {hint localize "STR_NOTF_ActionDelay";};
life_action_delay = time; Just by looking at these, where are the lines break? I'm not a computer and a good looking code can be very important for many people. It improves readability and can help the beginner. Maybe you don't care about it, but for beginners or for some people who work on the mission, it's very important. I know some people who want to code, and I tell them to not use any function of the AltisLife Mission, even if some functions are cool because it's completely time-consuming. If I make this issue, it's because you are a team, and it can be considered a general improvement for the mission. |
I don't think you've got a realistic chance to change this really Altis Life is a Framework from back in Arma 2. Almost all of the Code is badly written and outdated - just like the example file you provided. Don't expect massive changes. It hasn't been done since 2012, so it most likely won't be done in 2020 after the game was announces EOL. If Arma 4 comes out, everything will have to be written completely from scratch anyways because of the new engine and new scripting language accompanied by that. So it's now more or less a question of "is it really necessary" more than "it should be done". Yes it should have been done. But it hasn't. Blame that on unexperienced people creating this framework to begin with. Over time many things changed. Things like "terrainSort" or "handleInv" won't bother someone, who has been working with the framework for more than a few days or who's around in some forums. Plus you gotta remember - you don't need to use any Framework Function at all. Want to start learning SQF? Grab some tutorial, get it running and modify it. Most likely no funtions needed. Then you can step forward - working with the framework is experience-ridden, that's just how it is. This is not a NPM package. this is f*ing Arma and not a small project. Many things could be done better, but that's something for the future |
K, feel free, but: For WHO? Just for yourself? Or for the about half-a-handful of poeple try to fix up this framework from it's base than just think about their own server? IDK for how long ArmA3 and AltisLife will be around - and as BlackFish noted: ArmA3 seems to be already planed for EOL (although I wonder as the big 1.2 update was just announced) and there's an ArmA4 already in the planing - with all new scripting. Unless you have a big dev-community who wants to stick to it: Who's gonna read it?
I don'T know about ArmA3 itself - but as for ArmaLife it was never meant to be dev friendly. As said: The original ArmaLife back then for Arma2 was done by only a single person (or if it already was a team back then I guess it was very small) - noone ever had in mind Altis Life would become that popular that it would become the reason for someone (like me) to buy the game just to play this one type of custom mission. And as ArmA2 and ArmA3 share a lot of base code lot was just copy'n'paste from the original ArmA2Life mission instead of a clean re-write from scratch. Would it had been better? For sure it would had been - but there was no need for.
As I said: Then ask for permission and feel free to do what ever you may see fit - but please: DO NOT bloat up the source files. Why a normal player has to download several 100 kB of doc? It all ends up in the mission file - unless you have some automated process to clean it up before "realese". If you have a look at the "maverick" tools from "TheProgrammer" supposed to obfuscated your mission - it adds a whopping 250kB random crap in the leading header just to F* up common PBO tools - and anyone who wants to play such a mission has to download all of those 250kB just so the server owner can have a nice sleep at night without fearing that his custom changes gets stolen. TLDR: Who wants to reverse a PBO and has some time to spare WILL crack it - there even tools to help you.
NO! Bloating up source with doc and comments explain what some line of code does only shows that your code is so bad that it isn't self-explaining anymore. In such case you should re-write the code instead of adding comments to explain it.
Sorry, but no need to spam-copy code - just refernce the file by name we all can look it up ourself. Thanks.
Ok, fair point - but again: IT NEVER WAS MEANT TO!
I'm not part of the team but also just some random player who climbed up the latter two steps - and also be a hobby java programmer for the past 15 years. And sure I also cringe about the lack of documentation - but did you had a look at the BI wiki? It's not better. Just to give YOU an example: Have a look at EventHandlers - you'll find something like: "parameters: X - object, Y - object, Z - object" - ok, then you click on Object to get some information about this datastructure, to see what members it has and what functions you can perform on them - and then you get: "yea, object has some sub-types: A, B and C" - that's it. TLDR: You call yourself a "web-dev" - hm, k, HTML is, by its name, not a programming but rather a markup langauge - just sayin. Without any personal offense - but I think you missed to point why this framework is so bad and why it's heavily being worked on (look at the commit changes for master branch). It's not like your "issue" hasn'T some valid points - but the issue section isn't the right place to discuss this. |
TL;DR: Clear and concise documentation on files that need it is always beneficial, it doesn't matter if not everyone uses it. This is not a place for insults. I agree that documenting some of the functions used within Altis Life would be useful. Although by the looks of it most of your arguments for adding documentation seem to be with structure and flow, things like Perhaps some light documentation is needed, this would preferably be left outside of the mission files themselves for reasons highlighted by others (mission file size bloat etc). However PBO packers exist that can remove comments from the packed files. Regardless, I'm sure a I think to address some of the comment issues (such as the function names) could instead be detailed in a "developer's guide" for Altis Life. This could detail common shortfalls people experience. This could even be handled in the repo's wiki, although i'm not sure if it's possible to give non-contributors access to edit it. @cryptearth
Anyone who reads any documentation when working with code? As a "hobby java programmer for the past 15 years" I'm sure you've read plenty. There's no reason not to.
Any developer should want their code to have a good level of readability. It especially helps with large projects when revisiting older files. Again, as a developer with 15 years experience you should understand this.
The tool in question is not a product on that site. I'm also not sure on what relevance it has to this issue.
web development is not just confined to markup and stylesheets. You had some valid concerns but your approach to conveying them was condescending and frankly rude. This behaviour is not welcome here. This issue highlights that there is a lack of high quality documentation for a lot of functions which people often come to the Discord server to specifically ask about. If someone wants to write some documentation they are more than free to. However, I'm going to close this issue since it has become a drama thread. If anyone wants to create some documentation please do. |
@klmunday
|
If you want another example: Look at PR #668 |
@cryptearth This conversation is going in circles, I'll end on a few remarks
True, however not all pbo packers are equal. There are some that when packing, parse each file and remove comments etc. Something like this would resolve the problem if a server owner found it that much of a problem. Which being honest, most bloat their missions with image files anyway, most missions you see on popular servers are usually 50-70MB. I agree that minimising this as much as possible is good. However it can be done in packaging tools, you could even do it in your own!
I am confident that nearly all if not every file has been edited significantly since the project was published. It has been around 6 years. The language has developed significantly since then and so has the mod.
There's making a point and there's being an arse though. Whilst your points were valid you tainted them by being an arse. Issues like this are intended to be an open discussion and whilst I believe there shouldn't be any politics involved, people should still be courteous. People are capable of disagreeing productively.
I have no intention of "silencing" you. I am merely asking you to conduct yourself in a productive manner.
See the CC - NC license. I do agree that servers shouldn't be able to monetize purely the base content etc. However, that is not a discussion related to this issue.
It's not about being insulting or personal attacks. It's about being respectful in an open discussion. No one's going to take your point seriously if you're being that way. People are free to make issues to discuss future features and things that may be beneficial. People are also free to submit pull requests with their desired changes. We just expect people to be respectful of others. |
Hello,
I have a suggestion to improve a lot your project and I don't understand why you don't make it.
The goal is to make documentation across all the files of the AltisLife mission.
It would help anybody a lot to understand the mission because nobody want to try to understand all the files by analyse the content of the file.
Here is my suggestion:
I hope you will consider this issue. If you need people to make it I can help.
Best regards,
Steez
The text was updated successfully, but these errors were encountered: