From 74235a5362cba4f96c27a78d2f2ffe56168352fb Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 12 May 2018 15:52:33 +0200 Subject: [PATCH 01/13] add cargo when DB loading and create object --- .../core/def/param.hpp | 2 +- .../core/fnc/compile.sqf | 1 + .../core/fnc/db/loadObjectStatus.sqf | 4 +-- .../core/fnc/log/create_s.sqf | 3 +- .../core/fnc/log/init.sqf | 13 ++++++++ =BTC=co@30_Hearts_and_Minds.Altis/mission.sqm | 31 ++++++++++--------- 6 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp index 96d6906ff..5ee423a11 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp @@ -285,6 +285,6 @@ class Params { title = __EVAL(format [" %1", localize "STR_BTC_HAM_PARAM_OTHER_DEBUG"]); values[]={0,1,2}; texts[]={$STR_DISABLED,$STR_ENABLED, $STR_BTC_HAM_PARAM_OTHER_DEBUG_LOGONLY}; // texts[]={"Off","On","Log only"}; - default = 0; + default = 1; }; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf index 9cba3c44f..47ed95a94 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf @@ -146,6 +146,7 @@ if (isServer) then { btc_fnc_log_CuratorObjectPlaced_s = compile preprocessFileLineNumbers "core\fnc\log\CuratorObjectPlaced_s.sqf"; btc_fnc_log_createVehicle = compile preprocessFileLineNumbers "core\fnc\log\createVehicle.sqf"; btc_fnc_log_getRearmMagazines = compile preprocessFileLineNumbers "core\fnc\log\getRearmMagazines.sqf"; + btc_fnc_log_init = compile preprocessFileLineNumbers "core\fnc\log\init.sqf"; //DEAF btc_fnc_deaf_earringing = compile preprocessFileLineNumbers "core\fnc\deaf\earringing.sqf"; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadObjectStatus.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadObjectStatus.sqf index f0620a54e..ca5d6324f 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadObjectStatus.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadObjectStatus.sqf @@ -3,9 +3,6 @@ _object_data params ["_type", "_posWorld", "_dir", "_magClass", "_cargo", "_inve //create object private _obj = _type createVehicle _posWorld; -btc_log_obj_created pushBack _obj; - -btc_curator addCuratorEditableObjects [[_obj], false]; _obj setDir _dir; _obj setPosWorld _posWorld; @@ -13,4 +10,5 @@ _obj setVectorDirAndUp _vectorPos; if !(_magClass isEqualTo "") then {_obj setVariable ["ace_rearm_magazineClass", _magClass, true]}; +[_obj] call btc_fnc_log_init; [_obj, _cargo, _inventory] call btc_fnc_db_loadCargo; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/create_s.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/create_s.sqf index 836e2a7b1..caa310e60 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/create_s.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/create_s.sqf @@ -8,5 +8,4 @@ if (getText (configFile >> "cfgVehicles" >> _obj >> "displayName") isEqualTo "") _obj setVectorUp _vector; _obj setPosASL _pos; -btc_log_obj_created pushBack _obj; -btc_curator addCuratorEditableObjects [[_obj], false]; +[_obj] call btc_fnc_log_init; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf new file mode 100644 index 000000000..e058588d6 --- /dev/null +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf @@ -0,0 +1,13 @@ +params [["_obj", objNull]]; + +btc_log_obj_created pushBack _obj; +btc_curator addCuratorEditableObjects [[_obj], false]; + +private _type = typeOf _obj; +if (_type in btc_log_def_loadable) then { + [format ["setsize has been called %1", _obj], __FILE__, [true, true]] call btc_fnc_debug_message; + [_obj, [_obj] call btc_fnc_log_get_rc] call ace_cargo_fnc_setSize; +}; + + + diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm b/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm index 392b73295..87d56613d 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm +++ b/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm @@ -16,10 +16,10 @@ class EditorData }; class Camera { - pos[]={8264.4326,84.748459,10065.584}; - dir[]={0.89768684,-0.43750682,0.054335855}; - up[]={0.43681347,0.89917308,0.026440112}; - aside[]={0.060424324,1.1197553e-006,-0.99826705}; + pos[]={8262.0459,95.302635,10067.509}; + dir[]={0.86296588,-0.49595729,0.09758871}; + up[]={0.49291119,0.86830187,0.05574134}; + aside[]={0.11238012,1.0727235e-006,-0.99375969}; }; }; binarizationWanted=0; @@ -193,7 +193,7 @@ class CustomAttributes name="Multiplayer"; class Attribute0 { - property="RespawnButton"; + property="RespawnTemplates"; expression="true"; class Value { @@ -203,16 +203,15 @@ class CustomAttributes { type[]= { - "SCALAR" + "ARRAY" }; }; - value=1; }; }; }; class Attribute1 { - property="RespawnTemplates"; + property="RespawnButton"; expression="true"; class Value { @@ -222,9 +221,10 @@ class CustomAttributes { type[]= { - "ARRAY" + "SCALAR" }; }; + value=1; }; }; }; @@ -467,7 +467,7 @@ class CustomAttributes "BOOL" }; }; - value=0; + value=1; }; }; class Item1 @@ -626,7 +626,7 @@ class Mission dataType="Marker"; position[]={8323.1348,73.933266,10113.239}; name="btc_log_point"; - text=$STR_BTC_HAM_MSQM_MRK_LOGPOINT; + text="Logistic Point"; type="mil_flag"; colorName="ColorGreen"; a=0.5; @@ -845,7 +845,7 @@ class Mission { skill=0.60000002; init="this setVariable [""side_mission"",true]"; - description=$STR_BTC_HAM_MSQM_OFFICER; + description="Officer"; isPlayer=1; isPlayable=1; }; @@ -879,7 +879,7 @@ class Mission { skill=0.60000002; init="this setVariable [""interpreter"",true]"; - description=$STR_BTC_HAM_MSQM_INTERPRETER; + description="Interpreter"; isPlayable=1; }; id=29; @@ -913,7 +913,7 @@ class Mission class Attributes { skill=0.60000002; - description=$STR_ACE_Repair_AssignEngineerRole_role_advanced; + description="Adv. Engineer"; isPlayable=1; }; id=31; @@ -2164,7 +2164,7 @@ class Mission class PositionInfo { position[]={8295.166,78.402695,10052.533}; - angles[]={-0,5.7184839,0}; + angles[]={0,5.7184839,0}; }; side="Empty"; flags=4; @@ -2176,6 +2176,7 @@ class Mission }; id=170; type="B_APC_Wheeled_01_cannon_F"; + atlOffset=-0.076683044; class CustomAttributes { class Attribute0 From b4e7a01df9b6f956df73751381a3777ae2bfd34f Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 12 May 2018 16:16:02 +0200 Subject: [PATCH 02/13] Add log_init to handle objects not handle by ace automatically --- .../core/def/mission.sqf | 1 - .../core/fnc/log/init.sqf | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf index 87a6ba685..03f771b84 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -354,7 +354,6 @@ if (isServer) then { }; private _c_array = btc_construction_array select 1; -btc_log_def_draggable = (_c_array select 1) + (_c_array select 2); btc_log_def_loadable = (_c_array select 0) + (_c_array select 1) + (_c_array select 2) + (_c_array select 3) + (_c_array select 4) + (_c_array select 5) + (_c_array select 6) + ["ace_rearm_defaultCarriedObject", "ace_rearm_Bo_Mk82", "ace_rearm_Bomb_04_F", "ace_rearm_Bo_GBU12_LGB", "ace_rearm_Bomb_03_F", "ace_rearm_Missile_AA_03_F", "ace_rearm_Missile_AGM_02_F", "ace_rearm_Missile_AGM_01_F", "ace_rearm_Rocket_03_AP_F", "ace_rearm_R_80mm_HE", "ace_rearm_R_60mm_HE", "ace_rearm_Rocket_04_HE_F", "ace_rearm_R_Hydra_HE", "ace_rearm_Missile_AA_04_F", "ace_rearm_M_PG_AT", "ace_rearm_R_230mm_HE", "ace_rearm_Rocket_03_HE_F", "ace_rearm_Rocket_04_AP_F", "ace_rearm_R_230mm_fly"]; btc_log_def_can_load = (_c_array select 3); btc_log_def_placeable = (_c_array select 0) + (_c_array select 3) + (_c_array select 4) + (_c_array select 5); diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf index e058588d6..cd57a300e 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf @@ -4,10 +4,18 @@ btc_log_obj_created pushBack _obj; btc_curator addCuratorEditableObjects [[_obj], false]; private _type = typeOf _obj; -if (_type in btc_log_def_loadable) then { - [format ["setsize has been called %1", _obj], __FILE__, [true, true]] call btc_fnc_debug_message; - [_obj, [_obj] call btc_fnc_log_get_rc] call ace_cargo_fnc_setSize; -}; +if (_type in btc_log_def_loadable && {getNumber (configFile >> "CfgVehicles" >> _type >> "ace_cargo_canLoad") isEqualTo 0}) then { + [_obj, [_obj] call btc_fnc_log_get_rc] call ace_cargo_fnc_setSize; + if (btc_debug_log) then { + [format ["ace_cargo_fnc_setSize to %1", _obj], __FILE__, [false]] call btc_fnc_debug_message; + }; +}; +if (_type in btc_log_def_can_load && {getNumber (configFile >> "CfgVehicles" >> _type >> "ace_cargo_hasCargo") isEqualTo 0}) then { + [_obj, [_obj] call btc_fnc_log_get_cc] call ace_cargo_fnc_setSpace; + if (btc_debug_log) then { + [format ["ace_cargo_fnc_setSpace to %1", _obj], __FILE__, [false]] call btc_fnc_debug_message; + }; +}; From 25e09e060963e40caf4f71b62d50373839dbedbb Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 12 May 2018 17:14:57 +0200 Subject: [PATCH 03/13] rmv old function --- .../core/fnc/compile.sqf | 8 --- .../core/fnc/db/loadcargo.sqf | 2 +- .../core/fnc/eh/veh_init.sqf | 8 --- .../core/fnc/int/add_actions.sqf | 6 --- .../core/fnc/log/check_cargo.sqf | 38 -------------- .../core/fnc/log/check_cc.sqf | 7 --- .../core/fnc/log/load.sqf | 45 ---------------- .../core/fnc/log/obj_fall.sqf | 16 ------ .../core/fnc/log/paradrop.sqf | 45 ---------------- .../core/fnc/log/select.sqf | 10 ---- .../core/fnc/log/server_unload.sqf | 52 ------------------- .../core/fnc/log/unload.sqf | 31 ----------- 12 files changed, 1 insertion(+), 267 deletions(-) delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/check_cargo.sqf delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/check_cc.sqf delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/load.sqf delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/obj_fall.sqf delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paradrop.sqf delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/select.sqf delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_unload.sqf delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/unload.sqf diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf index 47ed95a94..bf6419ae1 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf @@ -188,8 +188,6 @@ btc_fnc_int_ask_var = compile preprocessFileLineNumbers "core\fnc\int\ask_var.sq //LOG btc_fnc_log_can_tow = compile preprocessFileLineNumbers "core\fnc\log\can_tow.sqf"; -btc_fnc_log_check_cargo = compile preprocessFileLineNumbers "core\fnc\log\check_cargo.sqf"; -btc_fnc_log_check_cc = compile preprocessFileLineNumbers "core\fnc\log\check_cc.sqf"; btc_fnc_log_create = compile preprocessFileLineNumbers "core\fnc\log\create.sqf"; btc_fnc_log_create_apply = compile preprocessFileLineNumbers "core\fnc\log\create_apply.sqf"; btc_fnc_log_create_load = compile preprocessFileLineNumbers "core\fnc\log\create_load.sqf"; @@ -205,21 +203,15 @@ btc_fnc_log_lift_hud = compile preprocessFileLineNumbers "core\fnc\log\lift_hud. btc_fnc_log_lift_hud_loop = compile preprocessFileLineNumbers "core\fnc\log\lift_hud_loop.sqf"; btc_fnc_log_get_cc = compile preprocessFileLineNumbers "core\fnc\log\get_cc.sqf"; btc_fnc_log_get_rc = compile preprocessFileLineNumbers "core\fnc\log\get_rc.sqf"; -btc_fnc_log_load = compile preprocessFileLineNumbers "core\fnc\log\load.sqf"; -btc_fnc_log_obj_fall = compile preprocessFileLineNumbers "core\fnc\log\obj_fall.sqf"; -btc_fnc_log_paradrop = compile preprocessFileLineNumbers "core\fnc\log\paradrop.sqf"; btc_fnc_log_place = compile preprocessFileLineNumbers "core\fnc\log\place.sqf"; btc_fnc_log_place_create_camera = compile preprocessFileLineNumbers "core\fnc\log\place_create_camera.sqf"; btc_fnc_log_place_destroy_camera = compile preprocessFileLineNumbers "core\fnc\log\place_destroy_camera.sqf"; btc_fnc_log_place_key_down = compile preprocessFileLineNumbers "core\fnc\log\place_key_down.sqf"; btc_fnc_log_repair_wreck = compile preprocessFileLineNumbers "core\fnc\log\repair_wreck.sqf"; -btc_fnc_log_select = compile preprocessFileLineNumbers "core\fnc\log\select.sqf"; btc_fnc_log_server_load = compile preprocessFileLineNumbers "core\fnc\log\server_load.sqf"; btc_fnc_log_server_repair_wreck = compile preprocessFileLineNumbers "core\fnc\log\server_repair_wreck.sqf"; -btc_fnc_log_server_unload = compile preprocessFileLineNumbers "core\fnc\log\server_unload.sqf"; btc_fnc_log_tow = compile preprocessFileLineNumbers "core\fnc\log\tow.sqf"; btc_fnc_log_unhook = compile preprocessFileLineNumbers "core\fnc\log\unhook.sqf"; -btc_fnc_log_unload = compile preprocessFileLineNumbers "core\fnc\log\unload.sqf"; btc_fnc_log_copy = compile preprocessFileLineNumbers "core\fnc\log\copy.sqf"; btc_fnc_log_paste = compile preprocessFileLineNumbers "core\fnc\log\paste.sqf"; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf index 2c9310e35..95cb6d1c0 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf @@ -34,7 +34,7 @@ params ["_obj", "_cargo", "_inventory"]; _l addItemCargoGlobal [(_items_obj select 0) select _i, (_items_obj select 1) select _i]; }; }; - [_l, _obj] call btc_fnc_log_server_load; + [_l, _obj] call ace_cargo_fnc_loadItem; } forEach _cargo; //set inventory content for weapons, magazines and items diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/veh_init.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/veh_init.sqf index 043764bcf..b47ac7c82 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/veh_init.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/veh_init.sqf @@ -27,10 +27,6 @@ switch true do { _action = ["check_cargo", localize "STR_BTC_HAM_ACTION_LOGISTIC_CHECKCARGO", "\A3\ui_f\data\igui\cfg\simpleTasks\types\search_ca.paa", {(_this select 0) spawn btc_fnc_log_check_cargo;}, {true}] call ace_interact_menu_fnc_createAction; //Check Cargo //Outside Vehicle [_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass; //Logistic - //Inside Vehicle - [_type, 1, ["ACE_SelfActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; - _action = ["Load_selected", localize "STR_BTC_HAM_ACTION_LOGISTIC_LOADSEL", "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", {(_this select 0) spawn btc_fnc_log_load;}, {!isNull btc_log_object_selected && {btc_log_object_selected distance (_this select 0) <= btc_log_max_distance_load}}] call ace_interact_menu_fnc_createAction; //Load selected - [_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass; //Logistic }; case (_type isKindOf "Helicopter") : { private _action = ["Logistic", localize "STR_BTC_HAM_ACTION_LOC_MAIN", "\A3\ui_f\data\igui\cfg\simpleTasks\letters\L_ca.paa", {}, {true}] call ace_interact_menu_fnc_createAction; //Logistic @@ -39,10 +35,6 @@ switch true do { _action = ["check_cargo", localize "STR_BTC_HAM_ACTION_LOGISTIC_CHECKCARGO", "\A3\ui_f\data\igui\cfg\simpleTasks\types\search_ca.paa", {(_this select 0) spawn btc_fnc_log_check_cargo;}, {true}] call ace_interact_menu_fnc_createAction; //Check Cargo //Outside Vehicle [_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass; //Logistic - //Inside Vehicle - [_type, 1, ["ACE_SelfActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; - _action = ["Load_selected", localize "STR_BTC_HAM_ACTION_LOGISTIC_LOADSEL", "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", {(_this select 0) spawn btc_fnc_log_load;}, {!isNull btc_log_object_selected && {btc_log_object_selected distance (_this select 0) <= btc_log_max_distance_load}}] call ace_interact_menu_fnc_createAction; //Load selected - [_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass; //Logistic //Lift _action = ["Deploy_ropes", localize "STR_BTC_HAM_ACTION_VEHINIT_DEPLOYROPES", "\A3\ui_f\data\igui\cfg\simpleTasks\types\container_ca.paa", {[] spawn btc_fnc_log_lift_deploy_ropes;}, {!btc_ropes_deployed && {(driver vehicle player) isEqualTo player} && {(getposATL player) select 2 > 4}}] call ace_interact_menu_fnc_createAction; //Deploy ropes [_type, 1, ["ACE_SelfActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/add_actions.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/add_actions.sqf index b4d85903d..b007f9e49 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/add_actions.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/add_actions.sqf @@ -33,12 +33,6 @@ _action = ["Paste", localize "STR_BTC_HAM_ACTION_COPYPASTE_PASTE", "\A3\ui_f\dat //Logistic _action = ["Logistic", localize "STR_BTC_HAM_ACTION_LOC_MAIN", "\A3\ui_f\data\igui\cfg\simpleTasks\letters\L_ca.paa", {}, {true}] call ace_interact_menu_fnc_createAction; {[_x, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToClass;} forEach btc_log_def_loadable; -_action = ["Load_in", localize "STR_BTC_HAM_ACTION_LOGISTIC_LOADIN", "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", {(_this select 0) call btc_fnc_log_select;}, {true}] call ace_interact_menu_fnc_createAction; -{[_x, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;} forEach btc_log_def_loadable; -_action = ["Load_selected", localize "STR_BTC_HAM_ACTION_LOGISTIC_LOADSEL", "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", {(_this select 0) spawn btc_fnc_log_load;}, {!isNull btc_log_object_selected && {btc_log_object_selected distance (_this select 0) <= btc_log_max_distance_load}}] call ace_interact_menu_fnc_createAction; -{[_x, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;} forEach btc_log_def_can_load; -_action = ["check_cargo", localize "STR_BTC_HAM_ACTION_LOGISTIC_CHECKCARGO", "\A3\ui_f\data\igui\cfg\simpleTasks\types\search_ca.paa", {(_this select 0) spawn btc_fnc_log_check_cargo;}, {true}] call ace_interact_menu_fnc_createAction; -{[_x, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;} forEach btc_log_def_can_load; //FOB _action = ["Mount_FOB", localize "STR_BTC_HAM_ACTION_FOB_MOUNT", "\A3\Ui_f\data\Map\Markers\NATO\b_hq.paa", {(_this select 0) spawn btc_fnc_fob_create}, {true}] call ace_interact_menu_fnc_createAction; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/check_cargo.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/check_cargo.sqf deleted file mode 100644 index 2c687c9c5..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/check_cargo.sqf +++ /dev/null @@ -1,38 +0,0 @@ -params ["_veh"]; - -if (isNull _veh) exitWith {}; - -btc_log_veh_selected = _veh; - -btc_int_ask_data = nil; -[3, _veh] remoteExecCall ["btc_fnc_int_ask_var", 2]; - -waitUntil {!(isNil "btc_int_ask_data")}; -closeDialog 0; -disableSerialization; -createDialog "btc_log_dlg"; - -waitUntil {Dialog}; - -private _ui = uiNamespace getVariable "btc_log_dlg"; - -private _cargo = btc_int_ask_data; -private _text = format [localize "STR_BTC_HAM_LOG_CHECKC_VEHICLE", getText (configFile >> "cfgVehicles" >> typeOf _veh >> "displayName"), [_veh, _cargo] call btc_fnc_log_check_cc, [_veh] call btc_fnc_log_get_cc]; //Vehicle: %1 | CC: %2/%3 - -(_ui displayCtrl 990) ctrlSetText _text; - -{ - private _displayName = getText (configFile >> "cfgVehicles" >> typeOf _x >> "displayName"); - if (_displayName isEqualTo "ace_rearm_dummy_obj") then { - _displayName = getText (configFile >> "CfgMagazines" >> (_x getVariable "ace_rearm_magazineClass") >> "displayName"); - }; - private _index = lbAdd [991, _displayName]; - lbSetData [991, _index, typeOf _x]; - lbSetTooltip [991, _index, _displayName]; -} forEach _cargo; - -lbSetCurSel [991, 0]; - -waitUntil {!Dialog}; - -btc_log_veh_selected = objNull; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/check_cc.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/check_cc.sqf deleted file mode 100644 index 4208154f1..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/check_cc.sqf +++ /dev/null @@ -1,7 +0,0 @@ -params ["_veh", "_cargo"]; - -private _tot_rc = 0; -{ - _tot_rc = _tot_rc + ([_x] call btc_fnc_log_get_rc); -} forEach _cargo; -_tot_rc diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/load.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/load.sqf deleted file mode 100644 index 49d6f019f..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/load.sqf +++ /dev/null @@ -1,45 +0,0 @@ -params ["_veh"]; - -private _veh_name = getText (configFile >> "cfgVehicles" >> typeOf _veh >> "displayName"); -private _obj_name = getText (configFile >> "cfgVehicles" >> typeOf btc_log_object_selected >> "displayName"); -if (_obj_name isEqualTo "ace_rearm_dummy_obj") then { - _obj_name = getText (configFile >> "CfgMagazines" >> (btc_log_object_selected getVariable "ace_rearm_magazineClass") >> "displayName"); -}; - -if (btc_log_object_selected distance _veh > btc_log_max_distance_load) exitWith { - hint format [localize "STR_BTC_HAM_LOG_LOAD_TOOFAR", _veh_name, _obj_name]; -}; -if (speed _veh > 3) exitWith { - hint format [localize "STR_BTC_HAM_LOG_LOAD_TOOFAST", _veh_name]; -}; - -private _rc = [btc_log_object_selected] call btc_fnc_log_get_rc; -private _cc = [_veh] call btc_fnc_log_get_cc; - -if (_rc > _cc) exitWith {hint format [localize "STR_BTC_HAM_LOG_LOAD_TOOBIG", _obj_name, _veh_name];}; - -btc_int_ask_data = nil; -[3, _veh] remoteExecCall ["btc_fnc_int_ask_var", 2]; - -waitUntil {!(isNil "btc_int_ask_data")}; - -private _cargo = btc_int_ask_data; - -private _rc_tot = [_veh, _cargo] call btc_fnc_log_check_cc; - -if ((_rc_tot + _rc) > _cc) exitWith {hint format [localize "STR_BTC_HAM_LOG_LOAD_NOSPACE", _obj_name, _veh_name];}; - -private _onFinish = { - params ["_args"]; - _args params ["_veh", "_player", "_obj_name", "_veh_name"]; - - [btc_log_object_selected, _veh] remoteExec ["btc_fnc_log_server_load", 2]; - hint format [localize "STR_BTC_HAM_LOG_LOAD_FIN", _obj_name, _veh_name]; - btc_log_object_selected = objNull; -}; -private _onFail = { - hint localize "STR_BTC_HAM_LOG_LOAD_ABORT"; - btc_log_object_selected = objNull; -}; - -[5, [_veh, player, _obj_name, _veh_name], _onFinish, _onFail, format [localize "STR_BTC_HAM_LOG_LOAD_BAR", _obj_name, _veh_name]] call btc_fnc_int_action_result; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/obj_fall.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/obj_fall.sqf deleted file mode 100644 index 42168df21..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/obj_fall.sqf +++ /dev/null @@ -1,16 +0,0 @@ -params ["_obj"]; - -(getPos _obj) params ["_x", "_y", "_z"]; -private _fall = createVehicle ["Box_T_NATO_WpsSpecial_F", [_x, _y, _z + 0.7], [], 0, "FLY"]; -_fall setDir getDir _obj; -_fall setPosASL getPosASL _obj; -_fall setObjectTextureGlobal [0, ""]; -_fall setObjectTextureGlobal [1, ""]; -_obj attachTo [_fall, [0, 0, abs(((_obj modelToWorld [0, 0, 0]) select 2) - ((_fall modelToWorld [0, 0, 0]) select 2))]]; - -sleep 0.1; - -waitUntil {(velocity _fall select 2) isEqualTo 0}; - -detach _obj; -deleteVehicle _fall; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paradrop.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paradrop.sqf deleted file mode 100644 index 5ace737ac..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paradrop.sqf +++ /dev/null @@ -1,45 +0,0 @@ -params ["_veh", "_dropped", "_chute_type"]; - -private _type_dropped = typeOf _dropped; -private _offset = [0, -(sizeOf typeOf _veh + sizeOf _type_dropped)/2, -5]; - -_dropped disableCollisionWith _veh; -_dropped setPos (_veh modelToWorld _offset); - -sleep 0.1; - -waitUntil {_dropped distance _veh > 50}; - -_dropped enableCollisionWith _veh; - -(getPosATL _dropped) params ["_x", "_y", "_z"]; -private _chute = createVehicle [_chute_type, [_x, _y, _z + 5], [], 0, "FLY"]; -{_chute disableCollisionWith _x;} forEach [_veh, _dropped]; - -_chute setPosATL getPosATL _dropped; -private _smoke = "SmokeshellGreen" createVehicle [0, 0, 0]; -private _chem = "Chemlight_green" createVehicle [0, 0, 0]; -_smoke attachto [_dropped, [0, 0, 0]]; -_chem attachto [_dropped, [0, 0, 0]]; -_dropped attachTo [_chute, [0, 0, -0.6]]; - -sleep 1; - -if ((velocity _dropped select 2) > -2) then { - detach _dropped; - deleteVehicle _chute; - (getPosATL _dropped) params ["_x", "_y", "_z"]; - _chute = createVehicle [_chute_type, [_x, _y, _z + 5], [], 0, "CAN_COLLIDE"]; - {_chute disableCollisionWith _x;} forEach [_veh, _dropped]; - - _dropped attachTo [_chute, [0, 0, 0]]; -}; - -private _pos = getPosASL _chute; -waitUntil { - _pos = getPosASL _chute; - sleep 1; - (_chute isEqualTo objNull) -}; -detach _dropped; -_dropped setPosASL _pos; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/select.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/select.sqf deleted file mode 100644 index fd1ef4cbb..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/select.sqf +++ /dev/null @@ -1,10 +0,0 @@ -params ["_object_selected"]; - -btc_log_object_selected = _object_selected; - -private _displayName = getText (configFile >> "cfgVehicles" >> typeOf btc_log_object_selected >> "displayName"); -if (_displayName isEqualTo "ace_rearm_dummy_obj") then { - _displayName = getText (configFile >> "CfgMagazines" >> (btc_log_object_selected getVariable "ace_rearm_magazineClass") >> "displayName"); -}; - -hint parseText format [localize "STR_BTC_HAM_LOG_SEL_HINT", _displayName, [btc_log_object_selected] call btc_fnc_log_get_rc]; //%1 selected
CR: %2
Interact with a vehicle to load it in! diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_unload.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_unload.sqf deleted file mode 100644 index 40042b56d..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_unload.sqf +++ /dev/null @@ -1,52 +0,0 @@ -params ["_obj_type", "_veh"]; - -private _obj = objNull; -private _cargo = _veh getVariable ["cargo", []]; -private _found = false; - -{ - if (!_found) then { - if (typeOf _x isEqualTo _obj_type) then { - _obj = _x; - _found = true; - }; - }; -} forEach _cargo; - -if (isNull _obj) exitWith {hint "null";}; - -_cargo = _cargo - [_obj]; -_veh setVariable ["cargo", _cargo]; -_obj setVariable ["loaded", nil]; - - -_obj hideObjectGlobal false; - -private _height = getPos _veh select 2; - -deTach _obj; -_obj attachTo [_veh, [0, - (sizeOf typeOf _veh + sizeOf _obj_type)/2, -0.2]]; -sleep 0.1; -deTach _obj; -_obj allowDamage false; - -switch (true) do { - case (_height >= 20): { - [_veh, _obj, "B_Parachute_02_F"] spawn btc_fnc_log_paradrop; - }; - case ((_height < 20) && (_height >= 2)): { - (getPos _veh) params ["_x", "_y", "_z"]; - _obj setPos [_x, _y, _z -1]; - sleep 0.1; - [_obj] spawn btc_fnc_log_obj_fall; - }; - case (_height < 2): { - [_obj] call btc_fnc_log_obj_fall; - }; -}; - -_obj allowDamage true; - -_cargo = _veh getVariable "cargo"; -_cargo = _cargo - [_obj]; -_veh setVariable ["cargo", _cargo]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/unload.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/unload.sqf deleted file mode 100644 index 63b5681bc..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/unload.sqf +++ /dev/null @@ -1,31 +0,0 @@ - -if (!Dialog) exitWith {}; - -private _obj_type = lbData [991, lbCurSel 991]; - -private _veh = btc_log_veh_selected; - -closeDialog 0; - -private _obj_name = getText (configFile >> "cfgVehicles" >> _obj_type >> "displayName"); -if (_obj_name isEqualTo "ace_rearm_dummy_obj") then { - _obj_name = "Ammo"; -}; - -private _totalTime = 5; -if (vehicle player != player && {_veh isKindOf "Air"}) then { - _totalTime = [5, 1] select (((getPos _veh) select 2) > 5); -}; - -private _onFinish = { - params ["_args"]; - _args params ["_veh", "_player", "_obj_type", "_obj_name"]; - - [_obj_type,_veh] remoteExec ["btc_fnc_log_server_unload", 2]; - hint format [localize "STR_BTC_HAM_LOG_UNLOAD_FIN", _obj_name, getText (configFile >> "cfgVehicles" >> typeOf _veh >> "displayName")]; -}; -private _onFail = { - hint localize "STR_BTC_HAM_LOG_UNLOAD_ABORT"; -}; - -[_totalTime, [_veh, player, _obj_type, _obj_name], _onFinish, _onFail, format [localize "STR_BTC_HAM_LOG_UNLOAD_BAR", _obj_name]] call btc_fnc_int_action_result; From f6c2ebdf39443a588338c566b5957104dbb527a7 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 12 May 2018 17:27:46 +0200 Subject: [PATCH 04/13] Add: DB --- .../core/def/mission.sqf | 4 +- .../core/fnc/db/saveObjectStatus.sqf | 2 +- =BTC=co@30_Hearts_and_Minds.Altis/mission.sqm | 73 +++++++++++++++++-- 3 files changed, 69 insertions(+), 10 deletions(-) diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf index 03f771b84..196119ad9 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -416,8 +416,8 @@ btc_log_def_cc = [ btc_log_def_rc = [ "Land_BagBunker_Small_F", 5, "Land_CargoBox_V1_F", 9999, - btc_supplies_mat, 10, - btc_fob_mat, 10, + btc_supplies_mat, 20, + btc_fob_mat, 20, "Land_Cargo20_military_green_F", 20, "Land_Cargo40_military_green_F", 40, "B_Slingload_01_Fuel_F", 20, diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/saveObjectStatus.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/saveObjectStatus.sqf index f3248d0be..9e2820834 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/saveObjectStatus.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/saveObjectStatus.sqf @@ -12,7 +12,7 @@ if !(_object getVariable ["loaded", false] || !Alive _object || isNull _object) private _cargo = []; { _cargo pushBack [typeOf _x, _x getVariable ["ace_rearm_magazineClass", ""], [getWeaponCargo _x, getMagazineCargo _x, getItemCargo _x]]; - } forEach (_object getVariable ["cargo", []]); + } forEach (_object getVariable ["ace_cargo_loaded", []]); _data pushBack _cargo; //Inventory private _cont = [getWeaponCargo _object, getMagazineCargo _object, getItemCargo _object]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm b/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm index 87d56613d..ce94808e3 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm +++ b/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm @@ -193,7 +193,7 @@ class CustomAttributes name="Multiplayer"; class Attribute0 { - property="RespawnTemplates"; + property="RespawnButton"; expression="true"; class Value { @@ -203,15 +203,16 @@ class CustomAttributes { type[]= { - "ARRAY" + "SCALAR" }; }; + value=1; }; }; }; class Attribute1 { - property="RespawnButton"; + property="RespawnTemplates"; expression="true"; class Value { @@ -221,10 +222,9 @@ class CustomAttributes { type[]= { - "SCALAR" + "ARRAY" }; }; - value=1; }; }; }; @@ -278,7 +278,7 @@ class CustomAttributes }; class value { - items=4; + items=5; class Item0 { class data @@ -335,6 +335,20 @@ class CustomAttributes value="ace_rearm_level"; }; }; + class Item4 + { + class data + { + class type + { + type[]= + { + "STRING" + }; + }; + value="ace_repair_addspareparts"; + }; + }; }; }; }; @@ -351,7 +365,7 @@ class CustomAttributes }; class value { - items=4; + items=5; class Item0 { class data @@ -532,6 +546,51 @@ class CustomAttributes }; }; }; + class Item4 + { + class data + { + class type + { + type[]= + { + "ARRAY" + }; + }; + class value + { + items=2; + class Item0 + { + class data + { + class type + { + type[]= + { + "BOOL" + }; + }; + value=0; + }; + }; + class Item1 + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=1; + }; + }; + }; + }; + }; }; }; }; From 9c119cea563c3405784c77095070b9f6c8bf8fcf Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 12 May 2018 18:38:17 +0200 Subject: [PATCH 05/13] Now Cargo20 has a usefull size --- .../core/def/mission.sqf | 15 +----------- .../core/fnc/log/init.sqf | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf index 196119ad9..be3b39440 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -394,24 +394,11 @@ btc_log_main_rc = [ "Car", 35 ]; btc_log_def_cc = [ - "B_Quadbike_01_F", 2, - "B_UGV_01_rcws_F", 4, - "B_UGV_01_F", 4, "Land_CargoBox_V1_F", 0, btc_supplies_mat, 0, btc_fob_mat, 0, "Land_Cargo20_military_green_F", 20, - "Land_Cargo40_military_green_F", 40, - "B_Slingload_01_Fuel_F", 0, - "Land_Pod_Heli_Transport_04_medevac_black_F", 0, - //Trucks - "B_Truck_01_transport_F", 10, - "B_Truck_01_covered_F", 10, - "I_Truck_02_covered_F", 10, - "O_Truck_02_covered_F", 10, - "I_Truck_02_transport_F", 10, - "O_Truck_02_transport_F", 10, - "O_Truck_02_transport_F", 10 + "Land_Cargo40_military_green_F", 40 ]; btc_log_def_rc = [ "Land_BagBunker_Small_F", 5, diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf index cd57a300e..87ab085b5 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf @@ -4,18 +4,22 @@ btc_log_obj_created pushBack _obj; btc_curator addCuratorEditableObjects [[_obj], false]; private _type = typeOf _obj; -if (_type in btc_log_def_loadable && {getNumber (configFile >> "CfgVehicles" >> _type >> "ace_cargo_canLoad") isEqualTo 0}) then { - [_obj, [_obj] call btc_fnc_log_get_rc] call ace_cargo_fnc_setSize; +if (_type in btc_log_def_loadable) then { + if (_type in btc_log_def_rc || {getNumber (configFile >> "CfgVehicles" >> _type >> "ace_cargo_canLoad") isEqualTo 0}) then { + [_obj, [_obj] call btc_fnc_log_get_rc] call ace_cargo_fnc_setSize; - if (btc_debug_log) then { - [format ["ace_cargo_fnc_setSize to %1", _obj], __FILE__, [false]] call btc_fnc_debug_message; - }; + if (btc_debug_log) then { + [format ["ace_cargo_fnc_setSize to %1", _obj], __FILE__, [false]] call btc_fnc_debug_message; + }; + }; }; -if (_type in btc_log_def_can_load && {getNumber (configFile >> "CfgVehicles" >> _type >> "ace_cargo_hasCargo") isEqualTo 0}) then { - [_obj, [_obj] call btc_fnc_log_get_cc] call ace_cargo_fnc_setSpace; +if (_type in btc_log_def_can_load) then { + if (_type in btc_log_def_cc || {getNumber (configFile >> "CfgVehicles" >> _type >> "ace_cargo_hasCargo") isEqualTo 0}) then { + [_obj, [_obj] call btc_fnc_log_get_cc] call ace_cargo_fnc_setSize; - if (btc_debug_log) then { - [format ["ace_cargo_fnc_setSpace to %1", _obj], __FILE__, [false]] call btc_fnc_debug_message; - }; + if (btc_debug_log) then { + [format ["ace_cargo_fnc_setSpace to %1", _obj], __FILE__, [false]] call btc_fnc_debug_message; + }; + }; }; From afad5684968a9238ef0c3c25faf491dac4490ebc Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sun, 13 May 2018 10:24:58 +0200 Subject: [PATCH 06/13] rmv server_load function --- =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf | 1 - .../core/fnc/db/load_old.sqf | 2 +- .../core/fnc/log/server_load.sqf | 10 ---------- 3 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_load.sqf diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf index bf6419ae1..1fa2fe9d2 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf @@ -208,7 +208,6 @@ btc_fnc_log_place_create_camera = compile preprocessFileLineNumbers "core\fnc\lo btc_fnc_log_place_destroy_camera = compile preprocessFileLineNumbers "core\fnc\log\place_destroy_camera.sqf"; btc_fnc_log_place_key_down = compile preprocessFileLineNumbers "core\fnc\log\place_key_down.sqf"; btc_fnc_log_repair_wreck = compile preprocessFileLineNumbers "core\fnc\log\repair_wreck.sqf"; -btc_fnc_log_server_load = compile preprocessFileLineNumbers "core\fnc\log\server_load.sqf"; btc_fnc_log_server_repair_wreck = compile preprocessFileLineNumbers "core\fnc\log\server_repair_wreck.sqf"; btc_fnc_log_tow = compile preprocessFileLineNumbers "core\fnc\log\tow.sqf"; btc_fnc_log_unhook = compile preprocessFileLineNumbers "core\fnc\log\unhook.sqf"; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf index 28cb770d5..03e028611 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf @@ -182,7 +182,7 @@ private _vehs = profileNamespace getVariable [format ["btc_hm_%1_vehs", _name], _obj addItemCargoGlobal [(_items_obj select 0) select _i, (_items_obj select 1) select _i]; }; }; - [_obj, _veh] call btc_fnc_log_server_load; + [_obj, _veh] call ace_cargo_fnc_loadItem; } forEach _veh_cargo; clearWeaponCargoGlobal _veh;clearItemCargoGlobal _veh;clearMagazineCargoGlobal _veh; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_load.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_load.sqf deleted file mode 100644 index c1b9c7b2b..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/server_load.sqf +++ /dev/null @@ -1,10 +0,0 @@ -params ["_obj", "_veh"]; - -_obj hideObjectGlobal true; - -private _cargo = _veh getVariable ["cargo", []]; -_cargo pushBack _obj; -_veh setVariable ["cargo", _cargo]; -_obj setVariable ["loaded", true]; -_obj attachTo [btc_log_cargo_repo, [0, 0, btc_log_id_repo]]; -btc_log_id_repo = btc_log_id_repo + 15; From d63bc630429d733083ac87ade014de2a47f7a858 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sun, 13 May 2018 21:25:31 +0200 Subject: [PATCH 07/13] Rmv useless dlg ,debug stringtable entry --- .../core/def/mission.sqf | 4 -- .../core/def/param.hpp | 2 +- .../core/fnc/log/dlg.hpp | 57 +------------------ .../stringtable.xml | 44 -------------- 4 files changed, 3 insertions(+), 104 deletions(-) diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf index be3b39440..5865dddf7 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -128,10 +128,6 @@ if (isServer) then { //FOB btc_fobs = [[], []]; - //Log - btc_log_id_repo = 10; - btc_log_cargo_repo = "Land_HBarrierBig_F" createVehicle [- 5000, - 5000, 0]; - //Patrol btc_patrol_max = 8; btc_patrol_active = []; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp index 5ee423a11..96d6906ff 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp @@ -285,6 +285,6 @@ class Params { title = __EVAL(format [" %1", localize "STR_BTC_HAM_PARAM_OTHER_DEBUG"]); values[]={0,1,2}; texts[]={$STR_DISABLED,$STR_ENABLED, $STR_BTC_HAM_PARAM_OTHER_DEBUG_LOGONLY}; // texts[]={"Off","On","Log only"}; - default = 1; + default = 0; }; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/dlg.hpp b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/dlg.hpp index aae34d4a4..4eebf2c48 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/dlg.hpp +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/dlg.hpp @@ -1,56 +1,3 @@ -class btc_log_dlg { - idd = -1; - movingEnable = 1; - onLoad = "uiNamespace setVariable [""btc_log_dlg"", _this select 0];"; - objects[] = {}; - class controlsBackground {}; - class controls { - class btc_log_dlg_background : btc_dlg_RscText { - idc = -1; - x = 0.55 * safezoneW + safezoneX; - y = 0.5 * safezoneH + safezoneY; - w = 0.25 * safezoneW; - h = 0.2 * safezoneH;//1565 - colorBackground[] = {0, 0, 0, 0.7}; - text = ""; - }; - class btc_log_dlg_name : btc_dlg_RscText { - colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.7])"}; - idc = 990; - x = 0.55 * safezoneW + safezoneX; - y = 0.5 * safezoneH + safezoneY; - w = 0.25 * safezoneW;//w = 0.105 * safezoneW; - h = 0.0325 * safezoneH; - text = $STR_BTC_HAM_LOG_DLG_CARGO; //Cargo - }; - class btc_log_dlg_cargo: btc_dlg_RscListBox { - idc = 991; - x = 0.55 * safezoneW + safezoneX; - y = 0.54 * safezoneH + safezoneY; - w = 0.25 * safezoneW; - h = 0.16 * safezoneH; - }; - - class btc_log_unload : btc_dlg_button { - idc = 992; - text = $STR_BTC_HAM_LOG_DLG_UNLOAD; //Unload - action = "[] spawn btc_fnc_log_unload"; - x = 0.55 * safezoneW + safezoneX; - y = 0.7 * safezoneH + safezoneY; - w = 0.125 * safezoneW; - default = true; - }; - class btc_log_close : btc_dlg_button { - idc = 993; - text = $STR_BTC_HAM_LOG_DLG_CLOSE; //Close - action = "closeDialog 0;"; - x = 0.675 * safezoneW + safezoneX; - y = 0.7 * safezoneH + safezoneY; - w = 0.125 * safezoneW; - default = true; - }; - }; -}; class btc_log_dlg_create { idd = -1; movingEnable = 1; @@ -60,7 +7,7 @@ class btc_log_dlg_create { class controls { class btc_log_dlg_Apply : btc_dlg_button { idc = -1; - text = $STR_BTC_HAM_LOG_DLG_APPLY; //Apply + text = $STR_ui_debug_but_apply; //Apply action = "_spawn = [] spawn btc_fnc_log_create_apply"; x = 0 * safezoneW + safezoneX; y = 0.25 * safezoneH + safezoneY; @@ -68,7 +15,7 @@ class btc_log_dlg_create { }; class btc_log_dlg_Close : btc_dlg_button { idc = -1; - text = $STR_BTC_HAM_LOG_DLG_CLOSE; //Close + text = $STR_ACE_Arsenal_buttonCloseText; //Close action = "closeDialog 0;"; x = 0.2 * safezoneW + safezoneX; y = 0.25 * safezoneH + safezoneY; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml b/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml index 8d1d3479b..5e5a649fd 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml +++ b/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml @@ -1427,61 +1427,17 @@ Das ist kein Wrack! - - - %1 selected <br/>CR: %2<br/> Interact with a vehicle to load it in! - %1 ausgewählt <br/>CR: %2<br/> Interagieren Sie mit dem Fahrzeug, in welches die Fracht eingeladen werden soll! - - This vehicle is already attached to another! Dieses Fahrzeug zieht bereits ein anderes Fahrzeug! - - - Vehicle: %1 | CC: %2/%3 - Fahrzeug: %1 | CC: %2/%3 - - This vehicle is not attached to another! Das Fahrzeug schleppt kein anderes Fahrzeug ab! - - - Unloading %1. . . - %1 wird abgeladen. . . - - - %1 has been unloaded from %2 - %1 wurde von %2 abgeladen - - - Unloading aborted - Abladen abgebrochen - - - - - Cargo - Frachtraum - - - Unload - Entladen - - - Apply - Bestätigen - - - Close - Schließen - - From 694f9272984e0674b282f97fa3fe98695610e684 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Tue, 15 May 2018 12:38:08 +0200 Subject: [PATCH 08/13] fix: curator , fix DB - fix: object inside container or venhicle not saved - fix: the number of object after restat from db increase -fix objects from curator without interation - Update doc - need localise the modified string `STR_BTC_HAM_DOC_LOGISTIC_TEXT` : "See ACE3 documentation."https://github.com/Vdauphin/HeartsAndMinds/issues/400https://github.com/Vdauphin/HeartsAndMinds/issues/400 --- .../core/fnc/db/load_old.sqf | 10 +- .../core/fnc/db/loadcargo.sqf | 96 ++++++++++--------- .../core/fnc/db/save.sqf | 4 +- .../core/fnc/eh/veh_init.sqf | 8 -- .../core/fnc/int/ask_var.sqf | 1 - .../core/fnc/log/CuratorObjectPlaced_s.sqf | 2 +- .../core/fnc/log/paste.sqf | 2 +- .../stringtable.xml | 18 +--- 8 files changed, 62 insertions(+), 79 deletions(-) diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf index 03e028611..558e9434d 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf @@ -160,10 +160,13 @@ private _vehs = profileNamespace getVariable [format ["btc_hm_%1_vehs", _name], { _x params ["_type", "_rearm_magazineClass", "_cargo_obj"]; - private _obj = _type createVehicle [0, 0, 0]; + private _l = createVehicle [_type, getPosATL _obj, [], 0, "CAN_COLLIDE"]; + [_l] call btc_fnc_log_init; + private _isloaded = [_l, _obj] call ace_cargo_fnc_loadItem; + if (btc_debug_log) then { + [format ["Object loaded: %1 in veh/container %2 IsLoaded: %3", _l, _obj, _isloaded], __FILE__, [false]] call btc_fnc_debug_message; + }; if (_rearm_magazineClass != "") then {_obj setVariable ["ace_rearm_magazineClass", _rearm_magazineClass, true]}; - btc_log_obj_created pushBack _obj; - btc_curator addCuratorEditableObjects [[_obj], false]; clearWeaponCargoGlobal _obj;clearItemCargoGlobal _obj;clearMagazineCargoGlobal _obj; _cargo_obj params ["_weap_obj", "_mags_obj", "_items_obj"]; @@ -182,7 +185,6 @@ private _vehs = profileNamespace getVariable [format ["btc_hm_%1_vehs", _name], _obj addItemCargoGlobal [(_items_obj select 0) select _i, (_items_obj select 1) select _i]; }; }; - [_obj, _veh] call ace_cargo_fnc_loadItem; } forEach _veh_cargo; clearWeaponCargoGlobal _veh;clearItemCargoGlobal _veh;clearMagazineCargoGlobal _veh; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf index 95cb6d1c0..f472f8ff7 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf @@ -1,63 +1,67 @@ -params ["_obj", "_cargo", "_inventory"]; +[{ + params ["_obj", "_cargo", "_inventory"]; -//handle cargo -{ - _x params ["_type", "_magClass", "_cargo_obj"]; + //handle cargo + { + _x params ["_type", "_magClass", "_cargo_obj"]; - private _l = _type createVehicle [0, 0, 0]; - if (_magClass != "") then { - _l setVariable ["ace_rearm_magazineClass", _magClass, true] - }; - btc_log_obj_created pushBack _l; - btc_curator addCuratorEditableObjects [[_l], false]; + private _l = createVehicle [_type, getPosATL _obj, [], 0, "CAN_COLLIDE"]; + [_l] call btc_fnc_log_init; + private _isloaded = [_l, _obj] call ace_cargo_fnc_loadItem; + if (btc_debug_log) then { + [format ["Object loaded: %1 in veh/container %2 IsLoaded: %3", _l, _obj, _isloaded], __FILE__, [false]] call btc_fnc_debug_message; + }; - clearWeaponCargoGlobal _l; - clearItemCargoGlobal _l; - clearMagazineCargoGlobal _l; + if (_magClass != "") then { + _l setVariable ["ace_rearm_magazineClass", _magClass, true] + }; - _cargo_obj params ["_weap_obj", "_mags_obj", "_items_obj"]; + clearWeaponCargoGlobal _l; + clearItemCargoGlobal _l; + clearMagazineCargoGlobal _l; - if !(_weap_obj isEqualTo []) then { - for "_i" from 0 to ((count (_weap_obj select 0)) - 1) do { - _l addWeaponCargoGlobal [(_weap_obj select 0) select _i, (_weap_obj select 1) select _i]; + _cargo_obj params ["_weap_obj", "_mags_obj", "_items_obj"]; + + if !(_weap_obj isEqualTo []) then { + for "_i" from 0 to ((count (_weap_obj select 0)) - 1) do { + _l addWeaponCargoGlobal [(_weap_obj select 0) select _i, (_weap_obj select 1) select _i]; + }; }; - }; - if !(_mags_obj isEqualTo []) then { - for "_i" from 0 to ((count (_mags_obj select 0)) - 1) do { - _l addMagazineCargoGlobal [(_mags_obj select 0) select _i, (_mags_obj select 1) select _i]; + if !(_mags_obj isEqualTo []) then { + for "_i" from 0 to ((count (_mags_obj select 0)) - 1) do { + _l addMagazineCargoGlobal [(_mags_obj select 0) select _i, (_mags_obj select 1) select _i]; + }; }; - }; - if !(_items_obj isEqualTo []) then { - for "_i" from 0 to ((count (_items_obj select 0)) - 1) do { - _l addItemCargoGlobal [(_items_obj select 0) select _i, (_items_obj select 1) select _i]; + if !(_items_obj isEqualTo []) then { + for "_i" from 0 to ((count (_items_obj select 0)) - 1) do { + _l addItemCargoGlobal [(_items_obj select 0) select _i, (_items_obj select 1) select _i]; + }; }; - }; - [_l, _obj] call ace_cargo_fnc_loadItem; -} forEach _cargo; + } forEach _cargo; -//set inventory content for weapons, magazines and items -_inventory params ["_weap", "_mags", "_items"]; + //set inventory content for weapons, magazines and items + _inventory params ["_weap", "_mags", "_items"]; -clearWeaponCargoGlobal _obj; -clearItemCargoGlobal _obj; -clearMagazineCargoGlobal _obj; + clearWeaponCargoGlobal _obj; + clearItemCargoGlobal _obj; + clearMagazineCargoGlobal _obj; -if !(_weap isEqualTo []) then { - for "_i" from 0 to ((count (_weap select 0)) - 1) do { - _obj addWeaponCargoGlobal [(_weap select 0) select _i, (_weap select 1) select _i]; + if !(_weap isEqualTo []) then { + for "_i" from 0 to ((count (_weap select 0)) - 1) do { + _obj addWeaponCargoGlobal [(_weap select 0) select _i, (_weap select 1) select _i]; + }; }; -}; -if !(_mags isEqualTo []) then { - for "_i" from 0 to ((count (_mags select 0)) - 1) do { - _obj addMagazineCargoGlobal [(_mags select 0) select _i, (_mags select 1) select _i]; + if !(_mags isEqualTo []) then { + for "_i" from 0 to ((count (_mags select 0)) - 1) do { + _obj addMagazineCargoGlobal [(_mags select 0) select _i, (_mags select 1) select _i]; + }; }; -}; -if !(_items isEqualTo []) then { - for "_i" from 0 to ((count (_items select 0)) - 1) do { - _obj addItemCargoGlobal [(_items select 0) select _i, (_items select 1) select _i]; + if !(_items isEqualTo []) then { + for "_i" from 0 to ((count (_items select 0)) - 1) do { + _obj addItemCargoGlobal [(_items select 0) select _i, (_items select 1) select _i]; + }; }; -}; -_obj +}, _this] call CBA_fnc_waitAndExecute; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf index a3df0e733..23af78c68 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf @@ -114,7 +114,7 @@ private _array_veh = []; private _cargo = []; { _cargo pushBack [typeOf _x, _x getVariable ["ace_rearm_magazineClass", ""], [getWeaponCargo _x, getMagazineCargo _x, getItemCargo _x]] - } forEach (_x getVariable ["cargo", []]); + } forEach (_x getVariable ["ace_cargo_loaded", []]); _data pushBack _cargo; private _cont = [getWeaponCargo _x, getMagazineCargo _x, getItemCargo _x]; _data pushBack _cont; @@ -133,7 +133,7 @@ private _array_obj = []; if !(_data isEqualTo []) then { _array_obj pushBack _data; }; -} forEach btc_log_obj_created; +} forEach (btc_log_obj_created select {!(isObjectHidden _x)}); profileNamespace setVariable [format ["btc_hm_%1_objs", _name], _array_obj]; //Player Markers diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/veh_init.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/veh_init.sqf index b47ac7c82..fcaee2acf 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/veh_init.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/veh_init.sqf @@ -23,18 +23,10 @@ switch true do { [_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass; _action = ["log_hook", localize "STR_BTC_HAM_ACTION_VEHINIT_UHOOK", "\z\ace\addons\attach\UI\detach_ca.paa", {(_this select 0) spawn btc_fnc_log_unhook;}, {true}] call ace_interact_menu_fnc_createAction; //Unhook [_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass; - //Cargo - _action = ["check_cargo", localize "STR_BTC_HAM_ACTION_LOGISTIC_CHECKCARGO", "\A3\ui_f\data\igui\cfg\simpleTasks\types\search_ca.paa", {(_this select 0) spawn btc_fnc_log_check_cargo;}, {true}] call ace_interact_menu_fnc_createAction; //Check Cargo - //Outside Vehicle - [_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass; //Logistic }; case (_type isKindOf "Helicopter") : { private _action = ["Logistic", localize "STR_BTC_HAM_ACTION_LOC_MAIN", "\A3\ui_f\data\igui\cfg\simpleTasks\letters\L_ca.paa", {}, {true}] call ace_interact_menu_fnc_createAction; //Logistic [_type, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToClass; - //Cargo - _action = ["check_cargo", localize "STR_BTC_HAM_ACTION_LOGISTIC_CHECKCARGO", "\A3\ui_f\data\igui\cfg\simpleTasks\types\search_ca.paa", {(_this select 0) spawn btc_fnc_log_check_cargo;}, {true}] call ace_interact_menu_fnc_createAction; //Check Cargo - //Outside Vehicle - [_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass; //Logistic //Lift _action = ["Deploy_ropes", localize "STR_BTC_HAM_ACTION_VEHINIT_DEPLOYROPES", "\A3\ui_f\data\igui\cfg\simpleTasks\types\container_ca.paa", {[] spawn btc_fnc_log_lift_deploy_ropes;}, {!btc_ropes_deployed && {(driver vehicle player) isEqualTo player} && {(getposATL player) select 2 > 4}}] call ace_interact_menu_fnc_createAction; //Deploy ropes [_type, 1, ["ACE_SelfActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/ask_var.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/ask_var.sqf index 5b0b88a8f..c03c4f19c 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/ask_var.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/ask_var.sqf @@ -13,7 +13,6 @@ private _data = switch (_id) do { _hd; }; case 2 : {btc_global_reputation;}; - case 3 : {_target getVariable ["cargo", []];}; case 4 : {_target getVariable ["tow", objNull];}; case 5 : {btc_side_jip_data;}; case 6 : {btc_fobs;}; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/CuratorObjectPlaced_s.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/CuratorObjectPlaced_s.sqf index 47602d49f..90763f0e8 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/CuratorObjectPlaced_s.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/CuratorObjectPlaced_s.sqf @@ -1,6 +1,6 @@ params ["_obj_created"]; -btc_log_obj_created pushBack _obj_created; +[_obj_created] call btc_fnc_log_init; if (btc_debug_log) then { [format ["btc_log_obj_created UPDATED by curator %1", _obj_created], __FILE__, [false]] call btc_fnc_debug_message; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paste.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paste.sqf index 060262652..406088908 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paste.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/paste.sqf @@ -6,4 +6,4 @@ if ({!((_x isKindOf "Animal") || (_x isKindOf "Module_F") || (_x isKindOf "Weapo if (isNil "_copy_container") exitWith {hint localize "STR_BTC_HAM_O_PASTE_NOCOPIED"}; //No copied container! -[_copy_container] remoteExec ["btc_fnc_db_loadObjectStatus", 2]; +[_copy_container] remoteExecCall ["btc_fnc_db_loadObjectStatus", 2]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml b/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml index 5e5a649fd..e6a363861 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml +++ b/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml @@ -141,8 +141,8 @@ Logistik - <marker name='blufor_base'>Cargo System:</marker><br/> - <img image='a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa' width='20' height='20'/> <marker name='blufor_base'>Load:</marker> You can load objects inside vehicles. Approach the object you want to load and interact with it.<br/> Select 'LOAD IN' option.<br/> After that interact with the vehicle and select 'LOAD object selected' option.<br/> The object has to be close to the vehicle.<br/><br/> - <img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\search_ca.paa' width='20' height='20'/> <marker name='blufor_base'>Unload:</marker> You can unload an object from a vehicle interacting with it. You can be inside the vehicle (personal interaction) or outside (object interaction).<br/> Select the option 'CHECK CARGO', then choose the object you want to unload from the list, and click 'UNLOAD'.<br/> If you are inside a chopper the object will be paradropped with a chute. If your height is too low, the object will crash down.<br/> Every vehicle has a 'CARGO CAPACITY' (CC in game), and every object has a 'REQUIRED CAPACITY' value (RC in game.)<br/> You can check those values in game with 'LOAD IN' and 'CHECK CARGO' options.<br/><br/><br/> <marker name='blufor_base'>Towing system:</marker><br/> To tow a vehicle interact with it and select the option 'HOOK'.<br/>After that place the tow vehicle in front of it and select 'TOW' in the interaction menu.<br/> If the two vehicles are too far away or the vehicle can't tow that load (Car can't tow truck or tank), the option will be disabled.<br/> To unhook interact with one of the two vehicles and select the option 'UNHOOK'.<br/><br/> <marker name='blufor_base'>Place option:</marker><br/> With this option you can move heavy objects to build small outpost or base.<br/> When you select the option an hint will show all the keys required to move the object. - <marker name='blufor_base'>Fracht-System:</marker><br/> - <img image='a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa' width='20' height='20'/> <marker name='blufor_base'>Beladen:</marker> Man kann Objekte in Fahrzeuge einladen. Gehen Sie an das Obekt heran und interagieren sie damit.<br/> Wählen sie 'EINLADEN'aus.<br/> Als nächstes gehen Sie zum Fahrzeug und wählen 'AUSGEWÄHLTES EINLADEN' aus.<br/> Denken Sie daran, dass das zu verladende Objekt sich in der Nähe des Fahrzeuges befinden muss.<br/><br/> - <img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\search_ca.paa' width='20' height='20'/> <marker name='blufor_base'>Abladen:</marker> Man kann Objekte aus einen Fahrzeug entladen, indem man mit diesem interagiert. Das funktioniert von Innen (Eigen-Interaktionsmenü) und von Aussen (mit dem Objekt interagieren).<br/> Über den Menüpunkt 'FRACHT ÜBERPRÜFEN' kann man das zu entladende Objekt aus einer Liste auswählen und mit einem Klick auf 'ENTLADEN' ausladen.<br/> Wenn man sich beim Ausladen in einem Hubschrauber befindet, so wird das Objekt automatisch mit einem Fallschrim abgeworfen. Aber Achtung: Der Fallschirm öffnet sich erst ab einer bestimmten Flughöhe.<br/> Jedes Fahrzeug hat eine gewisse Ladekapazität ('Frachtkapazität' - CC im Spiel genannt) und jedes Objekt hat ein gewisses Ladevolumen ('benötigte Kapazität' - RC im Spiel genannt).<br/> Diese Werte können im Spiel mit den Actionen 'EINLADEN' und 'FRACHT ÜBERPRÜFEN' geprüft werden.<br/><br/><br/> <marker name='blufor_base'>Abschleppsystem:</marker><br/> Um ein Fahrzeug abzuschleppen muss man mit diesem interagieren und 'EINHACKEN' auswählen.<br/>Als nächstes muss man das Zugfahrzeug vor das abzuschleppende Fahrzeug stellen und über das Interagtionsmenü die Option 'ABSCHLEPPEN' aktivieren.<br/> Zu beachten ist dabei, dass die beiden Fahrzeuge nicht zu weit von einander entfernt sein dürfen. Ebenso ist daruf zu achten, dass das Zugfahrzeug auch das andere Fahrzeug abschleppen kann (zB. Autos können keine Lkw/Panzer abschleppen).<br/> Um das Abschleppseil wieder zu entfernen muss man einen bei einem der beiden Fahrzeuge die Option 'AUSHACKEN' auswählen.<br/><br/> <marker name='blufor_base'>Platzierung von Objekten:</marker><br/> Mit dieser Option können Sie schwere Objekte bewegen, um einen kleinen Außenposten oder eine Basis zu bauen.<br/> Wenn Sie die Option auswählen, zeigt ein Hinweis alle Tasten an, die zum Verschieben des Objekts erforderlich sind. + <marker name='blufor_base'>Cargo System:</marker><br/> See ACE3 documentation. <br/><br/> <marker name='blufor_base'>Towing system:</marker><br/> To tow a vehicle interact with it and select the option 'HOOK'.<br/>After that place the tow vehicle in front of it and select 'TOW' in the interaction menu.<br/> If the two vehicles are too far away or the vehicle can't tow that load (Car can't tow truck or tank), the option will be disabled.<br/> To unhook interact with one of the two vehicles and select the option 'UNHOOK'.<br/><br/> <marker name='blufor_base'>Place option:</marker><br/> With this option you can move heavy objects to build small outpost or base.<br/> When you select the option an hint will show all the keys required to move the object. + <marker name='blufor_base'>Fracht-System:</marker><br/> <br/><br/> <marker name='blufor_base'>Abschleppsystem:</marker><br/> Um ein Fahrzeug abzuschleppen muss man mit diesem interagieren und 'EINHACKEN' auswählen.<br/>Als nächstes muss man das Zugfahrzeug vor das abzuschleppende Fahrzeug stellen und über das Interagtionsmenü die Option 'ABSCHLEPPEN' aktivieren.<br/> Zu beachten ist dabei, dass die beiden Fahrzeuge nicht zu weit von einander entfernt sein dürfen. Ebenso ist daruf zu achten, dass das Zugfahrzeug auch das andere Fahrzeug abschleppen kann (zB. Autos können keine Lkw/Panzer abschleppen).<br/> Um das Abschleppseil wieder zu entfernen muss man einen bei einem der beiden Fahrzeuge die Option 'AUSHACKEN' auswählen.<br/><br/> <marker name='blufor_base'>Platzierung von Objekten:</marker><br/> Mit dieser Option können Sie schwere Objekte bewegen, um einen kleinen Außenposten oder eine Basis zu bauen.<br/> Wenn Sie die Option auswählen, zeigt ein Hinweis alle Tasten an, die zum Verschieben des Objekts erforderlich sind. @@ -919,20 +919,6 @@ Fahrzeug anfordern - - - Load in - Einladen - - - Load selected - Ausgewähltes einladen - - - Check cargo - Fracht überprüfen - - Mount FOB From 2bbbcb7087c1a05d43982ec707edcb30da7a716b Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Fri, 18 May 2018 12:19:56 +0200 Subject: [PATCH 09/13] FIXs FOB, interaction, german localisation - FIX: remove FOB and Supply have cargo - FIX: logistic point and Arsenal can be loaded - remove interaction on logistic, arsenal ammobox - update 3 mission.sqm - tweak container capacity - fix german translation: https://github.com/Vdauphin/HeartsAndMinds/pull/540#issuecomment-390131387 (https://github.com/Vdauphin/HeartsAndMinds/issues/400) --- .../core/def/mission.sqf | 10 +- .../core/fnc/log/init.sqf | 6 +- =BTC=co@30_Hearts_and_Minds.Altis/mission.sqm | 110 +++++++- .../mission_RHSUS_Altis.sqm | 180 ++++++++++-- .../mission_RHSUS_Tanoa.sqm | 263 +++++++++++++----- .../stringtable.xml | 2 +- 6 files changed, 471 insertions(+), 100 deletions(-) diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf index 5865dddf7..aa60e5602 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -399,12 +399,12 @@ btc_log_def_cc = [ btc_log_def_rc = [ "Land_BagBunker_Small_F", 5, "Land_CargoBox_V1_F", 9999, - btc_supplies_mat, 20, - btc_fob_mat, 20, - "Land_Cargo20_military_green_F", 20, - "Land_Cargo40_military_green_F", 40, + btc_supplies_mat, 8, + btc_fob_mat, 8, + "Land_Cargo20_military_green_F", 8, + "Land_Cargo40_military_green_F", 16, "B_Slingload_01_Fuel_F", 20, - "Land_Pod_Heli_Transport_04_medevac_black_F", 20 + "Land_Pod_Heli_Transport_04_medevac_black_F", 8 ]; btc_fnc_log_get_nottowable = { diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf index 87ab085b5..1914bb904 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/init.sqf @@ -4,7 +4,7 @@ btc_log_obj_created pushBack _obj; btc_curator addCuratorEditableObjects [[_obj], false]; private _type = typeOf _obj; -if (_type in btc_log_def_loadable) then { +if (_type in btc_log_def_loadable || {_type in btc_log_def_rc}) then { if (_type in btc_log_def_rc || {getNumber (configFile >> "CfgVehicles" >> _type >> "ace_cargo_canLoad") isEqualTo 0}) then { [_obj, [_obj] call btc_fnc_log_get_rc] call ace_cargo_fnc_setSize; @@ -14,9 +14,9 @@ if (_type in btc_log_def_loadable) then { }; }; -if (_type in btc_log_def_can_load) then { +if (_type in btc_log_def_can_load || {_type in btc_log_def_cc}) then { if (_type in btc_log_def_cc || {getNumber (configFile >> "CfgVehicles" >> _type >> "ace_cargo_hasCargo") isEqualTo 0}) then { - [_obj, [_obj] call btc_fnc_log_get_cc] call ace_cargo_fnc_setSize; + [_obj, [_obj] call btc_fnc_log_get_cc] call ace_cargo_fnc_setSpace; if (btc_debug_log) then { [format ["ace_cargo_fnc_setSpace to %1", _obj], __FILE__, [false]] call btc_fnc_debug_message; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm b/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm index ce94808e3..784eb8fc1 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm +++ b/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm @@ -193,7 +193,7 @@ class CustomAttributes name="Multiplayer"; class Attribute0 { - property="RespawnButton"; + property="RespawnTemplates"; expression="true"; class Value { @@ -203,16 +203,15 @@ class CustomAttributes { type[]= { - "SCALAR" + "ARRAY" }; }; - value=1; }; }; }; class Attribute1 { - property="RespawnTemplates"; + property="RespawnButton"; expression="true"; class Value { @@ -222,9 +221,10 @@ class CustomAttributes { type[]= { - "ARRAY" + "SCALAR" }; }; + value=1; }; }; }; @@ -685,7 +685,7 @@ class Mission dataType="Marker"; position[]={8323.1348,73.933266,10113.239}; name="btc_log_point"; - text="Logistic Point"; + text=$STR_BTC_HAM_MSQM_MRK_LOGPOINT; type="mil_flag"; colorName="ColorGreen"; a=0.5; @@ -705,11 +705,54 @@ class Mission class Attributes { skill=0.60000002; - init="call{this allowDamage false; this enableSimulation false;}"; + init="call{if (isServer) then { " \n " [this, 0] call ace_cargo_fnc_setSpace; " \n "};}"; name="btc_create_object"; + disableSimulation=1; }; id=13; type="Land_CargoBox_V1_F"; + class CustomAttributes + { + class Attribute0 + { + property="allowDamage"; + expression="_this allowdamage _value;"; + class Value + { + class data + { + class type + { + type[]= + { + "BOOL" + }; + }; + value=0; + }; + }; + }; + class Attribute1 + { + property="ace_cargo_size"; + expression="[_this,_value] call ace_cargo_fnc_setSize;"; + class Value + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=-1; + }; + }; + }; + nAttributes=2; + }; }; class Item4 { @@ -758,18 +801,61 @@ class Mission class PositionInfo { position[]={8309.2861,76.695534,10068.324}; - angles[]={0.0026744273,5.6770415,6.2392135}; + angles[]={0.0026703537,5.6770496,6.2392201}; }; side="Empty"; flags=4; class Attributes { skill=0.60000002; - init="this allowDamage false;"; + init="call{if (isServer) then { " \n " [this, 0] call ace_cargo_fnc_setSpace; " \n "};}"; name="btc_gear_object"; + disableSimulation=1; }; id=15; type="Land_CargoBox_V1_F"; + class CustomAttributes + { + class Attribute0 + { + property="allowDamage"; + expression="_this allowdamage _value;"; + class Value + { + class data + { + class type + { + type[]= + { + "BOOL" + }; + }; + value=0; + }; + }; + }; + class Attribute1 + { + property="ace_cargo_size"; + expression="[_this,_value] call ace_cargo_fnc_setSize;"; + class Value + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=-1; + }; + }; + }; + nAttributes=2; + }; }; class Item6 { @@ -904,7 +990,7 @@ class Mission { skill=0.60000002; init="this setVariable [""side_mission"",true]"; - description="Officer"; + description=$STR_BTC_HAM_MSQM_OFFICER; isPlayer=1; isPlayable=1; }; @@ -938,7 +1024,7 @@ class Mission { skill=0.60000002; init="this setVariable [""interpreter"",true]"; - description="Interpreter"; + description=$STR_BTC_HAM_MSQM_INTERPRETER; isPlayable=1; }; id=29; @@ -972,7 +1058,7 @@ class Mission class Attributes { skill=0.60000002; - description="Adv. Engineer"; + description=$STR_ACE_Repair_AssignEngineerRole_role_advanced; isPlayable=1; }; id=31; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/mission_RHSUS_Altis.sqm b/=BTC=co@30_Hearts_and_Minds.Altis/mission_RHSUS_Altis.sqm index dca842ca4..d72e14d7c 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/mission_RHSUS_Altis.sqm +++ b/=BTC=co@30_Hearts_and_Minds.Altis/mission_RHSUS_Altis.sqm @@ -16,10 +16,10 @@ class EditorData }; class Camera { - pos[]={8297.6123,93.258369,10061.557}; - dir[]={0.58210856,-0.81064433,0.064327784}; - up[]={0.80575699,0.58552009,0.089042641}; - aside[]={0.10984567,4.5113848e-007,-0.99401075}; + pos[]={8259.4297,150.28984,10050.507}; + dir[]={0.58692575,-0.8026101,0.10709169}; + up[]={0.78959358,0.59648287,0.14407076}; + aside[]={0.17950901,4.4240733e-007,-0.98381937}; }; }; binarizationWanted=0; @@ -178,7 +178,7 @@ class CustomAttributes name="Multiplayer"; class Attribute0 { - property="RespawnButton"; + property="RespawnTemplates"; expression="true"; class Value { @@ -188,16 +188,15 @@ class CustomAttributes { type[]= { - "SCALAR" + "ARRAY" }; }; - value=1; }; }; }; class Attribute1 { - property="RespawnTemplates"; + property="RespawnButton"; expression="true"; class Value { @@ -207,9 +206,10 @@ class CustomAttributes { type[]= { - "ARRAY" + "SCALAR" }; }; + value=1; }; }; }; @@ -263,7 +263,7 @@ class CustomAttributes }; class value { - items=4; + items=5; class Item0 { class data @@ -320,6 +320,20 @@ class CustomAttributes value="ace_rearm_level"; }; }; + class Item4 + { + class data + { + class type + { + type[]= + { + "STRING" + }; + }; + value="ace_repair_addspareparts"; + }; + }; }; }; }; @@ -336,7 +350,7 @@ class CustomAttributes }; class value { - items=4; + items=5; class Item0 { class data @@ -452,7 +466,7 @@ class CustomAttributes "BOOL" }; }; - value=0; + value=1; }; }; class Item1 @@ -517,6 +531,51 @@ class CustomAttributes }; }; }; + class Item4 + { + class data + { + class type + { + type[]= + { + "ARRAY" + }; + }; + class value + { + items=2; + class Item0 + { + class data + { + class type + { + type[]= + { + "BOOL" + }; + }; + value=0; + }; + }; + class Item1 + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=1; + }; + }; + }; + }; + }; }; }; }; @@ -797,6 +856,7 @@ class Mission }; id=5; type="RHS_M2A3"; + atlOffset=-0.15499878; }; class Item6 { @@ -815,6 +875,7 @@ class Mission }; id=6; type="RHS_CH_47F_10"; + atlOffset=-0.015945435; }; class Item7 { @@ -991,11 +1052,54 @@ class Mission class Attributes { skill=0.60000002; - init="call{this allowDamage false; this enableSimulation false;}"; + init="call{if (isServer) then { " \n " [this, 0] call ace_cargo_fnc_setSpace; " \n "};}"; name="btc_create_object"; + disableSimulation=1; }; id=13; type="Land_CargoBox_V1_F"; + class CustomAttributes + { + class Attribute0 + { + property="allowDamage"; + expression="_this allowdamage _value;"; + class Value + { + class data + { + class type + { + type[]= + { + "BOOL" + }; + }; + value=0; + }; + }; + }; + class Attribute1 + { + property="ace_cargo_size"; + expression="[_this,_value] call ace_cargo_fnc_setSize;"; + class Value + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=-1; + }; + }; + }; + nAttributes=2; + }; }; class Item10 { @@ -1044,18 +1148,61 @@ class Mission class PositionInfo { position[]={8309.2861,76.695534,10068.324}; - angles[]={0.0026744273,5.6770415,6.2392135}; + angles[]={0.0026703537,5.6770496,6.2392201}; }; side="Empty"; flags=4; class Attributes { skill=0.60000002; - init="this allowDamage false;"; + init="call{if (isServer) then { " \n " [this, 0] call ace_cargo_fnc_setSpace; " \n "};}"; name="btc_gear_object"; + disableSimulation=1; }; id=15; type="Land_CargoBox_V1_F"; + class CustomAttributes + { + class Attribute0 + { + property="allowDamage"; + expression="_this allowdamage _value;"; + class Value + { + class data + { + class type + { + type[]= + { + "BOOL" + }; + }; + value=0; + }; + }; + }; + class Attribute1 + { + property="ace_cargo_size"; + expression="[_this,_value] call ace_cargo_fnc_setSize;"; + class Value + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=-1; + }; + }; + }; + nAttributes=2; + }; }; class Item12 { @@ -2305,7 +2452,7 @@ class Mission }; id=154; type="rhsusf_M1237_M2_usarmy_d"; - atlOffset=-0.0018463135; + atlOffset=-0.032234192; class CustomAttributes { class Attribute0 @@ -2348,6 +2495,7 @@ class Mission }; id=155; type="rhsusf_M1237_M2_usarmy_d"; + atlOffset=-0.030586243; class CustomAttributes { class Attribute0 diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/mission_RHSUS_Tanoa.sqm b/=BTC=co@30_Hearts_and_Minds.Altis/mission_RHSUS_Tanoa.sqm index 582515ccc..409016433 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/mission_RHSUS_Tanoa.sqm +++ b/=BTC=co@30_Hearts_and_Minds.Altis/mission_RHSUS_Tanoa.sqm @@ -16,10 +16,10 @@ class EditorData }; class Camera { - pos[]={4207.9165,39.892441,4004.0476}; - dir[]={0.23425245,-0.75864172,0.60809433}; - up[]={0.2727313,0.6514526,0.70798182}; - aside[]={0.93324167,-1.1265511e-006,-0.35950708}; + pos[]={4218.5347,77.973228,3962.6172}; + dir[]={0.28586584,-0.7674402,0.57402688}; + up[]={0.34213373,0.64106649,0.68701476}; + aside[]={0.89522475,-1.0970398e-006,-0.4458231}; }; }; binarizationWanted=0; @@ -178,7 +178,7 @@ class CustomAttributes name="Multiplayer"; class Attribute0 { - property="RespawnButton"; + property="RespawnTemplates"; expression="true"; class Value { @@ -188,16 +188,15 @@ class CustomAttributes { type[]= { - "SCALAR" + "ARRAY" }; }; - value=1; }; }; }; class Attribute1 { - property="RespawnTemplates"; + property="RespawnButton"; expression="true"; class Value { @@ -207,9 +206,10 @@ class CustomAttributes { type[]= { - "ARRAY" + "SCALAR" }; }; + value=1; }; }; }; @@ -263,7 +263,7 @@ class CustomAttributes }; class value { - items=4; + items=5; class Item0 { class data @@ -320,6 +320,20 @@ class CustomAttributes value="ace_cargo_enable"; }; }; + class Item4 + { + class data + { + class type + { + type[]= + { + "STRING" + }; + }; + value="ace_repair_addspareparts"; + }; + }; }; }; }; @@ -336,7 +350,7 @@ class CustomAttributes }; class value { - items=4; + items=5; class Item0 { class data @@ -497,10 +511,41 @@ class CustomAttributes "BOOL" }; }; - value=0; + value=1; }; }; class Item1 + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=1; + }; + }; + }; + }; + }; + class Item4 + { + class data + { + class type + { + type[]= + { + "ARRAY" + }; + }; + class value + { + items=2; + class Item0 { class data { @@ -511,6 +556,20 @@ class CustomAttributes "BOOL" }; }; + value=0; + }; + }; + class Item1 + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; value=1; }; }; @@ -639,7 +698,7 @@ class Mission }; id=6; type="RHS_CH_47F_10"; - atlOffset=0.0007686615; + atlOffset=-0.015201569; class CustomAttributes { class Attribute0 @@ -677,14 +736,34 @@ class Mission class Attributes { skill=0.60000002; - init="call{this allowDamage false; this enableSimulation false;}"; + init="call{if (isServer) then { " \n " [this, 0] call ace_cargo_fnc_setSpace; " \n "};}"; name="btc_create_object"; + disableSimulation=1; }; id=13; type="Land_CargoBox_V1_F"; class CustomAttributes { class Attribute0 + { + property="allowDamage"; + expression="_this allowdamage _value;"; + class Value + { + class data + { + class type + { + type[]= + { + "BOOL" + }; + }; + value=0; + }; + }; + }; + class Attribute1 { property="ace_isMedicalFacility"; expression="_this setVariable [""ace_medical_isMedicalFacility"",_value,true];"; @@ -703,7 +782,26 @@ class Mission }; }; }; - nAttributes=1; + class Attribute2 + { + property="ace_cargo_size"; + expression="[_this,_value] call ace_cargo_fnc_setSize;"; + class Value + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=-1; + }; + }; + }; + nAttributes=3; }; }; class Item5 @@ -771,23 +869,43 @@ class Mission dataType="Object"; class PositionInfo { - position[]={4225.4805,19.707785,4010.2305}; - angles[]={6.256525,1.0466481,0.0053265258}; + position[]={4225.48,19.707964,4010.2305}; + angles[]={6.2565165,1.0466565,0.0053232545}; }; side="Empty"; flags=4; class Attributes { skill=0.60000002; - init="this allowDamage false;"; + init="call{if (isServer) then { " \n " [this, 0] call ace_cargo_fnc_setSpace; " \n "};}"; name="btc_gear_object"; + disableSimulation=1; }; id=15; type="Land_CargoBox_V1_F"; - atlOffset=-0.00018310547; + atlOffset=-1.9073486e-006; class CustomAttributes { class Attribute0 + { + property="allowDamage"; + expression="_this allowdamage _value;"; + class Value + { + class data + { + class type + { + type[]= + { + "BOOL" + }; + }; + value=0; + }; + }; + }; + class Attribute1 { property="ace_isMedicalFacility"; expression="_this setVariable [""ace_medical_isMedicalFacility"",_value,true];"; @@ -806,7 +924,26 @@ class Mission }; }; }; - nAttributes=1; + class Attribute2 + { + property="ace_cargo_size"; + expression="[_this,_value] call ace_cargo_fnc_setSize;"; + class Value + { + class data + { + class type + { + type[]= + { + "SCALAR" + }; + }; + value=-1; + }; + }; + }; + nAttributes=3; }; }; class Item7 @@ -897,8 +1034,8 @@ class Mission dataType="Object"; class PositionInfo { - position[]={4244.6074,22.12014,3918.6768}; - angles[]={0.050623242,1.6752416,0.12468291}; + position[]={4177.8857,20.514906,4124.8467}; + angles[]={6.1901217,1.6752416,0.015998369}; }; side="Empty"; flags=4; @@ -910,7 +1047,6 @@ class Mission }; id=18; type="B_Truck_01_ammo_F"; - atlOffset=-0.017528534; class CustomAttributes { class Attribute0 @@ -1177,7 +1313,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -1215,7 +1351,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -1273,7 +1409,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -1311,7 +1447,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -1368,7 +1504,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -1444,7 +1580,7 @@ class Mission class Attribute4 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -1611,7 +1747,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -1649,7 +1785,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -1704,7 +1840,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -1742,7 +1878,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -1796,7 +1932,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -1834,7 +1970,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -1888,7 +2024,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -1926,7 +2062,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -1980,7 +2116,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2018,7 +2154,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2071,7 +2207,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2109,7 +2245,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2163,7 +2299,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2201,7 +2337,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2256,7 +2392,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2294,7 +2430,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2349,7 +2485,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2387,7 +2523,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2442,7 +2578,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2480,7 +2616,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2597,7 +2733,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2635,7 +2771,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2689,7 +2825,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2727,7 +2863,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2780,7 +2916,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2818,7 +2954,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2872,7 +3008,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -2910,7 +3046,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -2965,7 +3101,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -3003,7 +3139,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -3058,7 +3194,7 @@ class Mission class Attribute0 { property="ace_isHandcuffed"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleHandcuffed}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleHandcuffed}"; class Value { class data @@ -3096,7 +3232,7 @@ class Mission class Attribute2 { property="ace_isSurrendered"; - expression="if (_value) then {[objNull,[_this],true] call ace_captives_fnc_moduleSurrender}"; + expression="if (_value) then {[objNull, [_this], true] call ace_captives_fnc_moduleSurrender}"; class Value { class data @@ -3266,7 +3402,7 @@ class Mission }; id=213; type="RHS_M2A3_wd"; - atlOffset=-0.0076828003; + atlOffset=-0.16319084; class CustomAttributes { class Attribute0 @@ -3769,7 +3905,7 @@ class Mission }; id=247; type="rhsusf_M1237_M2_usarmy_wd"; - atlOffset=-0.0060005188; + atlOffset=-0.036031723; class CustomAttributes { class Attribute0 @@ -3812,6 +3948,7 @@ class Mission }; id=248; type="rhsusf_M1237_M2_usarmy_wd"; + atlOffset=-0.03014183; class CustomAttributes { class Attribute0 diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml b/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml index e6a363861..e4296d451 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml +++ b/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml @@ -142,7 +142,7 @@ <marker name='blufor_base'>Cargo System:</marker><br/> See ACE3 documentation. <br/><br/> <marker name='blufor_base'>Towing system:</marker><br/> To tow a vehicle interact with it and select the option 'HOOK'.<br/>After that place the tow vehicle in front of it and select 'TOW' in the interaction menu.<br/> If the two vehicles are too far away or the vehicle can't tow that load (Car can't tow truck or tank), the option will be disabled.<br/> To unhook interact with one of the two vehicles and select the option 'UNHOOK'.<br/><br/> <marker name='blufor_base'>Place option:</marker><br/> With this option you can move heavy objects to build small outpost or base.<br/> When you select the option an hint will show all the keys required to move the object. - <marker name='blufor_base'>Fracht-System:</marker><br/> <br/><br/> <marker name='blufor_base'>Abschleppsystem:</marker><br/> Um ein Fahrzeug abzuschleppen muss man mit diesem interagieren und 'EINHACKEN' auswählen.<br/>Als nächstes muss man das Zugfahrzeug vor das abzuschleppende Fahrzeug stellen und über das Interagtionsmenü die Option 'ABSCHLEPPEN' aktivieren.<br/> Zu beachten ist dabei, dass die beiden Fahrzeuge nicht zu weit von einander entfernt sein dürfen. Ebenso ist daruf zu achten, dass das Zugfahrzeug auch das andere Fahrzeug abschleppen kann (zB. Autos können keine Lkw/Panzer abschleppen).<br/> Um das Abschleppseil wieder zu entfernen muss man einen bei einem der beiden Fahrzeuge die Option 'AUSHACKEN' auswählen.<br/><br/> <marker name='blufor_base'>Platzierung von Objekten:</marker><br/> Mit dieser Option können Sie schwere Objekte bewegen, um einen kleinen Außenposten oder eine Basis zu bauen.<br/> Wenn Sie die Option auswählen, zeigt ein Hinweis alle Tasten an, die zum Verschieben des Objekts erforderlich sind. + <marker name='blufor_base'>Fracht-System:</marker><br/>Siehe ACE3 Dokumentation. <br/><br/> <marker name='blufor_base'>Abschleppsystem:</marker><br/> Um ein Fahrzeug abzuschleppen muss man mit diesem interagieren und 'EINHACKEN' auswählen.<br/>Als nächstes muss man das Zugfahrzeug vor das abzuschleppende Fahrzeug stellen und über das Interagtionsmenü die Option 'ABSCHLEPPEN' aktivieren.<br/> Zu beachten ist dabei, dass die beiden Fahrzeuge nicht zu weit von einander entfernt sein dürfen. Ebenso ist daruf zu achten, dass das Zugfahrzeug auch das andere Fahrzeug abschleppen kann (zB. Autos können keine Lkw/Panzer abschleppen).<br/> Um das Abschleppseil wieder zu entfernen muss man einen bei einem der beiden Fahrzeuge die Option 'AUSHACKEN' auswählen.<br/><br/> <marker name='blufor_base'>Platzierung von Objekten:</marker><br/> Mit dieser Option können Sie schwere Objekte bewegen, um einen kleinen Außenposten oder eine Basis zu bauen.<br/> Wenn Sie die Option auswählen, zeigt ein Hinweis alle Tasten an, die zum Verschieben des Objekts erforderlich sind. From 5894c854c3be43298385db9bd27950e13e8b404a Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Tue, 29 May 2018 22:54:10 +0200 Subject: [PATCH 10/13] remove container40, "loaded" variable - impossible to unload - rmv the old test to know if an object is loaded --- =BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf | 1 - .../core/fnc/db/saveObjectStatus.sqf | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf index aa60e5602..5890483db 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -402,7 +402,6 @@ btc_log_def_rc = [ btc_supplies_mat, 8, btc_fob_mat, 8, "Land_Cargo20_military_green_F", 8, - "Land_Cargo40_military_green_F", 16, "B_Slingload_01_Fuel_F", 20, "Land_Pod_Heli_Transport_04_medevac_black_F", 8 ]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/saveObjectStatus.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/saveObjectStatus.sqf index 9e2820834..4c8303e5c 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/saveObjectStatus.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/saveObjectStatus.sqf @@ -2,7 +2,7 @@ params ["_object"]; private _data = []; -if !(_object getVariable ["loaded", false] || !Alive _object || isNull _object) then { +if !(!alive _object || isNull _object) then { _data pushBack (typeOf _object); _data pushBack (getPosWorld _object); From b4071c42f45757c946bcada3f9661cbb4fba428f Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Wed, 30 May 2018 14:41:00 +0200 Subject: [PATCH 11/13] FIX: objects unloading without ace_cargo_size config value - this is correcting the unloading position with the ace_cargo_size define as variable - this can be removed when: https://github.com/acemod/ACE3/pull/6364 is merged --- .../core/fnc/compile.sqf | 2 + .../core/fnc/eh/player.sqf | 1 + .../core/fnc/eh/unload.sqf | 9 ++ .../core/fnc/log/findUnloadPosition.sqf | 127 ++++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf create mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf index bb3f4a9f9..8b2015c58 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf @@ -258,6 +258,7 @@ if (!isDedicated) then { btc_fnc_eh_treatment = compile preprocessFileLineNumbers "core\fnc\eh\treatment.sqf"; btc_fnc_eh_leaflets = compile preprocessFileLineNumbers "core\fnc\eh\leaflets.sqf"; btc_fnc_eh_player = compile preprocessFileLineNumbers "core\fnc\eh\player.sqf"; + btc_fnc_eh_unLoad = compile preprocessFileLineNumbers "core\fnc\eh\unload.sqf"; //FOB btc_fnc_fob_create = compile preprocessFileLineNumbers "core\fnc\fob\create.sqf"; @@ -285,6 +286,7 @@ if (!isDedicated) then { btc_fnc_log_hitch_points = compile preprocessFileLineNumbers "core\fnc\log\hitch_points.sqf"; btc_fnc_log_get_corner_points = compile preprocessFileLineNumbers "core\fnc\log\get_corner_points.sqf"; btc_fnc_log_arsenalData = compile preprocessFileLineNumbers "core\fnc\log\arsenalData.sqf"; + btc_fnc_log_findUnloadPosition = compile preprocessFileLineNumbers "core\fnc\log\findunloadposition.sqf"; //TASK btc_fnc_task_create = compile preprocessFileLineNumbers "core\fnc\task\create.sqf"; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf index 366a2c14d..5ded0d9bf 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf @@ -4,3 +4,4 @@ _player addEventHandler ["Respawn", format ["[%1] call btc_fnc_eh_player_respawn _player addEventHandler ["CuratorObjectPlaced", btc_fnc_eh_CuratorObjectPlaced]; ["ace_treatmentSucceded", btc_fnc_eh_treatment] call CBA_fnc_addEventHandler; _player addEventHandler ["WeaponAssembled", btc_fnc_civ_add_leaflets]; +["ace_unloadCargo", btc_fnc_eh_unLoad] call CBA_fnc_addEventHandler; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf new file mode 100644 index 000000000..0ffd56c94 --- /dev/null +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf @@ -0,0 +1,9 @@ +params ["_item", "_vehicle", ["_unloader", objNull]]; + +private _emptyPosAGL = [_vehicle, _item, _unloader] call btc_fnc_log_findUnloadPosition; + +if (btc_debug) then { + [format ["Corrected position = %1 Old position = %2", _emptyPosAGL distance _vehicle, _vehicle distance _item], __FILE__, [btc_debug, false]] call btc_fnc_debug_message; +}; + +["ace_cargo_serverUnload", [_item, _emptyPosAGL]] call CBA_fnc_serverEvent; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf new file mode 100644 index 000000000..2320a4bee --- /dev/null +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf @@ -0,0 +1,127 @@ +/* + * Author: PabstMirror, ViperMaul + * Find a safe place near a vehicle to unload something. + * Handles Normal Terrain, In Water or On Buildings (Pier, StaticShip). + * + * Arguments: + * 0: Source Vehicle + * 1: Cargo or + * 2: Unloader (player) (default: objNull) + * 3: Max Distance (meters) (default: 10) + * 4: Check Vehicle is Stable (default: true) + * + * Return Value: + * Unload PositionAGL (can Be [] if no valid pos found) + * + * Example: + * [theCar, "CAManBase", player, 10, true] call ace_common_fnc_findUnloadPosition + * + * Public: No + */ + +//Number of tests run (effects performance in worst case scenarior where nothing is found VERSUES reliably finding a pos): +#define MAX_TESTS 75 + +//Manual collision tests (count and radius): +#define COL_TEST_COUNT 12 + +params ["_vehicle", "_cargo", ["_theUnloader", objNull], ["_maxDistance", 10], ["_checkVehicleIsStable", true]]; + +scopeName "main"; + +if (_checkVehicleIsStable) then { + if (((vectorMagnitude (velocity _vehicle)) > 1.5) || {(!(_vehicle isKindOf "Ship")) && {(!isTouchingGround _vehicle) && {((getPos _vehicle) select 2) > 1.5}}}) then { + [] breakOut "main"; + }; +}; + +private _radiusOfItem = 1; +if (_cargo isKindOf "CAManBase") then { + _radiusOfItem = 1.1; +} else { + //`sizeOf` is unreliable, and does not work with object types that don't exist on map, so estimate size based on cargo size + private _typeOfCargo = if (_cargo isEqualType "") then {_cargo} else {typeOf _cargo}; + private _itemSize = if (isNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> "ace_cargo_size")) then { + getNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> "ace_cargo_size"); + } else { + if (["ace_cargo"] call ace_common_fnc_isModLoaded) then { + [_cargo] call ace_cargo_fnc_getSizeItem; + } else { + _radiusOfItem; + }; + }; + if (_itemSize != -1) then { + _radiusOfItem = (_itemSize ^ 0.35) max 0.75; + }; +}; +if (btc_debug) then { + [format ["_radiusOfItem = %1", _radiusOfItem], __FILE__, [btc_debug, false]] call btc_fnc_debug_message; +}; +if (isNull _theUnloader) then {_theUnloader = _vehicle;}; + +//Ideal unload pos is halfway between unloader and vehicle (at the unloader's height) +private _originASL = ((getPosASL _theUnloader) vectorAdd (getPosASL _vehicle)) vectorMultiply 0.5; +_originASL set [2, (getPosASL _theUnloader) select 2]; +private _originAGL = ASLtoAGL _originASL; + +//Do a manual search for empty pos (handles underwater, buildings or piers) +private _rangeToCheck = 0; +while {_rangeToCheck < _maxDistance} do { + private _roundDistance = random _rangeToCheck; + private _roundAngle = random 360; + private _roundAGL = _originAGL vectorAdd [(cos _roundAngle) * _roundDistance, (sin _roundAngle) * _roundDistance, 0]; + + private _roundPointIsValid = false; + if (((AGLtoASL _roundAGL) select 2) > 0) then { + //Shoot a ray down, and make sure we hit something solid like a building or the ground: + private _belowRoundArray = lineIntersectsSurfaces [(AGLtoASL _roundAGL) vectorAdd [0,0,0.5], (AGLtoASL _roundAGL) vectorAdd [0,0,-1]]; + if (!(_belowRoundArray isEqualTo [])) then { + private _aboveBuilding = (_belowRoundArray select 0) select 2; + //Point is above something: Terrain(null) or Building + if ((isNull _aboveBuilding) || {_aboveBuilding isKindOf "Building"}) then { + //Get the real intersection point: + _roundAGL = ASLtoAGL ((_belowRoundArray select 0) select 0); + _roundPointIsValid = true; + }; + }; + } else { + //Underwater, just unload anywhere + _roundPointIsValid = true; + }; + + //Make sure point is valid and do a fast check for people in the way (which sometimes aren't caught by line scaning) + if (_roundPointIsValid && {(_roundAGL nearEntities ["Man", _radiusOfItem]) isEqualTo []}) then { + for "_index" from 0 to (COL_TEST_COUNT -1) do { + //Scan for colisions with objects with lineIntersectsSurfaces + private _angle = _index * (360 / COL_TEST_COUNT); + private _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1]; + private _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, (_radiusOfItem + 0.5)]; + private _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; + if (((count _testIntersections) == 1) && {isNull ((_testIntersections select 0) select 2)}) then { + private _hitGroundASL = (_testIntersections select 0) select 0; + private _hitHeightOffset = ((AGLtoASL _roundAGL) select 2) - (_hitGroundASL select 2); + private _hit2dOffset = _roundAGL distance2D _hitGroundASL; + private _slope = _hitHeightOffset atan2 _hit2dOffset; + if (_slope < 25) then { //Ignore ground hit if slope is reasonable + _testIntersections = []; + }; + }; + if (!(_testIntersections isEqualTo [])) exitWith { + _roundPointIsValid = false; + }; + _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.5]; + _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, 1]; + _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; + if (!(_testIntersections isEqualTo [])) exitWith { + _roundPointIsValid = false; + }; + }; + if (_roundPointIsValid) then { + //Raise it slightly so we don't sink through the floor: + (_roundAGL vectorAdd [0,0,0.05]) breakOut "main"; + }; + }; + _rangeToCheck = _rangeToCheck + (_maxDistance / MAX_TESTS); +}; + +[] //return empty array \ No newline at end of file From cfdd2637b0f306183b03bcc247c818c48df5b31e Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Thu, 31 May 2018 15:52:26 +0200 Subject: [PATCH 12/13] Don't correct position if has a ace_cargo_size config different from -1 --- =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf | 2 ++ .../core/fnc/log/findUnloadPosition.sqf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf index 0ffd56c94..8292f27e8 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf @@ -1,5 +1,7 @@ params ["_item", "_vehicle", ["_unloader", objNull]]; +if (isNumber (configFile >> "CfgVehicles" >> typeOf _item >> "ace_cargo_size") && {getNumber (configFile >> "CfgVehicles" >> typeOf _item >> "ace_cargo_size") != -1}) exitWith {}; + private _emptyPosAGL = [_vehicle, _item, _unloader] call btc_fnc_log_findUnloadPosition; if (btc_debug) then { diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf index 2320a4bee..57b6ed328 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf @@ -41,7 +41,7 @@ if (_cargo isKindOf "CAManBase") then { } else { //`sizeOf` is unreliable, and does not work with object types that don't exist on map, so estimate size based on cargo size private _typeOfCargo = if (_cargo isEqualType "") then {_cargo} else {typeOf _cargo}; - private _itemSize = if (isNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> "ace_cargo_size")) then { + private _itemSize = if (isNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> "ace_cargo_size") && {getNumber (configFile >> "CfgVehicles" >> typeOf _item >> "ace_cargo_size") != -1}) then { getNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> "ace_cargo_size"); } else { if (["ace_cargo"] call ace_common_fnc_isModLoaded) then { From 4ca547c30e01790e48d7b4b4868fb75fe72d530e Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Fri, 1 Jun 2018 08:26:43 +0200 Subject: [PATCH 13/13] Remove the ACE patch, need ACE 3.13 --- .../core/fnc/compile.sqf | 3 - .../core/fnc/eh/player.sqf | 1 - .../core/fnc/eh/unload.sqf | 11 -- .../core/fnc/log/findUnloadPosition.sqf | 127 ------------------ 4 files changed, 142 deletions(-) delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf delete mode 100644 =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf index 5ed20f88c..bb331d0d4 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf @@ -258,7 +258,6 @@ if (!isDedicated) then { btc_fnc_eh_treatment = compile preprocessFileLineNumbers "core\fnc\eh\treatment.sqf"; btc_fnc_eh_leaflets = compile preprocessFileLineNumbers "core\fnc\eh\leaflets.sqf"; btc_fnc_eh_player = compile preprocessFileLineNumbers "core\fnc\eh\player.sqf"; - btc_fnc_eh_unLoad = compile preprocessFileLineNumbers "core\fnc\eh\unload.sqf"; //FOB btc_fnc_fob_create = compile preprocessFileLineNumbers "core\fnc\fob\create.sqf"; @@ -273,7 +272,6 @@ if (!isDedicated) then { btc_fnc_int_shortcuts = compile preprocessFileLineNumbers "core\fnc\int\shortcuts.sqf"; btc_fnc_int_terminal = compile preprocessFileLineNumbers "core\fnc\int\terminal.sqf"; - //INFO btc_fnc_info_ask = compile preprocessFileLineNumbers "core\fnc\info\ask.sqf"; btc_fnc_info_hideout_asked = compile preprocessFileLineNumbers "core\fnc\info\hideout_asked.sqf"; @@ -284,7 +282,6 @@ if (!isDedicated) then { //LOG btc_fnc_log_hitch_points = compile preprocessFileLineNumbers "core\fnc\log\hitch_points.sqf"; btc_fnc_log_get_corner_points = compile preprocessFileLineNumbers "core\fnc\log\get_corner_points.sqf"; - btc_fnc_log_findUnloadPosition = compile preprocessFileLineNumbers "core\fnc\log\findunloadposition.sqf"; //ARSENAL btc_fnc_arsenal_data = compile preprocessFileLineNumbers "core\fnc\arsenal\data.sqf"; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf index 5ded0d9bf..366a2c14d 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf @@ -4,4 +4,3 @@ _player addEventHandler ["Respawn", format ["[%1] call btc_fnc_eh_player_respawn _player addEventHandler ["CuratorObjectPlaced", btc_fnc_eh_CuratorObjectPlaced]; ["ace_treatmentSucceded", btc_fnc_eh_treatment] call CBA_fnc_addEventHandler; _player addEventHandler ["WeaponAssembled", btc_fnc_civ_add_leaflets]; -["ace_unloadCargo", btc_fnc_eh_unLoad] call CBA_fnc_addEventHandler; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf deleted file mode 100644 index 8292f27e8..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/unload.sqf +++ /dev/null @@ -1,11 +0,0 @@ -params ["_item", "_vehicle", ["_unloader", objNull]]; - -if (isNumber (configFile >> "CfgVehicles" >> typeOf _item >> "ace_cargo_size") && {getNumber (configFile >> "CfgVehicles" >> typeOf _item >> "ace_cargo_size") != -1}) exitWith {}; - -private _emptyPosAGL = [_vehicle, _item, _unloader] call btc_fnc_log_findUnloadPosition; - -if (btc_debug) then { - [format ["Corrected position = %1 Old position = %2", _emptyPosAGL distance _vehicle, _vehicle distance _item], __FILE__, [btc_debug, false]] call btc_fnc_debug_message; -}; - -["ace_cargo_serverUnload", [_item, _emptyPosAGL]] call CBA_fnc_serverEvent; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf deleted file mode 100644 index 57b6ed328..000000000 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/findUnloadPosition.sqf +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Author: PabstMirror, ViperMaul - * Find a safe place near a vehicle to unload something. - * Handles Normal Terrain, In Water or On Buildings (Pier, StaticShip). - * - * Arguments: - * 0: Source Vehicle - * 1: Cargo or - * 2: Unloader (player) (default: objNull) - * 3: Max Distance (meters) (default: 10) - * 4: Check Vehicle is Stable (default: true) - * - * Return Value: - * Unload PositionAGL (can Be [] if no valid pos found) - * - * Example: - * [theCar, "CAManBase", player, 10, true] call ace_common_fnc_findUnloadPosition - * - * Public: No - */ - -//Number of tests run (effects performance in worst case scenarior where nothing is found VERSUES reliably finding a pos): -#define MAX_TESTS 75 - -//Manual collision tests (count and radius): -#define COL_TEST_COUNT 12 - -params ["_vehicle", "_cargo", ["_theUnloader", objNull], ["_maxDistance", 10], ["_checkVehicleIsStable", true]]; - -scopeName "main"; - -if (_checkVehicleIsStable) then { - if (((vectorMagnitude (velocity _vehicle)) > 1.5) || {(!(_vehicle isKindOf "Ship")) && {(!isTouchingGround _vehicle) && {((getPos _vehicle) select 2) > 1.5}}}) then { - [] breakOut "main"; - }; -}; - -private _radiusOfItem = 1; -if (_cargo isKindOf "CAManBase") then { - _radiusOfItem = 1.1; -} else { - //`sizeOf` is unreliable, and does not work with object types that don't exist on map, so estimate size based on cargo size - private _typeOfCargo = if (_cargo isEqualType "") then {_cargo} else {typeOf _cargo}; - private _itemSize = if (isNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> "ace_cargo_size") && {getNumber (configFile >> "CfgVehicles" >> typeOf _item >> "ace_cargo_size") != -1}) then { - getNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> "ace_cargo_size"); - } else { - if (["ace_cargo"] call ace_common_fnc_isModLoaded) then { - [_cargo] call ace_cargo_fnc_getSizeItem; - } else { - _radiusOfItem; - }; - }; - if (_itemSize != -1) then { - _radiusOfItem = (_itemSize ^ 0.35) max 0.75; - }; -}; -if (btc_debug) then { - [format ["_radiusOfItem = %1", _radiusOfItem], __FILE__, [btc_debug, false]] call btc_fnc_debug_message; -}; -if (isNull _theUnloader) then {_theUnloader = _vehicle;}; - -//Ideal unload pos is halfway between unloader and vehicle (at the unloader's height) -private _originASL = ((getPosASL _theUnloader) vectorAdd (getPosASL _vehicle)) vectorMultiply 0.5; -_originASL set [2, (getPosASL _theUnloader) select 2]; -private _originAGL = ASLtoAGL _originASL; - -//Do a manual search for empty pos (handles underwater, buildings or piers) -private _rangeToCheck = 0; -while {_rangeToCheck < _maxDistance} do { - private _roundDistance = random _rangeToCheck; - private _roundAngle = random 360; - private _roundAGL = _originAGL vectorAdd [(cos _roundAngle) * _roundDistance, (sin _roundAngle) * _roundDistance, 0]; - - private _roundPointIsValid = false; - if (((AGLtoASL _roundAGL) select 2) > 0) then { - //Shoot a ray down, and make sure we hit something solid like a building or the ground: - private _belowRoundArray = lineIntersectsSurfaces [(AGLtoASL _roundAGL) vectorAdd [0,0,0.5], (AGLtoASL _roundAGL) vectorAdd [0,0,-1]]; - if (!(_belowRoundArray isEqualTo [])) then { - private _aboveBuilding = (_belowRoundArray select 0) select 2; - //Point is above something: Terrain(null) or Building - if ((isNull _aboveBuilding) || {_aboveBuilding isKindOf "Building"}) then { - //Get the real intersection point: - _roundAGL = ASLtoAGL ((_belowRoundArray select 0) select 0); - _roundPointIsValid = true; - }; - }; - } else { - //Underwater, just unload anywhere - _roundPointIsValid = true; - }; - - //Make sure point is valid and do a fast check for people in the way (which sometimes aren't caught by line scaning) - if (_roundPointIsValid && {(_roundAGL nearEntities ["Man", _radiusOfItem]) isEqualTo []}) then { - for "_index" from 0 to (COL_TEST_COUNT -1) do { - //Scan for colisions with objects with lineIntersectsSurfaces - private _angle = _index * (360 / COL_TEST_COUNT); - private _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1]; - private _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, (_radiusOfItem + 0.5)]; - private _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; - if (((count _testIntersections) == 1) && {isNull ((_testIntersections select 0) select 2)}) then { - private _hitGroundASL = (_testIntersections select 0) select 0; - private _hitHeightOffset = ((AGLtoASL _roundAGL) select 2) - (_hitGroundASL select 2); - private _hit2dOffset = _roundAGL distance2D _hitGroundASL; - private _slope = _hitHeightOffset atan2 _hit2dOffset; - if (_slope < 25) then { //Ignore ground hit if slope is reasonable - _testIntersections = []; - }; - }; - if (!(_testIntersections isEqualTo [])) exitWith { - _roundPointIsValid = false; - }; - _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.5]; - _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, 1]; - _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; - if (!(_testIntersections isEqualTo [])) exitWith { - _roundPointIsValid = false; - }; - }; - if (_roundPointIsValid) then { - //Raise it slightly so we don't sink through the floor: - (_roundAGL vectorAdd [0,0,0.05]) breakOut "main"; - }; - }; - _rangeToCheck = _rangeToCheck + (_maxDistance / MAX_TESTS); -}; - -[] //return empty array \ No newline at end of file