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

Add addon template and fast recompiling descriptions to wiki #5388

Merged
merged 4 commits into from
Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/wiki/development/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class ACE_Settings {
};
```

#### 1.2.5 Addon template
Addon template is at [extras/blank](https://github.com/acemod/ACE3/tree/master/extras/blank){:target="_blank"} repo directory.

### 1.3 Stringtable
All text that shall be displayed to a user shall be defined in a `stringtable.xml` file for multi-language support.

Expand Down Expand Up @@ -87,6 +90,7 @@ There also exists the `FUNC` family of Macros:
|`EFUNC(leg,face)` | `ace_leg_fnc_face` or the call trace wrapper for that function. |
|`DFUNC(face)` | `ace_balls_fnc_face` and will ALWAYS be the function global variable. |
|`DEFUNC(leg,face)` | `ace_leg_fnc_face` and will ALWAYS be the function global variable. |
|`LINKFUNC(face)` | `FUNC(face)` or "pass by reference" `{_this call FUNC(face)}` |
|`QFUNC(face)` | `"ace_balls_fnc_face"` |
|`QEFUNC(leg,face)` | `"ace_leg_fnc_face"` |
|`QQFUNC(face)` | `""ace_balls_fnc_face""` used inside `QUOTE` macros where double quotation is required. |
Expand All @@ -96,6 +100,8 @@ The `FUNC` and `EFUNC` macros shall NOT be used inside `QUOTE` macros if the int

Using `FUNC` or `EFUNC` inside a `QUOTE` macro is fine if the intention is for it to be executed as a function.

`LINKFUNC` macro allows to recompile function used in event handler code when function cache is disabled. E.G. `player addEventHandler ["Fired", LINKFUNC(firedEH)];` will run updated code after each recompile.

#### 2.1.1 `FUNC` Macros, Call Tracing, and Non-ACE3/Anonymous Functions
ACE3 implements a basic call tracing system that can dump the call stack on errors or wherever you want. To do this the `FUNC` macros in debug mode will expand out to include metadata about the call including line numbers and files. This functionality is automatic with the use of calls via `FUNC` and `EFUNC`, but any calls to other functions need to use the following macros:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class CfgSettings {
#define DISABLE_COMPILE_CACHE
```

All functions with disabled caching can be recompiled with `[] call ACE_PREP_RECOMPILE;` command without mission restart. You can add a addAction/keybind/pfeh with this code and use it for fast recompiling.

### 7.2 Restrictions

Files must exist in the built PBOs for file patching to work. If you create a new file you must rebuild the PBO or Arma will not find it in your file paths.
Expand Down