edited August 2014 in ORK Scripting
So onto the next step:

I have to check if the item can be equipped with the current character.
"c1.Inventory.GetEquipment(item.ID, ItemDropType.Weapon).CanEquip(c1)" should do that and "c1.Inventory.GetEquipment(item.ID, ItemDropType.Weapon).Setting.CheckRequirements(c1)" should make sure that the combatant has the required strength or so to wield it.

And then there is this: "combatant.Equipment.Equip(int PartID, EquipShortcut equip, Inventory inventory, bool reset)" which should actually equip the item.

Problem is how do I get the PartID of the item I have leftclicked on. I have "IShortcut item" but there is no "item.GetPartID".

So how do I do that?


  • The CanEquip function already checks all the requirements - you only need to call that function to check if a combatant can equip it.

    The partID of the Equip function refers to the equipment part you want it to equip (i.e. the ID/index of the equipment part). If you set it to -1, the first useable equipment part will be used (i.e. the first part that is enabled in the equipment's settings).
    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!
  • edited August 2014
    That is good to know.

    And as inventory I just use "c1.Inventory", right?

    What does "reset" do?
    Post edited by Kashrlyyk on
  • Yes, use the inventory of the combatant that's equipping something (if there already is something on the equipment part, the weapon/armor will be unequipped and put into that inventory).

    The reset parameter will mark the status of the combatant to do recalculations after changing equipment - you should set this to true. Only set it to false if you're doing multiple equip changes in a row and manually reset it afterwards.
    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.