edited June 2022 in ORK Scripting
Hey GiL,

I have like enchanting process in the game, that when finished, needs to change item's icon so then it can be displayed in other menus for better visibility.
To ease out things, player has this item always equipped on equipment part 23.
Can you please tell me how do I access the shared player inventory item ID:0 that is already equipped and change the icon?

I assume that I have to use resources folder, where I'll put image name Hammer01, which would be #resources.iconHammer01#.

First I just need to check what equipment variable the equipment has. In order to identify which icon to set, I'm using equipment variables ItemName that always has each equipment name in it:

ORK.Game.Combatant.GetEquipment(int 23).Variables.Get (ItemName, value);

Then based on it I can change the icon:
If (ItemName.value => Hammer01)
ORK.Game.Combatant.GetEquipment(int 23).Icon.Set.resources.iconHammer01;
I have no idea what I'm doing here :)
Post edited by Machal on
  • This gives you access to a combatant's equipment slot (equipment part in ORK 2):
    combatant.Equipment[index]
    index is the ID/index of the equipment slot/part in the editor.
    It has access to the equipment instance (if something is equipped).

    You first need to get the combatant instance, though.
    E.g. you can get the player like this:
    ORK.Game.ActiveGroup.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!
  • edited June 2022
    Can't figure it out.

    Simpler way, how do I access Icon of an item that is set in local selected item variable under key-action?
    Post edited by Machal on
  • Well, the only way to actually change the icon would be to change it in the settings, but this'd change it for all, not just that one instance. This will also not be saved with save games.

    So, there isn't really a way to change the icon of an equipment, item, etc.
    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!
  • Oh well...thanks for letting me know at least.
Sign In or Register to comment.