Page MenuHomeFeedback Tracker

VicinitySlotsContainer -> ShowItemsInContainers() moddability
New, UrgentPublic

Description

In order to make an item not appear in the vicinity icon list, you need to adjust the way "visible_items" is built. Currently, the game ignores

  • DayZInfected
  • SurvivorBase
  • Car
  • GardenBase
  • DayZAnimal

In order to have a modded object be ignored there as well, you need to override the whole function and extend the list of OR's. Instead, I would suggest adding an interface to EntitiyAI that would be something like this

class EntitiyAI
{
    ...
    
    bool ShowVicinitySlot()
    {
        return true;
    }
    
    ...
};

And then it allows all the EntityAI based classes that shall be currently ignored in vanilla to override it to return false. This also allows modded objects not to appear in the vicinity icon list by overriding the function with false.

The new implementation to take this function into account would be

void ShowItemsInContainers( array<EntityAI> items )
{
    EntityAI item;
    SlotsIcon icon;
    int x;
    int visible_items_count = 0;
    int visible_rows = 0;
    array<EntityAI> visible_items = new array<EntityAI>;
    
    for( x = 0; x < items.Count(); x++ )
    {
        item = items.Get( x );
        if( item.IsInherited(DayZAnimal) && item.IsAlive() )
        {
            continue;
        }
        else if( !item.ShowVicinitySlot() )
        {
            continue;
        }
        visible_items.Insert( item );
        visible_items_count++;
    }
    ...

It's a rather minor change that does not affect any other systems, so there should be no risk at all implementing this. The benefit for the future base game development and modding is quite obvious.

Details

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

Event Timeline

Arkensor created this task.Apr 17 2019, 2:16 PM
Jacob_Mango added a subscriber: Jacob_Mango.
This comment was removed by NiiRoZz.

No IsInventoryVisible is something different in this regard.