Page MenuHomeFeedback Tracker

Missing functionality of CanDisplayCargo()
Need More Info, UrgentPublic

Description

I recently found the CanDisplayCargo() function in the EntityAI class. I wanted to make use of it and wanted to put it into my Items Class and let it return false. I noticed, that the function is never actually called by the Inventory Manager Classes. Would be great to have this option. I know that there is the option to hide the whole inventory from vicinity, but I only want to hide the Cargo Part. Attachments should still be available.

Details

Severity
Feature
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General
Steps To Reproduce

create a class of modify an excisting one and overwrite the CanDisplayCargo(). The Cargo will still be visible

Related Objects

Event Timeline

LBmaster created this task.May 19 2020, 4:37 PM
Geez changed the task status from New to Assigned.May 20 2020, 10:54 AM
Geez changed the task status from Assigned to Need More Info.Jan 8 2021, 12:16 PM
Geez added a subscriber: Geez.

Hello LBmaster.
Can you please check the vanilla scripts? As we are using this for barrels, stashes or vehicles.
Regards,
Geez

Clothing attached to 'CoatRack' still show the cargo when attached.

modded class Clothing
{
    override bool CanDisplayCargo()
    {
        if (!super.CanDisplayCargo())
            return false;

        if (GetHierarchyParent().IsKindOf("CoatRack"))
            return false;

        return true;
    }
}

Alternative solution, which is incorrect and a workaround, is to lock inventory from script on child items, which is unnecessary.

Hello LBmaster.
Can you please check the vanilla scripts? As we are using this for barrels, stashes or vehicles.
Regards,
Geez

This is correct it's being used for those entities, but it's not being handled in the inventory UI, unless this is somehow handled via the engine in some weird way. I've been unable to get this method to work as intended.

modded class Clothing
{      
    override bool CanDisplayCargo()
    {
        return false;
    }
}

thats the code i tried and nothing changed. The cargo was still shown.

This comment was removed by BIS_fnc_KK.