edited May 2016 in ORK Scripting
Hi there,

I'm having some trouble getting the equipment that is currently on the player. I want to be able to tell things like the bonus Status Values or Effects that the weapon is adding.

I've tried getting it with a few different methods, the most successful being:


StatusChangeInformation statusChange = new StatusChangeInformation(combatant);
combatant.Equipment.GetStatusChanges(ref statusChange);

foreach (int value in statusChange.statusValue)
{
Debug.Log("statusValue " + value);
}


But then I cannot discover a way to link the status bonus to a particular stat (simple because StatusChangeInformation does not keep a reference to it): http://puu.sh/oIQui/6d6c22b073.png

Am I going about this in the wrong way?

Thanks!


Edit: For reference I'm trying to get the following (Status Value and Status Bonus) as seen in the Inventory -> Weapons - http://puu.sh/oIQzC/9d7697512e.png
Post edited by deckrocket on
  • You can access a combatant's equipment part (which has access to the equipment that's equipped there) like this:
    combatant.Equipment[int partID]
    partID is the ID/index of the equipment part.

    E.g. accessing the actual equipment instance/shortcut:
    if(combatant.Equipment[0].Equipped)
    {
    EquipShortcut equipment = combatant.Equipment[0].Equipment;
    }


    Now, you can access stuff on the actual equipment, e.g. using equipment.Settings to access the settings of the equipment (the bonus settings are futher down in the equipment levels). There are also functions to get the bonuses of an equipment.
    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!
  • Thanks a lot that's exactly what I was looking for!
Sign In or Register to comment.