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, free updates and support, please consider supporting me on patreon.com!
  • Thanks.
Sign In or Register to comment.