Closed tdiniz93 closed 7 years ago
You should be able to use the following code in the vehicle's init to change its cargo size, where number is the size.
this setVariable ["ace_cargo_size", 12];
I believe we would prefer an Eden attribute for setting cargo size rather than a module if we add that.
I have another cargo question that doesn't warrant creating another issue, I used the setCarry function, but it only works on small objects, I want to make a base building mission, and would like to use SetCarry to carry hescos, is there a way to do this?
_fnc_makeCarrayble = {
params ["_object"];
diag_log text format ["Making %1 [%2] Carrable", _object, typeOf _object];
[_object, true, [0,0.5,0.3], 0] call ace_dragging_fnc_setCarryable;
};
["Land_HBarrier_01_line_3_green_F", "init", _fnc_makeCarrayble, true, [], true] call CBA_fnc_addClassEventHandler;
Mass of the item also affects carrying, if it's too heavy you can't carry it. I guess you can try modifying the mass of that object.
Decided to take a look into adding eden settings for this. Seems that we're doing a hardcoded check against a vehicle classname (for property ace_cargo_hasCargo
) before adding cargo actions to it - so if we wanted to add a generic cargo space setting for all vehicles that might need to be tweaked slightly.
this setVariable ["ace_cargo_size", 20]
does not work on vehicles from addons. Tested on Vanilla (works), BAF, RHS (no change in inventry size). Compatibility for those mods were not used, script was used on vehicle init.
Original question has been answered, that's why i'm closing this issue, feel free to discuss this further
OK guys, but I have another question - does it work with objects like buildings (i.e. structures ) ? I'm just working on some sort of more-advanced-logistics module for my Group [PGM] and I've prepared some special structures (like small fortifications such as - Hedgehog, Land_fort_bagfence_long etc ) which can be dragged/carried/load into the cargo (under some certain circumstances of course ) .
Now i need to create a special building to store them in my main base - just to make them availible on demand by our engineer troops ( in my plan the troops can go to that 'special' logistic-building and using ACE_Interaction menu on it - unload for instance a Hedgehog_EP1 or any other small structures) . Of course they are well prepared for that sort of functions (dragging/carrying/loading/unloading). Everythign works fine with those small fortifications themself - I can manipulatethem as other boxes or crates. Here ( http://pgm.armaonline.pl/forum/viewtopic.php?f=53&t=532 ) You 've got an evidence that it works properly (of course the topic is written in "strong polish" but screens are rather internationall :) )
But I have a problem because the function _[this_building] call ace_cargo_fncinitVehicle; and after \ [this_building] setVariable ["ace_cargo_space", 150, true]; which I've used in my script doesn't seem to work with buildings (from structures class) , just as it have worked with any containers or vehicles , or it should work (and I have possibly missed something ?) ?
As an attachment - I'll give some code which works pretty well with any vehicle (or container) but I now try to use it with the building ... This is the script - I've placed in the init field of the building:
`//////////////////////////////////////////// // script for test using (non operational) // Fortification cargo building with refilling every _refreshtiem // @author markooff ////////////////////////////////////////////
if (! isServer) exitWith {};
_container = _this select 0; _refreshTime = 300; _container call ace_cargo_fnc_initVehicle;
while {alive _container} do {
private _loaded = _container getVariable ["ace_cargo_loaded", []];
_container setVariable ["ace_cargo_loaded", nil, true]; _container setVariable ["ace_cargo_space", 150, true];
_container call ace_cargo_fnc_validateCargoSpace;
sleep 5;
// here some lines - to fill the cargo space with small fortifications // (I've prepared them for cargo and dragging/carrying first)
sleep _refreshTime; };` As I mentioned above - this script works pretty well with the vehicles or containers I use it for some time in my missions.
I'd like to suggest a module that allows us to assign cargo slots for addon vehicles, right now the RHS LMTVs have the same cargo capacity as the HEMTT, rather than make a new conifg for every vehicle in the RHS compat, can we just get a module that would allow us to assign slots?