Skip to content

Commit

Permalink
carry ressource crates
Browse files Browse the repository at this point in the history
  • Loading branch information
Apricot-ale committed Feb 28, 2023
1 parent 7115ddb commit bd6ba4e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Missionframework/functions/fn_addActionsPlayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,19 @@ _player addAction [
"
];

// Drop crate
_player addAction [
["<t color='#FFFF00'>", localize "STR_ACTION_CRATE_DROP", "</t>"] joinString "",
{detach (((attachedObjects player) select {(typeOf _x) in [KPLIB_b_crateSupply, KPLIB_b_crateAmmo, KPLIB_b_crateFuel]}) select 0)},
nil,
-504,
true,
false,
"",
"
alive _originalTarget
&& {build_confirmed isEqualTo 0}
&& {!((((attachedObjects _originalTarget) apply {typeOf _x}) arrayIntersect [KPLIB_b_crateSupply, KPLIB_b_crateAmmo, KPLIB_b_crateFuel]) isEqualTo [])}
"
];
true
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ while {true} do {
_b_action_id2 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_STORE_CRATE" + "</t>",{[(_this select 0), (nearestObjects [player,KPLIB_storageBuildings,20]) select 0,true] call KPLIB_fnc_crateToStorage;},"",-502,true,true,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
_b_action_id3 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_CRATE_VALUE" + "</t>",{[_this select 0] call KPLIB_fnc_checkCrateValue;uiSleep 3; hint "";},"",-503,true,true,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
_b_action_id4 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_CRATE_PUSH" + "</t>",{(_this select 0) setPos ((_this select 0) getPos [1, (player getDir (_this select 0))]);},"",-504,true,false,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
_b_action_id5 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_CRATE_CARRY" + "</t>",{(_this select 0) attachTo [(_this select 1), [0, 2, 1]];},"",-504,true,false,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player) && {(((attachedObjects player) apply {typeOf _x}) arrayIntersect [KPLIB_b_crateSupply, KPLIB_b_crateAmmo, KPLIB_b_crateFuel]) isEqualTo []}"];
_next_box setVariable ["KPLIB_ammo_box_action", _b_action_id1, false];
_next_box setVariable ["KP_crate_store_action", _b_action_id2, false];
_next_box setVariable ["KP_crate_value_action", _b_action_id3, false];
_next_box setVariable ["KP_crate_push_action", _b_action_id4, false];
_next_box setVariable ["KP_crate_carry_action", _b_action_id5, false];
_managed_boxes pushback _next_box;
};

Expand All @@ -75,6 +77,8 @@ while {true} do {
_next_box removeAction (_next_box getVariable ["KP_crate_store_action", -1]);
_next_box removeAction (_next_box getVariable ["KP_crate_value_action", -1]);
_next_box removeAction (_next_box getVariable ["KP_crate_push_action", -1]);
_next_box removeAction (_next_box getVariable ["KP_crate_carry_action", -1]);
_next_box removeAction (_next_box getVariable ["KP_crate_drop_action", -1]);
}
} foreach _managed_boxes;

Expand Down
8 changes: 8 additions & 0 deletions Missionframework/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5178,6 +5178,14 @@
<Korean>-- 군수물품 밀기</Korean>
<Czech>-- TLAČIT KRABICI</Czech>
</Key>
<Key ID="STR_ACTION_CRATE_CARRY">
<Original>-- CARRY CRATE</Original>
<German>-- KISTE TRAGEN</German>
</Key>
<Key ID="STR_ACTION_CRATE_DROP">
<Original>-- DROP CRATE</Original>
<German>-- KISTE ABLEGEN</German>
</Key>
<Key ID="STR_ACTION_SORT_STORAGE">
<Original>-- STACK AND SORT</Original>
<German>-- STAPELN UND SORTIEREN</German>
Expand Down

0 comments on commit bd6ba4e

Please sign in to comment.