In this quick tutorial we're going to make a 'unique' item. Items that you can only carry one of at a time. This will be done purely with validators.
For this tutorial, I used the basic Test Inventory ability and Item (Inventory) - Grenades unit, assuming the Grenade is the item we want to be unique. This should be easily translatable between Inventory abilities and other items. Anything that's not explicitly mentioned should probably be left at the default values.
Unique Grenade
Grenade is Target
First, we're going to want to create a Validator that checks if the target is the unique item. This is a Unit Type validator. Value: Item (Inventory) - Grenades
Grenade Limit
Next we'll want to check if the item's already in the inventory. We use a Unit Inventory Contains Item validator. Find: Disabled // Ensures the item in question isn't in the inventory, otherwise it checks if it is Item: Item (Inventory) - Grenades Other Unit: Target Unit: Caster
Unique Grenade
Now we create a Combine validator to check if both of the previously created validators are simultaneously true. Combines +: (Grenade is Target|Grenade Limit) Type: And // Makes sure this is validating both of them
If you throw this Unique Grenade validator on the unit, they will now be able to pick up only a single Grenade. The problem is, now they can only pick up grenades. So we'll need to make a couple more validators to allow them to pick up other non-Grenades.
Inventory Validator
Grenade is not Target
Create another Unit Type validator. This will be very similar to our existing validator of that type. Value: Item (Inventory) - Grenades Find: Disabled // Check if the target is not a Grenade
Inventory Validator
And finally, create another Combine validator to check for all of the above. Combines +: (Grenade is not Target|Unique Grenade) Type: Or // Default value, but I felt it should be mentioned. Checks if either of the above are true.
Now just give the Inventory Validator to the desired Inventory ability. This allows someone to grab the item if the target is a grenade and doesn't already exist in the inventory, or if it's not a grenade.
Enjoy your unique item!
More Unique Items
This can be expanded further to allow more unique items. Simply make another of the Unique Grenade validators and its combined validators and add them to the Inventory Validator.
You'll also want to create a new Combine validator with type And and add the existing Grenade is not Target validator to it, replacing that with the new Combine validator in the Inventory Validator. Then add more * is not Target validators for each one of your unique items to that new Combine validator..
In this quick tutorial we're going to make a 'unique' item. Items that you can only carry one of at a time. This will be done purely with validators.
For this tutorial, I used the basic Test Inventory ability and Item (Inventory) - Grenades unit, assuming the Grenade is the item we want to be unique. This should be easily translatable between Inventory abilities and other items. Anything that's not explicitly mentioned should probably be left at the default values.
Unique Grenade
Grenade is Target
First, we're going to want to create a Validator that checks if the target is the unique item. This is a Unit Type validator.
Value: Item (Inventory) - Grenades
Grenade Limit
Next we'll want to check if the item's already in the inventory. We use a Unit Inventory Contains Item validator.
Find: Disabled
// Ensures the item in question isn't in the inventory, otherwise it checks if it isItem: Item (Inventory) - Grenades
Other Unit: Target
Unit: Caster
Unique Grenade
Now we create a Combine validator to check if both of the previously created validators are simultaneously true.
Combines +: (Grenade is Target|Grenade Limit)
Type: And
// Makes sure this is validating both of themIf you throw this Unique Grenade validator on the unit, they will now be able to pick up only a single Grenade. The problem is, now they can only pick up grenades. So we'll need to make a couple more validators to allow them to pick up other non-Grenades.
Inventory Validator
Grenade is not Target
Create another Unit Type validator. This will be very similar to our existing validator of that type.
Value: Item (Inventory) - Grenades
Find: Disabled
// Check if the target is not a GrenadeInventory Validator
And finally, create another Combine validator to check for all of the above.
Combines +: (Grenade is not Target|Unique Grenade)
Type: Or
// Default value, but I felt it should be mentioned. Checks if either of the above are true.Now just give the Inventory Validator to the desired Inventory ability. This allows someone to grab the item if the target is a grenade and doesn't already exist in the inventory, or if it's not a grenade.
Enjoy your unique item!
More Unique Items
This can be expanded further to allow more unique items. Simply make another of the Unique Grenade validators and its combined validators and add them to the Inventory Validator.
You'll also want to create a new Combine validator with type And and add the existing Grenade is not Target validator to it, replacing that with the new Combine validator in the Inventory Validator. Then add more * is not Target validators for each one of your unique items to that new Combine validator..