Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module to assign cargo slots #4283

Closed
tdiniz93 opened this issue Aug 22, 2016 · 8 comments
Closed

Module to assign cargo slots #4283

tdiniz93 opened this issue Aug 22, 2016 · 8 comments
Assignees

Comments

@tdiniz93
Copy link

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?

@jonpas
Copy link
Member

jonpas commented Aug 22, 2016

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.

@tdiniz93
Copy link
Author

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; 

@jonpas
Copy link
Member

jonpas commented Aug 23, 2016

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.

@kymckay kymckay self-assigned this Dec 20, 2016
@kymckay
Copy link
Member

kymckay commented Dec 20, 2016

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.

@kymckay kymckay mentioned this issue Dec 20, 2016
4 tasks
@Pasrules
Copy link

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.

@bux bux closed this as completed May 24, 2017
@bux
Copy link
Member

bux commented May 24, 2017

Original question has been answered, that's why i'm closing this issue, feel free to discuss this further

@markooff
Copy link
Contributor

markooff commented Nov 6, 2017

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_fnc_initVehicle;
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 ?) ?

@markooff
Copy link
Contributor

markooff commented Nov 6, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants