But the above doesn't even compile, complaining that ItemToAdd is overloading AddItem.
// The ItemID we want to add
int ItemID;
public void AddItem(){
// Get my Combatant / Player
Combatant TestCombatant = ComponentHelper.GetCombatant(gameObject);
// Create an IShortcut. Place the data from the ORK Items database that matches the ItemID.
IShortcut ItemToAdd = ORK.Items.data[ItemID] as IShortcut;
// Add the Item to the player's inventory.
TestCombatant.Inventory.AddItem(ItemToAdd);
}
It looks like you're new here. If you want to get involved, click one of these buttons!
ItemShortcut item = new ItemShortcut(int itemID, int quantity);
itemID is the index/ID of the item, quantity the quantity of the item.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Thank you for responding, but that doesn't seem to solve the problem.
Is the final line correct?
TestCombatant.Inventory.AddItem(item);
because that is the line that is giving me an overload error.
error CS1501: No overload for method `AddItem' takes `1' arguments
Yeah, that was the problem. I ignored filling in all the arguments. Gotta remember not to assume they are default arguments.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!