Skip to content

Commit

Permalink
Merge branch 'master' into statics-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rekterakathom authored Feb 18, 2024
2 parents 6174b21 + c82fef8 commit cb75ce2
Show file tree
Hide file tree
Showing 76 changed files with 983 additions and 407 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ end_of_line = lf
[addons/main/LICENSE]
end_of_line = lf

[.github/workflows/main.yml]
[.github/workflows/*.yml]
end_of_line = lf
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
*.md text eol=crlf
*.toml text eol=crlf
*.txt text eol=crlf
*.xml text eol=crlf
*.xml text eol=crlf
*.rhai text eol=crlf
*.inc text eol=crlf
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
33 changes: 21 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
- name: Check for BOM
uses: arma-actions/bom-check@master
- name: .editorconfig Checker
uses: jokoho48/action-editorconfig-checker@main
uses: editorconfig-checker/action-editorconfig-checker@main
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v4
- name: Run Stringtable Checker
run: cd tools/stringtableChecker && npm i &> /dev/null && cd ../../ && node tools/stringtableChecker/stringTableChecker.js
run: cd tools/nodejs_tools && npm i &> /dev/null && cd ../../ && node tools/nodejs_tools/stringTableChecker.js
- name: Check Functions
run: node tools/prepchecker.js
run: node tools/nodejs_tools/prepchecker.js

lint:
runs-on: ubuntu-latest
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Lint (sqflint)
uses: jokoho48/sqflint@master
continue-on-error: true # No failure due to many false-positives
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: 'sqfLint Log'
path: 'sqf.log'
Expand All @@ -47,15 +47,24 @@ jobs:
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: Build addon with HEMTT
uses: arma-actions/hemtt@master
with:
command: 'build --release'
- uses: actions/upload-artifact@master
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup Node tools
run: cd tools/nodejs_tools && npm i &> /dev/null && cd ../../
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Set Build Version
run: node tools/nodejs_tools/gitversionsetter.js
- name: Run HEMTT build
run: hemtt release
- name: Check Hemtt Annotactions
run: node tools/nodejs_tools/hemttchecker.js
- name: Upload Release
uses: actions/upload-artifact@v4
with:
name: '@LambsDanger'
path: 'releases/@LambsDanger*.zip'
path: '.hemttout/release/*'

stringtables:
runs-on: ubuntu-latest
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
release:
types: [published]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Setup HEMTT
uses: arma-actions/hemtt@main
- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup Node tools
run: cd tools/nodejs_tools && npm i &> /dev/null && cd ../../
- name: Set Build Version
run: node tools/nodejs_tools/gitversionsetter.js
- name: Run HEMTT build
run: hemtt release
- run: |
version="${{ github.event.release.tag_name }}"
mv releases/lambs-latest.zip "@LambsDanger_${version//[.]/_}.zip"
- name: Update Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
draft: ${{ github.event.release.unpublished }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./@LambsDanger_*.zip"
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ lint.bat

sqf/*

tools/stringtableChecker/node_modules
tools/nodejs_tools/node_modules

.vscode/

*.sqfc

.hemttout/
14 changes: 14 additions & 0 deletions .hemtt/hooks/pre_release/set_version.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Read the current contents of the mod.cpp
// file from the project source
let version = HEMTT_DIRECTORY
.join("mod.cpp")
.open_file()
.read();
// Replace the placeholder version with the actual version
version.replace("{version}", HEMTT.project().version().to_string_short());
// Write the new contents to the build output
// create_file will overwrite the file if it exists
HEMTT_OUTPUT
.join("mod.cpp")
.create_file()
.write(version);
33 changes: 33 additions & 0 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name = "LAMBS Danger"
prefix = "lambs"
author = "LAMBS Dev Team"
mainprefix = "z"

[version]
path = "addons/main/script_version.hpp"
git_hash = 0

[files]
include = [
"mod.cpp",
"*.paa",
"LICENSE",
"readme.txt",
"readme.md"
]

[hemtt.signing]
authority = "LambsDanger"

[hemtt.release]
folder = "lambs_danger"

[hemtt.launch.default]
workshop = [
"450814997", # CBA_A3's Workshop ID
]

parameters = [
"-world=empty",
"-filePatching",
]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<img src="https://img.shields.io/discord/681656029758488619?color=%237289da&label=Discord&logo=discord&style=flat-square" alt="Lambs Danger Discord">
</a>
<a href="https://github.com/nk3nny/LambsDanger/actions?query=workflow%3AArma">
<img src="https://img.shields.io/github/workflow/status/nk3nny/LambsDanger/Arma/master?logo=github&style=flat-square" alt="Lambs Danger Build Status">
<img src="https://img.shields.io/github/actions/workflow/status/nk3nny/LambsDanger/main.yml?branch=master&logo=github&style=flat-square" alt="Lambs Danger Build Status">
</a>
</p>

Expand Down
18 changes: 12 additions & 6 deletions addons/danger/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ADDON = false;
// mod check
GVAR(Loaded_WP) = isClass (configfile >> "CfgPatches" >> "lambs_wp");

#include "settings.sqf"
#include "settings.inc.sqf"

// FSM priorities ~ this could be made into CBA settings. But I kinda want to explore it a little first - nkenny
if (isNil QGVAR(fsmPriorities)) then {
Expand All @@ -32,18 +32,24 @@ if (isNil QGVAR(dangerUntil)) then {
// EH handling reinforcement and combat mode
[QEGVAR(main,OnInformationShared), {
params [["_unit", objNull], "", ["_target", objNull], ["_groups", []]];

{
private _leader = leader _x;
if (local _leader) then {
// reinforce
if (!isNull _target && { _x getVariable [QGVAR(enableGroupReinforce), false] } && { (_x getVariable [QGVAR(enableGroupReinforceTime), -1]) < time }) then {
if (
!isNull _target
&& {_x getVariable [QGVAR(enableGroupReinforce), false]}
&& {(_x getVariable [QGVAR(enableGroupReinforceTime), -1]) < time }
) then {
[_leader, [getPosASL _unit, (_leader targetKnowledge _target) select 6] select (_leader knowsAbout _target > 1.5)] call FUNC(tacticsReinforce);
};

// set combatMode
if (_leader distance2D _unit < (EGVAR(main,combatShareRange)) && {!(_leader getVariable [QGVAR(disableAI), false])} && {(behaviour _leader) isNotEqualTo "COMBAT"}) then {
[units _x, _target, [_leader, 40, true, true] call EFUNC(main,findBuildings), "information"] call EFUNC(main,doGroupHide);
// reorientate group
if (
!(_leader getVariable [QGVAR(disableAI), false])
&& {(behaviour _leader) isNotEqualTo "COMBAT"}
) then {
//[units _x, _target, [_leader, 40, true, true] call EFUNC(main,findBuildings), "information"] call EFUNC(main,doGroupHide);
_x setFormDir (_leader getDir _unit);
};
};
Expand Down
7 changes: 6 additions & 1 deletion addons/danger/functions/fnc_brainAssess.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ params ["_unit", "", "", ["_target", objNull]];
private _timeout = time + 3;

// check if stopped
if (!(_unit checkAIFeature "PATH")) exitWith {_timeout};
if (
!(_unit checkAIFeature "PATH")
|| {((behaviour _unit)) isEqualTo "STEALTH"}
|| {(currentCommand _unit) isEqualTo "STOP"}
|| {(combatMode _unit) in ["BLUE", "GREEN"]}
) exitWith {_timeout};

// group memory
private _groupMemory = (group _unit) getVariable [QEGVAR(main,groupMemory), []];
Expand Down
10 changes: 7 additions & 3 deletions addons/danger/functions/fnc_brainEngage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ if (
_timeout + 1.4
};

// set low stance
_unit setUnitPosWeak "MIDDLE";

// far, try to suppress
if (
_distance < 500
Expand All @@ -64,11 +67,12 @@ if (
&& {_type isEqualTo DANGER_CANFIRE}
) exitWith {
private _posASL = ATLtoASL (_unit getHideFrom _target);
if (((ASLtoAGL _posASL) select 2) > 6) exitWith {
_timeout + 3
if (((ASLtoAGL _posASL) select 2) > 6) then {
_posASL = ASLtoAGL _posASL;
_posASL set [2, 0.5];
_posASL = AGLToASL _posASL
};
_unit forceSpeed 0;
_unit setUnitPosWeak "MIDDLE";
_unit suppressFor 4;
[_unit, _posASL vectorAdd [0, 0, 0.8], true] call EFUNC(main,doSuppress);
_timeout + 4
Expand Down
Loading

0 comments on commit cb75ce2

Please sign in to comment.