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

Module development #342

Merged
merged 48 commits into from
Jun 10, 2016
Merged

Conversation

Wired-Tiger
Copy link
Contributor

Description:
I've made three modules that basically just pass the information to the taskAttack, taskDefend, and taskPatrol functions. I haven't tested it extensively, but it worked in a dedicated environment and should work with a headless client (I have not tested it with headless, though).

How it works:
Set down the needed module, fill out the information in the module, and then sync it to group leaders plus a trigger if needed. It is that simple.

WIP:
I originally wanted it to have the ability to use scripted units, but I quickly found out that it is not the easiest to do with a module since the information can only be passed as a typename number, bool, or string. I still have not completely given up on it yet, but it is not a priority right now.
Other things still need to be done are:

  • Check code and clean it up where needed
  • Use of macros over hard coding
  • String table needs to be filled out and appropriate macros used
  • XEH scripts set up properly
    I could use help with some of these things because I'm not familiar with these files and coding guidelines.

This is my first pull request ever so please excuse any rookie mistakes I've made.

@@ -0,0 +1 @@
x\cba\addons\modules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline at the end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

};
} forEach _units;
if (count _localUnits == 0) exitWith {};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is select incompatible with Linux builds? Otherwise you can use it here

_localUnits = _units select {local _x};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Select BOOL is, select CODE is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonpas I just want to make sure I am not misunderstanding this. Cuel's suggestion would NOT work on linux builds? Therefore, I should keep the code how it is.

@Wired-Tiger Wired-Tiger force-pushed the moduleDevelopment branch 2 times, most recently from cbbced1 to 5b1a6bf Compare June 2, 2016 01:01
@jokoho48
Copy link
Member

jokoho48 commented Jun 2, 2016

is there any reason why you use param and not params?

_localGroups pushBack _x;
};
} forEach _groups;
if (count _localGroups == 0) exitWith {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_localGroups isEqualTo [] should be faster

requiredAddons[] = {"A3_Modules_F"};
author = "$STR_CBA_Author";
authors[] = {"WiredTiger"};
authorUrl = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change authorUrl to url = "$STR_CBA_URL"; (compare with how it's done in the other CBA addons)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm making the change now. I just took a quick look over everything else and to me it looks good, but is there anything else that needs changed to be in line with CBA standards?

name = "4";
value = 4;
};
class five{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

five{ -> five {

@Killswitch00 Killswitch00 added this to the 2.4.2 milestone Jun 7, 2016

Example:
(begin example)
[1, "player"] call CBA_fnc_getStringPos;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 in the example call is not an object, group, array, marker or an empty string

Function: CBA_fnc_getPosFromString

Description:
A function used to get the position of an item when passed as a string. Designed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate the first sentence (short one-line description) from the rest with an empty line, eg

A function used to...

Designed...

@Killswitch00 Killswitch00 merged commit f5f9462 into CBATeam:master Jun 10, 2016
@Wired-Tiger Wired-Tiger deleted the moduleDevelopment branch June 23, 2016 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants