Jump to content

Add Permission to containers

Closed 1.0.8 1.1.0

  "Container bag limits": {
    "Default limits": {
        "Max total bags": 3,
        "Max bags by category name": {
        "bagofholding": 1,
        "generic": 1,
        "armor_clothing": 1,
        "food_medical": 1,
        "items_construction": 1,
        "resources_components": 1,
        "weapons_tools": 1
      }
    },
    "Container Bag limits by permission": [
      {
        "Permission suffix": "vip",
        "Max total bags": 4,
        "Max bags by category name": {
        "bagofholding": 1,
        "generic": 1,
        "armor_clothing": 1,
        "food_medical": 1,
        "items_construction": 1,
        "resources_components": 1,
        "weapons_tools": 1
        }
      },
      {
        "Permission suffix": "elite",
        "Max total bags": 5,
        "Max bags by category name": {
        "bagofholding": 1,
        "generic": 1,
        "armor_clothing": 1,
        "food_medical": 1,
        "items_construction": 1,
        "resources_components": 1,
        "weapons_tools": 1
        }
      },
      {
        "Permission suffix": "legend",
        "Max total bags": 6,
        "Max bags by category name": {
        "bagofholding": 1,
        "generic": 1,
        "armor_clothing": 1,
        "food_medical": 1,
        "items_construction": 1,
        "resources_components": 1,
        "weapons_tools": 1
        }
      },
      {
        "Permission suffix": "unlimted",
        "Max total bags": -1,
        "Max bags by category name": {
        "bagofholding": -1,
        "generic": -1,
        "armor_clothing": -1,
        "food_medical": -1,
        "items_construction": -1,
        "resources_components": -1,
        "weapons_tools": -1
        }
      }
    ]
  },

 

Can you add permission via containers?

 

Also   add permission in bagofholding so players have a limit on being able to do this by permissions lol. I want default to have only 1 row then vip have 2 rows etc.

 

image.png.740fddf0f073e5649da680a83b145ed4.png

Text to show there is an image

image.png

Edited by Mark
Request for permission on Bagofholding

Share this comment


Link to comment

I will look into adding this in the next feature update.

I will have to think about how this will work with container-prefab specific limits, which is a hidden config option that I assume nobody is using (unless they looked at the code and found it). If I decide to keep that feature, or decide to add it back later if someone asks for it, l will probably implement support for permissions under each container prefab definition. For instance, priority would be Specific Container Permission > Specific Container Default > Generic Container Permission > Generic Container Default.

As for your second suggestion, can you clarify? I didn't follow the wording.

Share this comment


Link to comment

Like in the Bag of holding i want to be able to set permissions on how many of each bags they can have.

default = inside bag of holding they can have 6 bags only and i can define how many of each type of bags.

Vip = inside bag of holding they can have 12 bags only and i can define how many of each type of bags.

 

Giving them only 1 bag of holding and multiple bags within bag of holdings with a limit/permission.

Share this comment


Link to comment

Thanks for clarifying.

I'm hesitant to implement bag-in-bag limits by anything other than the direct parent bag, primarily because bags can be moved between players and containers, creating potential scenarios for abuse.

For example, I could have my friend who is a VIP organize my bags and give them back to me in a state that I could not have possibly created by myself.

There are multiple ways to mitigate such abuse, but each solution creates more problems that need to be identified and solved. For example, the plugin could prevent me from picking up a bag that has more inner bags than I am allowed, but then the plugin also needs to communicate to me precisely why it isn't allowed and how to resolve the issue. That may already be a bit of a problem today, but the problem increases as the number and complexity of pickup rejection reasons increases. Alternatively, the plugin could allow me to pick up the bag, but items could be automatically ejected from the bag in the process, but that isn't an ideal experience. Another alternative is to allow the bag to be picked up, and then partially disable bags over the limit, only allowing items to be removed but not added, but this could still be abused to some extent. Perhaps a time limit could be imposed where I am issued a warning that items will be ejected if I do not reconcile the limit within a period of time, which would allow me to help my VIP friend reorganize the loot in their base without disruption, though this would also have to be carefully done so the player cannot simply drop and pick up the bag again to reset the timer.

It's also worth noting that there are already approximate solutions available. For example, you could let your players have Backpacks, then configure the Backpack bag limits according to permission. You could also create alternate bag profiles, such as VIP Bag of Holding, which only a VIP can hold, which has different limits defined.

Share this comment


Link to comment
Quote

It's also worth noting that there are already approximate solutions available. For example, you could let your players have Backpacks, then configure the Backpack bag limits according to permission. You could also create alternate bag profiles, such as VIP Bag of Holding, which only a VIP can hold, which has different limits defined.

Could you give me an example?

Share this comment


Link to comment

I'll describe how to implement the VIP bag approach.

  1. Create a new content ruleset. Just copy/paste the bagofholding ruleset, change its name to bagofholdingvip, and configure its bag limits how you want.
  2. Create a new bag profile. Just copy/paste the bagofholding profile, change its name to bagofholdingvip, change its content ruleset to bagofholdingvip (or whatever you named it in step 1), and change its display name to "VIP Bag of Holding" so players can tell the difference. You could also change the skin ID if you want to change its appearance.
  3. Create a new bag limit permission. Just copy/paste one of the other ones and configure its permission suffix and limits how you want. Make sure to configure this to allow at least 1 VIP Bag of Holding. Then grant that permission to your VIP group.
  4. Update the original Bag of Holding profile upgrade target to be the VIP Bag of Holding, with no cost. This will allow players to upgrade from the Bag of Holding to the VIP Bag of Holding if they have permission. Then grant the bagofholding.upgrade.bagofholding permission to your VIPs so they can upgrade from the normal Bag of Holding to the VIP Bag of Holding. You could technically grant this permission to normal players, but the plugin won't allow them to purchase the upgrade while the bag is in their inventory because it would cause them to go beyond their bag limit (limit of 0 VIP bags).

If you want to create multiple tiers of VIP bags, you can simply repeat this process for each type of bag. You can also chain the upgrades: vip > elite > legend.

Edited by BlackLightning

Share this comment


Link to comment

Looking at the example config, I don't think that's what I meant.

If I understood correctly, you wanted for example, to allow non-VIPs to hold 6 bags inside their Bag of Holding, and to allow VIPs to hold 12 bags inside their Bag of Holding. The steps I described would create a new type of bag called VIP Bag of Holding with the following characteristics.

  • Only VIPs can carry it
  • It can hold 12 inner bags instead of 6
  • It can be created by upgrading the normal Bag of Holding

#1: Create a new Content Ruleset

In this example, the vipbagofholding Content Ruleset differs from the original bagofholding Content Ruleset only in the number of bags it can hold. This will later be assigned to the new VIP Bag of Holding Bag Profile to allow that type of bag to hold 12 bags instead of 6.

"Bag content rulesets": [
  {
    "Name": "bagofholding",
    "Allowed item categories": [
      "All"
    ],
    "Disallowed item categories": [],
    "Allowed item short names": [],
    "Disallowed item short names": [],
    "Allowed skin IDs": [],
    "Disallowed skin IDs": [],
    "Bag limits": {
      "Max total bags": 6,
      "Max bags by category name": {
        "bagofholding": 0,
        "vipbagofholding": 0
      }
    }
  },
  {
    "Name": "vipbagofholding",
    "Allowed item categories": [
      "All"
    ],
    "Disallowed item categories": [],
    "Allowed item short names": [],
    "Disallowed item short names": [],
    "Allowed skin IDs": [],
    "Disallowed skin IDs": [],
    "Bag limits": {
      "Max total bags": 12,
      "Max bags by category name": {
        "bagofholding": 0,
        "vipbagofholding": 0
      }
    }
  },
]

#2: Create a new Bag Profile

In this example, the vipbagofholding Bag Profile differs from the bagofholding Bag Profile in the following ways.

  • Different name
  • Different display name
  • Different category name
  • Different contents ruleset

In addition, bagofholding is now upgradable to vipbagofholding.

"Bag profiles": [
  {
    "Name": "bagofholding",
    "Skin ID": 2824136143,
    "Capacity": 48,
    "Display name": "Bag of Holding",
    "Category name": "bagofholding",
    "Contents ruleset": "bagofholding",
    "Upgrade": {
      "To": "vipbagofholding",
      "Cost": {
        "Item short name": "scrap",
        "Item skin ID": 0,
        "Amount": 0,
        "Use Economics": false,
        "Use Server Rewards": false
      }
    },
    "Recyclable": {
      "Enabled": false,
      "Ingredients": [
        {
          "Item short name": "scrap",
          "Item skin ID": 0,
          "Amount": 1500,
          "Item display name": ""
        }
      ]
    }
  },
  {
    "Name": "vipbagofholding",
    "Skin ID": 2824136143,
    "Capacity": 48,
    "Display name": "VIP Bag of Holding",
    "Category name": "vipbagofholding",
    "Contents ruleset": "vipbagofholding",
    "Recyclable": {
      "Enabled": false,
      "Ingredients": [
        {
          "Item short name": "scrap",
          "Item skin ID": 0,
          "Amount": 1500,
          "Item display name": ""
        }
      ]
    }
  }
]

#3: Create a new Bag Limit Permission

In this example, default players will be able to hold 3 total bags in their inventory, 0 of which may be a vipbagofholding (this refers to the bag category, not the bag name). Players with the bagofholding.limit.player.vip permission may hold 3 total bags in their inventory, all of which may be a vipbagofholding.

"Player bag limits": {
  "Default limits": {
    "Max total bags": 3,
    "Max bags by category name": {
      "vipbagofholding": 0
    }
  },
  "Bag limits by permission": [
    {
      "Permission suffix": "vip",
      "Max total bags": 3,
      "Max bags by category name": {}
    },
    {
      "Permission suffix": "unlimited",
      "Max total bags": -1,
      "Max bags by category name": {}
    }
  ]
},

 

Share this comment


Link to comment
486.8k

Downloads

Total number of downloads.

2.7k

Customers

Total customers served.

36.5k

Files Sold

Total number of files sold.

612.1k

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.