1. As Mentioned i need a way to loop through all items that use the BoxStorage Class. so far i have managed to find:
    Code:
    foreach (var item in ItemManager.GetItemDefinitions())
    {
        var itemdeployable = item?.GetComponent<ItemModDeployable>();
        if (itemdeployable == null) continue;
        if (item.category.ToString() != "Items" && !item.spawnAsBlueprint) continue;
        Puts(item.displayName.english + "\n" + item.shortname);
    }
    but sadly the ItemModDeploable doesnt seem to have a reference to the original object. any pointers to where i need to look would be greatly apprechiated.
    [DOUBLEPOST=1525775690][/DOUBLEPOST]and before anyone sais it i have been browsing the Assembly-CSharp dll for the last 2 hours without progreess
     
  2. var containers = UnityEngine.Object.FindObjectsOfType<StorageContainer>();
    foreach (StorageContainer container in containers)
    {

    }
     
  3. not what i was looking for. i want all the base items. not every instance of the class. i want to dynamically create a json file with every BoxStorage container item. so i want to loop every Box storage container and end up with this:

    Small Wood Box
    Large Box
    Fridge

    not:
    Small Wood Box
    Small Wood Box
    Small Wood Box
    Small Wood Box
    Small Wood Box
    Small Wood Box
    Fridge
    Fridge
    Fridge
    Fridge
    Fridge
    Fridge
    Large Box
    Large Box
    Large Box
    Large Box
     
  4. So you want all the prefabs that have container function? or are you looking for it in the world? An example of what you would use it for might help explain what your looking for
     
  5. well i am trying to generate a settings file for every different kind of item in the game. that means looping through every prefab with the StorageContainer Class and listing its name. that way i will generate a json file in which you can disable or enable certain items
     
  6. So I think I understand better now, so you want to blacklist an entity from spawning/crafting/using something? if that's the case than just dumping all assets, and setting up functions to make it uncraftable/unusable/unspawnable. is this more of what your trying to go for? if that is the case than I think it would be far easier to just to list out the assets, and not worry about every entity group than just use wild cards to find what you wants and filter it from there, than use maybe use a foreach try loop to verify that it has the functions that you want in the group on startup?
     
  7. no?

    i have a plugin that teleports players between objects and i want admins to be able to disable any object they want to. this is to prevent players beeing able to use vending machines as teleports or some other thing that an admin might not want
     
  8. Then just create a list like
    List<string> uniqueStorageContainerTypes

    and my function above:

    var containers = UnityEngine.Object.FindObjectsOfType<StorageContainer>();
    foreach (StorageContainer container in containers)
    {
    if(!uniqueStorageContainerTypes.Contains(container.ShortPrefabName))
    {
    uniqueStorageContainerTypes.Add(container.ShortPrefabName);
    }
    }

    at the end you get uniqueStorageContainerTypes with all available types of StorageContainer and work with them
     
  9. That code's faulty. Firstly, you can call Distinct, secondly, if the boxes aren't placed you won't get them.