edited September 2019 in ORK Scripting
Hi,

I try to update the combatant that a Combatant HUD will display in runtime. For this, I create a Combatant HUD with Combatant Type set to Group (since I want the menu to always be displayed at the same place), I check "'Limit List Length", set "Maximum Length" to 1, and then I simply need to modify "Start Index Offset" so it corresponds to the Combatant index I click on.

So, to change Start Index Offset with code, I think I need to set a property of ORKFramework.UI.CombatantHUDSetting with ObjectData.Set. However, my issue is that I can't find a way to get to that class. I can get the HUDSetting with ORK.HUDs.Get(), but I can't find any function that return a CombatantHUDSetting...

Any idea where it is?

Thanks!
Post edited by ArsMagika on
  • Oh! Never mind. I found the answer by myself... You simply need to use HUDSetting.settings.GetData(), then modify the data with DataObject.Set() and finally set it back with HUDSetting.settings.SetData().
  • Or directly set that setting:
    ((CombatantHUDSetting)ORK.HUDs.Get(index).settings).groupStartOffset = value;
    index is the ID/index of the HUD (make sure it's a combatant HUD, or there'll be an error from the type cast), value the new offset.
    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! I missed the cast. Indeed your method is simpler and I will use it!
Sign In or Register to comment.