Release: See how much space you have left in that tent!

there is already something like this its called CARGO CHECK... and works well so far =)
you select cargocheck from the scrollmenu... and voila... it shows how much space is left

but where is the content shown with your script?
maybe you can post a screenshot?
 
It's displayed in the Gear UI
20130417141327522.png


But it seems that AlienX forgot about the backpacks ;)
A little fix:

Code:
private [ "_lookingat", "_type", "_maxGuns", "_maxMags", "_maxBags", "_cntGuns", "_cntMags", "_cntBags", "_fndDisplay", "_fndDisplay_Visible", "_dispEnum", "_dispControl", "_dispControlInitText", "_distance", "_typeName" ];
 
waitUntil {!isNil ("dayzLoginRecord")};
 
disableSerialization;
 
_dispControlInitText = "";
_lookingat = objNull;
 
while {true} do
{
    sleep 0.5;
    _fndDisplay = findDisplay 106;
    _fndDisplay_Visible = ( (str _fndDisplay) != "No display");
 
    if ( _fndDisplay_Visible ) then {
        if ( !isNull cursorTarget ) then {
            if ( isNull _lookingat ) then {
                _lookingat = cursorTarget;
            };
            _type = typeOf _lookingat;
            _distance = ((getPos _lookingat) distance (getPos player));
 
            if ( _distance < 10.5 ) then {
                _maxGuns = getNumber(configFile >> "cfgVehicles" >> _type >> "transportMaxWeapons");
                _maxMags = getNumber(configFile >> "cfgVehicles" >> _type >> "transportMaxMagazines");
_maxBags = getNumber(configFile >> "cfgVehicles" >> _type >> "transportmaxbackpacks");
         
                if ( (_maxGuns + _maxMags + _maxBags) > 0 ) then {
                    _typeName = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
                    _cntGuns = 0;
                    _cntMags = 0;
_cntBags = 0;
             
                    {
                        _cntGuns = _cntGuns + _x;
                    } foreach ( (getWeaponCargo _lookingat) select 1 );
             
                    {
                        _cntMags = _cntMags + _x;
                    } foreach ( (getMagazineCargo _lookingat) select 1 );
 
{
_cntBags = _cntBags + _x;
                    } foreach ( (getWeaponCargo _lookingat) select 1 );
             
                    _dispControl = _fndDisplay displayCtrl 1001; //156 is the title of the object (eg "old camping tent"), however it flashes every half a second or so - makes it unuseable... 1001 is the title of the dialog.
             
                    if ( _dispControlInitText == "" ) then {
                        _dispControlInitText = ctrlText _dispControl;
                    };
             
                    _dispControl ctrlSetText format [ "%8 (%2/%3 %4/%5 %6/%7)", _dispControlInitText, _cntGuns, _maxGuns, _cntMags, _maxMags, _cntBags, _maxBags, _typeName];
                };
            };
        };
    } else {
        _lookingat = objNull;
        _dispControlInitText = "";
    };
};
 
Uhm.... sorry to tell you that but it seems that tomorrow it's the release of dayz 1.7.7 and that will come with it^^.
But thanks anyway.
 
it seems that tomorrow it's the release of dayz 1.7.7
i believe it when i see it ^^


and this could also come in handy on my origins server...
had installed the other cargo check too...
lets see if this works too
 
Thanks for the heads up about backpacks cyrq - totally forgot about them!

J3T: If that happens, then yaaay - if not then whatever :)
 
ha... i knew it... ^^
because of steam... wtf?
so everyone can update dayz with playwithsix or with dayzcommander... no one needs steam for this if they are not able to get their updates out in time...
and shame on steam... only one guy can make this update public... what happens if he dies?

otherwise... what would have happened if rocket fell of this fucking mountain?
no more updates because he has the key files to sign the files...
no standalone..

so why would i let this guy climb around on a mountain like a monkey if he is the only one who is responsible for the whole project?
and the whole project stands and falls (lol) with him (omg) ^^
 
Well that is a shame indeed - as Gagi2 said, why not just release it over DayZ Commander or Six?!

Ah well.
 
It's displayed in the Gear UI
20130417141327522.png


But it seems that AlienX forgot about the backpacks ;)
A little fix:

Code:
private [ "_lookingat", "_type", "_maxGuns", "_maxMags", "_maxBags" "_cntGuns", "_cntMags", "_cntBags "_fndDisplay", "_fndDisplay_Visible", "_dispEnum", "_dispControl", "_dispControlInitText", "_distance", "_typeName" ];
 
waitUntil {!isNil ("dayzLoginRecord")};
 
disableSerialization;
 
_dispControlInitText = "";
_lookingat = objNull;
 
while {true} do
{
    sleep 0.5;
    _fndDisplay = findDisplay 106;
    _fndDisplay_Visible = ( (str _fndDisplay) != "No display");
 
    if ( _fndDisplay_Visible ) then {
        if ( !isNull cursorTarget ) then {
            if ( isNull _lookingat ) then {
                _lookingat = cursorTarget;
            };
            _type = typeOf _lookingat;
            _distance = ((getPos _lookingat) distance (getPos player));
 
            if ( _distance < 10.5 ) then {
                _maxGuns = getNumber(configFile >> "cfgVehicles" >> _type >> "transportMaxWeapons");
                _maxMags = getNumber(configFile >> "cfgVehicles" >> _type >> "transportMaxMagazines");
_maxBags = getNumber(configFile >> "cfgVehicles" >> _type >> "transportmaxbackpacks");
         
                if ( (_maxGuns + _maxMags + _maxBags) > 0 ) then {
                    _typeName = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
                    _cntGuns = 0;
                    _cntMags = 0;
_cntBags = 0;
             
                    {
                        _cntGuns = _cntGuns + _x;
                    } foreach ( (getWeaponCargo _lookingat) select 1 );
             
                    {
                        _cntMags = _cntMags + _x;
                    } foreach ( (getMagazineCargo _lookingat) select 1 );
 
{
  _cntBags = _cntBags + _x;
                    } foreach ( (getWeaponCargo _lookingat) select 1 );
             
                    _dispControl = _fndDisplay displayCtrl 1001; //156 is the title of the object (eg "old camping tent"), however it flashes every half a second or so - makes it unuseable... 1001 is the title of the dialog.
             
                    if ( _dispControlInitText == "" ) then {
                        _dispControlInitText = ctrlText _dispControl;
                    };
             
                    _dispControl ctrlSetText format [ "%8 (%2/%3 %4/%5 %6/%7)", _dispControlInitText, _cntGuns, _maxGuns, _cntMags, _maxMags, _cntBags, _maxBags, _typeName];
                };
            };
        };
    } else {
        _lookingat = objNull;
        _dispControlInitText = "";
    };
 
 
};

Sorry to bother you sirs but the fix doesn't seem to work on my server although alienx's did. Help.
 
There ware some syntax errors as I edited this on the fly in the forum editor.
This should be ok:

Code:
private [ "_lookingat", "_type", "_maxGuns", "_maxMags", "_maxBags", "_cntGuns", "_cntMags", "_cntBags", "_fndDisplay", "_fndDisplay_Visible", "_dispEnum", "_dispControl", "_dispControlInitText", "_distance", "_typeName" ];
 
waitUntil {!isNil ("dayzLoginRecord")};
 
disableSerialization;
 
_dispControlInitText = "";
_lookingat = objNull;
 
while {true} do
{
    sleep 0.5;
    _fndDisplay = findDisplay 106;
    _fndDisplay_Visible = ( (str _fndDisplay) != "No display");
 
    if ( _fndDisplay_Visible ) then {
        if ( !isNull cursorTarget ) then {
            if ( isNull _lookingat ) then {
                _lookingat = cursorTarget;
            };
            _type = typeOf _lookingat;
            _distance = ((getPos _lookingat) distance (getPos player));
 
            if ( _distance < 10.5 ) then {
                _maxGuns = getNumber(configFile >> "cfgVehicles" >> _type >> "transportMaxWeapons");
                _maxMags = getNumber(configFile >> "cfgVehicles" >> _type >> "transportMaxMagazines");
                _maxBags = getNumber(configFile >> "cfgVehicles" >> _type >> "transportmaxbackpacks");
     
                if ( (_maxGuns + _maxMags + _maxBags) > 0 ) then {
                    _typeName = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
                    _cntGuns = 0;
                    _cntMags = 0;
                    _cntBags = 0;
         
                    {
                        _cntGuns = _cntGuns + _x;
                    } foreach ( (getWeaponCargo _lookingat) select 1 );
         
                    {
                        _cntMags = _cntMags + _x;
                    } foreach ( (getMagazineCargo _lookingat) select 1 );
 
                    {
                        _cntBags = _cntBags + _x;
                    } foreach ( (getWeaponCargo _lookingat) select 1 );
         
                    _dispControl = _fndDisplay displayCtrl 1001; //156 is the title of the object (eg "old camping tent"), however it flashes every half a second or so - makes it unuseable... 1001 is the title of the dialog.
         
                    if ( _dispControlInitText == "" ) then {
                        _dispControlInitText = ctrlText _dispControl;
                    };
         
                    _dispControl ctrlSetText format [ "%8 (%2/%3 %4/%5 %6/%7)", _dispControlInitText, _cntGuns, _maxGuns, _cntMags, _maxMags, _cntBags, _maxBags, _typeName];
                };
            };
        };
    } else {
        _lookingat = objNull;
        _dispControlInitText = "";
    };
};
 
cyrq, i see you have used gui ID 1001, i had major issues with that with the text constantly flashing - do you have the same problem at all?

(happens a lot when looking at gear on helis).
 
1.7.7 is now released - yay!
I guess i will keep the post here for people who still wish to run a 1.7.6.1 server :)

Happy coding!
 
Great mod!! My players are so happy with this. It doesn't work only for tents but for vehicles as well.

Two minor issues:

- When you open up the gear menu for something you can't store anything in, e.g. a bunch of stuff that's on the ground and you want to pick it up, you see a calculation in the gear menu.
- You don't always see space left in the tent, sometimes it works, sometimes it doesn't and you'll have to open the gear menu 2 or 3 times for it to display.
 
Back
Top