Hey GIL,

I've set up the 4-slot shortcuts exactly like in the tutorials.
Now I'm trying to write a script based on what is actually held in those slots.
But I can't seem to get the exact syntax right.
How do I poll the slots to read the ID of the items in them?

Thanks as always.
  • Please don't open multiple threads for the same question, they'll be answered in time :)

    You can get the shortcuts from your combatant's current shortcut list like this:
    IShortcut shortcut = combatant.Shortcuts.Current[index];
    if(shortcut != null)
    {
    int id = shortcut.ID;
    }

    combatant is your combatant (class Combatant), index is the shortcut slot index in the list.
    IShortcut is a general interface for all shortcuts, you can also further check what kind of shortcut it is, e.g. for abilities:
    if(shortcut is AbilityShortcut)
    Or for items:
    if(shortcut is ItemShortcut)
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks.
  • Hey, I just found this and I'm also writing a custom skill mechanic, but have no idea how to assign the skill to the UI slot I have already created. any light in the matter would be awesome!
  • By UI slot, are you refering to a Combatant type HUD using a Shortcut HUD element?

    In that case, just assigning something to the shortcut slot of the combatant should update the UI.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.