Skip to content

Commit

Permalink
Merge pull request #64 from OverlordZorn/CSC-Rework
Browse files Browse the repository at this point in the history
CSC Rework - Merge AirDrop and CSC System
  • Loading branch information
OverlordZorn authored Nov 4, 2024
2 parents 7773955 + d5755ab commit 311c008
Show file tree
Hide file tree
Showing 48 changed files with 1,076 additions and 896 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/merge-version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Merge Version Bump

on:
pull_request:
types:
- closed

permissions:
contents: write

jobs:
if_merged:
name: Post_Merged
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Run HEMTT build
run: hemtt script update_2_patch
- name: Commit to Repo
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "version Bump"
git push
File renamed without changes.
File renamed without changes.
17 changes: 15 additions & 2 deletions .hemtt/launch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ parameters = [
"-noPauseAudio",
]

[Debugger]
extends = "default"
workshop = [
"1645973522", # Intercept Minimal Dev
"1585582292", # Arma Debug Engine
]


[Stratis]
extends = "default"
dlc = ["ws","rf"]
Expand All @@ -23,7 +31,7 @@ mission = "Stratis.Stratis"

[GreenMag]
extends = "Stratis"
workshop = ["2352603233"]
workshop = ["2352603233"] # Greenmag

[executeUnit]
extends = "default"
Expand All @@ -43,4 +51,9 @@ mission = "bigBoom.Altis"

[ula]
extends = "default"
mission = "ULA-Dedicated-MP-Test.stratis"
mission = "ULA-Dedicated-MP-Test.stratis"

[CSC]
# extends = "default"
extends = "default"
mission = "CSC.Altis"
55 changes: 55 additions & 0 deletions .hemtt/missions/CSC.Altis/init.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Author: Zorn
* This is purely an example
*
* Arguments:
*
* Return Value:
* None
*
* Example:
* ['something', player] call cvo_fnc_sth
*
* Public: Yes
*/

// For testing purpose
// ["Test"] call cvo_supplydrop_fnc_register;

/*
params [
["_entryName", "Default", [""] ],
["_items", [], [[]] ],
["_backpacks", [], [] ],
["_hashMap", "404", [createHashMap] ],
["_catName", "global", [""] ]
];
*/



[
"ACE Medical Box", // Name
[
["ace_banana", 69],
["ace_suture", 69],
["ACE_painkillers", 69]
], // Array of Items to be filled into - Default: []
[
// ["somebackpackclassname", 420]
], // Array of Backpacks to be filled into - Default: []
createHashMapFromArray [
["airdrop_pos_start", [10000,10000,1000]],
["box_empty", false],
["box_class", "ACE_medicalSupplyCrate_advanced"],
["airframe_class", "B_T_VTOL_01_vehicle_F"],
["normal_mode", "AIRDROP"],
["airdrop_targetMode", "TARGET"]



] // Hashmap of additional parameters that can be changed optionally
] call cvo_csc_fnc_register;

["B_Slingload_01_Ammo_F", "ACE Medical Box"] call cvo_csc_fnc_link;
[source, "ACE Medical Box"] call cvo_csc_fnc_link;
Binary file added .hemtt/missions/CSC.Altis/mission.sqm
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ let prefix = "#define MINOR ";
let current = HEMTT.project().version().minor();
let next = current + 1;

// Updating minor version should reset patch number
script_version.replace(prefix + current.to_string(), prefix + next.to_string());

// Updating minor version should reset patch number
current = HEMTT.project().version().patch();
script_version.replace("#define PATCH " + current.to_string(), "#define PATCH 0");

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion addons/common/functions/fn_holdaction_tp.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private _completion = {

ace_player allowDamage false;

private _tgtPosASL = getPOSASL _destination;
private _tgtPosASL = getPosASL _destination;
private _tgtDIR = getDir _destination;

// elevates the player 10cm above the tgt to avoid falling through the floor
Expand Down
48 changes: 42 additions & 6 deletions addons/csc/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,49 @@ class CfgFunctions
{
class ADDON // Tag
{
class COMPONENT // Category
class DOUBLES(COMPONENT,old) // Category
{
file = PATH_TO_FUNC;
class createNode {};

file = PATH_TO_FUNC_SUB(old);
class addCSC {};
class spawnCSC {};
};
};

class DOUBLES(COMPONENT,internal) // Category
{
file = PATH_TO_FUNC_SUB(internal);

class preInit { preInit = 1; };

class catalog {};
class getCatName {};

class createAction {};

class request {};
class request_server {};

class getPos {};
class createCrate {};
};

class DOUBLES(COMPONENT,airdrop) // Category
{
file = PATH_TO_FUNC_SUB(airdrop);

class getPosFromMap {};
class dispatch {};
class dropCrate {};

class request_airdrop {};

};

class COMPONENT
{
file = PATH_TO_FUNC;

class defaultEntry {};
class register {};
class link {};
};
};
};
2 changes: 1 addition & 1 deletion addons/csc/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CfgPatches {

// Addon Specific Information
// Minimum compatible version. When the game's version is lower, pop-up warning will appear when launching the game.
requiredVersion = 2.0;
requiredVersion = 2.02;

// Required addons, used for setting load order.
// When any of the addons is missing, pop-up warning will appear when launching the game.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../script_component.hpp"
#include "../../script_component.hpp"

/*
* Author: Zorn
Expand All @@ -12,7 +12,7 @@
* Example:
* ['something', player] call cvo_fnc_sth
*
* Public: Yes
* Public: No
*/

if !(isServer) exitWith {};
Expand All @@ -21,29 +21,29 @@ if !(isServer) exitWith {};

params [
["_entryName", "", [""] ],
["_catName", "", [""] ],
["_targetPos", [0,0,0], [[]], [2,3] ]
];



private _catalog = missionNamespace getVariable [QGVAR(catalog), "404"];
if (_catalog isEqualTo "404") exitWith {ZRN_LOG_MSG(Failed: No Catalog)};
if !(_entryName in _catalog) exitWith {ZRN_LOG_MSG(Failed: No Entry)};
private _cat = [_catName] call FUNC(catalog);
if (_cat isEqualTo "404") exitWith {ZRN_LOG_MSG(Failed: No Catalog)};
if !(_entryName in _cat) exitWith {ZRN_LOG_MSG(Failed: No Entry)};


private _entry = _catalog get _entryName;
private _startPos = _entry get "pos_start";
private _entry = _cat get _entryName;
private _startPos = _entry get "airdrop_pos_start";

_startPos set [2, 0 max (ATLToASL _startPos # 2) + 100];


// Create Aircraft
private _aircraft = createVehicle [(_entry get "class_air"), [0,0,0], [], 0, "FLY"];
private _aircraft = createVehicle [(_entry get "airframe_class"), [0,0,0], [], 0, "FLY"];

_aircraft flyInHeight [_entry get "drop_alt", _entry get "drop_alt_forced"];
_aircraft flyInHeightASL [25, 25, 25];
_aircraft flyInHeight [_entry get "airdrop_alt", _entry get "airdrop_alt_forced"];
_aircraft flyInHeightASL (_entry get "airdrop_flyInHeightASL");

private _grp = (_entry get "side") createVehicleCrew _aircraft;
private _grp = (_entry get "airframe_side") createVehicleCrew _aircraft;
_grp addVehicle _aircraft;
_grp setCombatBehaviour "CARELESS";
_grp deleteGroupWhenEmpty true;
Expand All @@ -57,13 +57,13 @@ private _dir = (_startPos getDir _targetPos);
_aircraft setDir _dir;

// If enabled, make Asset Invincible
if (_entry get "isProtected") then { { _x allowDamage false; } forEach [_aircraft] + crew _aircraft; };
if (_entry get "airframe_protected") then { { _x allowDamage false; } forEach [_aircraft] + crew _aircraft; };

// Provide Waypoints
_grp addWaypoint [_targetPos, 25];
_grp addWaypoint [_targetPos getPos [250, _dir], 25];

private _endpos = _entry get "pos_end";
private _endpos = _entry get "airdrop_pos_end";

_endPos = switch true do {
case (_endPos isEqualTo "RETURN"): { _startPos };
Expand All @@ -79,13 +79,13 @@ _wpEnd setWaypointStatements ["true", "{deleteVehicle _x} forEach [vehicle this]
// PFEH - Drop Crate
private _pfeh_id = [{
params ["_args", "_handle"];
_args params ["_entryName", "_aircraft", "_targetPos"];
_args params ["_entry", "_aircraft", "_targetPos"];

if (( _aircraft distance2D _targetPos ) > 50) exitWith {};
[_entryName, _aircraft] call FUNC(dropCrate);
[_entry, _aircraft] call FUNC(dropCrate);
_handle call CBA_fnc_removePerFrameHandler;

}, _delay, [_entryName, _aircraft, _targetPos]] call CBA_fnc_addPerFrameHandler;
}, _delay, [_entry, _aircraft, _targetPos]] call CBA_fnc_addPerFrameHandler;

// Store PFEH_ID on object to retrieve during EH's
_aircraft setVariable [QGVAR(pfeh_id), _pfeh_id];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../script_component.hpp"
#include "../../script_component.hpp"

/*
* Author: Zorn
Expand All @@ -15,36 +15,29 @@
* Example:
* ['something', player] call cvo_fnc_sth
*
* Public: Yes
* Public: No
*/

#define MIN_ALTITUDE 35

if !(isServer) exitWith {false};

params ["_entryName", "_aircraft"];


private _catalog = missionNamespace getVariable [QGVAR(catalog), "404"];
if (_catalog isEqualTo "404") exitWith {ZRN_LOG_MSG(Failed - No Catalog)};
if !(_entryName in _catalog) exitWith {ZRN_LOG_MSG(Failed - Entry Not Found)};


private _entry = _catalog get _entryName;

private _crateClass = _entry get "class_box";
private _paraClass = _entry get "class_para";


params ["_entry", "_aircraft"];

// private _entry = _catalog get _entryName;

if (_aircraft isEqualTo objNull) exitWith {false};
if (damage _aircraft == 1) exitWith {false};

private _box = createVehicle [_crateClass, [0,0,0]];

// Create Box
private _box = [_entry] call FUNC(createCrate);
if (isNull _box) exitWith {ZRN_LOG_MSG(Failed Creation of BOX);};

private _chute = createVehicle [_paraClass, [0,0,100], [], 0, "CAN_COLLIDE"];

//private _deliveryMode = _entry get "airdrop_deliveryMode";

private _chute = createVehicle [_entry get "parachute_class", [0,0,100], [], 0, "CAN_COLLIDE"];
if (isNull _chute) exitWith {ZRN_LOG_MSG(Failed Creation of CHUTE);};

_aircraft disableCollisionWith _chute;
Expand All @@ -68,27 +61,19 @@ private _spawnPos = if ((_posAircraft # 2 - _offsetTotal) > MIN_ALTITUDE) then {

_chute setPosASL _spawnPos;


[
_box,
_entry get "items",
_entry get "backpacks",
_entry get "emptyBox"
] call ZRN_supplyDrop_fnc_fillCrate;

_box attachTo [_chute, [0,0,0]];


if (_entry get "attachSmoke") then {
private _smoke = createVehicle [_entry get "class_smoke", [0,0,10], [], 0, "CAN_COLLIDE"];
if (_entry get "airdrop_attachSmoke") then {
private _smoke = createVehicle [_entry get "airdrop_class_smoke", [0,0,10], [], 0, "CAN_COLLIDE"];
_smoke attachTo [attachedTo _box, [0,0,0]];
};


if (_entry get "attachStrobe") then {
private _strobe = createVehicle [_entry get "class_strobe", [0,0,10], [], 0, "CAN_COLLIDE"];
if (_entry get "parachute_attachStrobe") then {
private _strobe = createVehicle [_entry get "parachute_strobe_class", [0,0,10], [], 0, "CAN_COLLIDE"];
_strobe attachTo [attachedTo _box, [0,0,32]];
[ { isTouchingGround _this#1 }, { deleteVehicle _this#0 }, [_strobe, _box] ] call CBA_fnc_waitUntilAndExecute;
[ { isTouchingGround (_this#1) }, { deleteVehicle (_this#0) }, [_strobe, _box] ] call CBA_fnc_waitUntilAndExecute;
};

// Detaches the box from the parachute once its close to the ground or deleted
Expand Down
Loading

0 comments on commit 311c008

Please sign in to comment.