Hello, I am currently implementing custom inventory through scripting.

There are many questions.

1. For the current slot / Max slot,
Is there a way to get the current number of slots in the current inventory?

I wrote the following in the update function.

update() {
maxSlot.text = ORK.InventorySettings.limitValue.value.ToString();

List<IInventoryShortcut> inventory = new List<IInventoryShortcut> ();
ORK.Game.ActiveGroup.Leader.Inventory.GetAll (false, false, true, true, true, false, false, false, -1, false, ref inventory);
currentSlot.text = inventory.Count.ToString();
}

However, this method seems to be expensive because it creates new objects every time. Is there any other way?


2. Is there a method to check whether individual equipShortcut obtained through above GetAll Function is equipped?
(In other words, rather than checking parts as ORK.Game.ActiveGroup.Leader.Equipment[PART_id].Equipped, i want to know how to check whether each equipShortcut instance is equipped with any part.)

like this. if equipShortcut.equipped == true > UnEquipbutton.Interactable = true; but individual check seems not to exist

3.ORK.Game.ActiveGroup.Leader.Equipment.IsEquipped(EquipSet equipSet, int id, int level, int partID)

I just want to know if the equipshortcut instance is equipped somewhere else
(regardless of the equip's level, part id, i want all-Level).
Should I use the above function?

4. ORK.Game.ActiveGroup.Leader.Equipment[1].Available
What exactly does available mean here?
ORK.Game.ActiveGroup.Leader.Equipment[1].PartSetIndex
Is partsetindex returning the index of that part??


5. While playing, I want to pay a certain price (500 gold) and expand the maximum space in the inventory.
Can I do something like this?
And is the limitvalue stored with the save game?
for example. is this code possible??
ORK.InventorySettings.limitValue.value = something;

Thank you!!
  • 1) There are no slots in ORK's inventory.
    The GetAll function doesn't create new objects, it just fills the provided list with the items from the inventory.

    2) Equipped weapons/armors are not in the inventory, i.e. any EquipShortcut obtained from it will never be equipped by a combatant.

    3) Checking if an instance of an equipment is equipped somewhere needs to check the individual equipment parts of the combatant, e.g.:
    if(combatant.Equipment[partID].Equipment == equip)
    partID is the ID/index of the equipment part (e.g. you can cycle through all parts with a for-loop), equip is an EquipShortcut.

    4) Available determines if that equipment part is currently available for the combatant. A combatant always has all parts initialized, if they're available (e.g. due to class/combatant settings or adding temporary parts via other equipment or the event system) can change.

    5) Sure, if you're using the Space Limit options in Inventory > Inventory Settings, you can e.g. use a formula to calculate the limit. This allows you to use a status value of the inventory's owner (when using group inventory, you can also limit that to only use the leader).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.