LunatiK 21 Report post Posted October 11, 2015 Is someone able and willing to share a script to make this possible?Or is someone interested with helping me with this in another way cuz i already tested it on my own a lot but cant get it to work. Share this post Link to post Share on other sites
Karmafied 14 Report post Posted October 11, 2015 What do you have so far? Share this post Link to post Share on other sites
LunatiK 21 Report post Posted October 12, 2015 What do you have so far?Nothing that works, just made this for testing:ExileServer_object_tree_network_chopTreeRequest/** * Exile Mod * exile.majormittens.co.uk * © 2015 Exile Mod Team * * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ private["_sessionId","_parameters","_treeNetId","_tree","_isTree","_treeModelNames","_treeHeight","_newDamage","_treePosition","_spawnRadius","_weaponHolders","_weaponHolder","_weaponHolderPosition"]; _sessionId = _this select 0; _parameters = _this select 1; _treeNetId = _parameters select 0; _tree = objectFromNetId _treeNetId; if (!isNull _tree) then { _isTree = false; _treeModelNames = getArray(configFile >> "CfgInteractionModels" >> "WoodSource" >> "models"); { if !(((str _tree) find _x) isEqualTo -1)exitWith {_isTree = true}; } forEach _treeModelNames; if (_isTree) then { if (alive _tree) then { _treeHeight = _tree call ExileClient_util_model_getHeight; _treeHeight = _treeHeight max 1; _newDamage = ((damage _tree) + (1 / (floor _treeHeight) )) min 1; _tree setDamage _newDamage; if (_newDamage isEqualTo 1) then { _tree setDamage 999; }; _treePosition = getPosATL _tree; _treePosition set[2, 0]; _spawnRadius = 3; _weaponHolders = nearestObjects[_treePosition, ["GroundWeaponHolder"], _spawnRadius]; _nearestTruck = (getPosATL _tree) nearEntities[["B_Truck_01_transport_F", "O_Truck_03_transport_F", "C_Van_01_box_F", "I_Truck_02_transport_F", "Exile_Car_Van_Black","Exile_Car_Van_Box_Black", "Exile_Car_Van_Fuel_Black", "Exile_Car_Zamak", "Exile_Car_Tempest", "Exile_Car_HEMMT"], 10]; _weaponHolder = objNull; if ( count _nearestTruck > 0) then { _truck = _nearestTruck select 0; _weaponHolder = _truck; }; if (_weaponHolders isEqualTo []) then { _weaponHolderPosition = [_treePosition, _spawnRadius] call ExileClient_util_math_getRandomPositionInCircle; _weaponHolderPosition set [2, 0]; _weaponHolder = createVehicle ["GroundWeaponHolder", _weaponHolderPosition, [], 0, "CAN_COLLIDE"]; _weaponHolder setPosATL _weaponHolderPosition; } else { _weaponHolder = _weaponHolders select 0; }; _weaponHolder addMagazineCargoGlobal ["Exile_Item_WoodLog", 1]; }; }; }; true Share this post Link to post Share on other sites
happydayz 490 Report post Posted October 14, 2015 (edited) --- replace your ExileServer_object_tree_network_chopTreeRequest.sqf with the below code to enable cutting trees straight into the listed vehicles. You can add or remove any vehicles you want this enabled for. Edited October 14, 2015 by happydayz Share this post Link to post Share on other sites
happydayz 490 Report post Posted October 14, 2015 (edited) /** * Exile Mod * exile.majormittens.co.uk * © 2015 Exile Mod Team * * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ private["_sessionId","_parameters","_treeNetId","_tree","_isTree","_treeModelNames","_treeHeight","_newDamage","_treePosition","_spawnRadius","_weaponHolders","_weaponHolder","_weaponHolderPosition","_truck","_nearestTruck"]; _sessionId = _this select 0; _parameters = _this select 1; _treeNetId = _parameters select 0; _tree = objectFromNetId _treeNetId; if (!isNull _tree) then { _isTree = false; _treeModelNames = getArray(configFile >> "CfgInteractionModels" >> "WoodSource" >> "models"); { if !(((str _tree) find _x) isEqualTo -1)exitWith {_isTree = true}; } forEach _treeModelNames; if (_isTree) then { if (alive _tree) then { _treeHeight = _tree call ExileClient_util_model_getHeight; _treeHeight = _treeHeight max 1; _newDamage = ((damage _tree) + (1 / (floor _treeHeight) )) min 1; _tree setDamage _newDamage; if (_newDamage isEqualTo 1) then { _tree setDamage 999; }; //modified by happydayz and LunatiK to allow trees to be cut straight into vehicles! _nearestTruck = (getPosATL _tree) nearEntities[["B_Truck_01_transport_F", "O_Truck_03_transport_F", "C_Van_01_box_F", "I_Truck_02_transport_F", "Exile_Car_Van_Black","Exile_Car_Van_Box_Black", "Exile_Car_Van_Fuel_Black", "Exile_Car_Zamak", "Exile_Car_Tempest", "Exile_Car_HEMMT"], 10]; _weaponHolder = objNull; _truck = _nearestTruck select 0; if ((count _nearestTruck > 0)&&(_truck canAdd "Exile_Item_WoodLog")) then { _truck addMagazineCargoGlobal ["Exile_Item_WoodLog", 1]; } else { _treePosition = getPosATL _tree; _treePosition set[2, 0]; _spawnRadius = 3; _weaponHolders = nearestObjects[_treePosition, ["GroundWeaponHolder"], _spawnRadius]; _weaponHolder = objNull; if (_weaponHolders isEqualTo []) then { _weaponHolderPosition = [_treePosition, _spawnRadius] call ExileClient_util_math_getRandomPositionInCircle; _weaponHolderPosition set [2, 0]; _weaponHolder = createVehicle ["GroundWeaponHolder", _weaponHolderPosition, [], 0, "CAN_COLLIDE"]; _weaponHolder setPosATL _weaponHolderPosition; } else { _weaponHolder = _weaponHolders select 0; }; _weaponHolder addMagazineCargoGlobal ["Exile_Item_WoodLog", 1]; }; }; }; }; trueedited - added in check to see if inventory full before placing in truck - thanks for the reminder nark0t1k! Edited October 14, 2015 by happydayz Share this post Link to post Share on other sites
nark0t1k 40 Report post Posted October 14, 2015 (edited) @happydayzDon't forget to check if(canadd "ITEM") before or the truck can hold more than capacity Edited October 14, 2015 by nark0t1k 2 Share this post Link to post Share on other sites
happydayz 490 Report post Posted October 14, 2015 lol true dat Share this post Link to post Share on other sites
Inactive 18 Report post Posted October 14, 2015 @happydayzDon't forget to check if(canadd "ITEM") before or the truck can hold more than capacityPossible to share this? Would like to use it! Share this post Link to post Share on other sites
nark0t1k 40 Report post Posted October 14, 2015 Not for now sry maybe laterBut not really hard to to Share this post Link to post Share on other sites
LunatiK 21 Report post Posted October 14, 2015 --- replace your ExileServer_object_tree_network_chopTreeRequest.sqf with the below code to enable cutting trees straight into the listed vehicles. You can add or remove any vehicles you want this enabled for. Just made this myself yesterday, i have added a check in my version if weaponholder still is null because you can "dupe" wood when you start without a truck choping a tree, then drive the truck there then it will fill the truck and the weaponholder thats how i stoped this from happening:if ((count _nearestTruck > 0) && (_weaponHolders isEqualTo [])) then Share this post Link to post Share on other sites