I'm building a custom editor tool where I want to display an organised and optionally filtered list of Combatants. I want to add a category filter where the user can view only combatants that belong to that category. After searching through the docs, CombatantType seems to do what I want.
I can't seem to find more documentation or tutorials on this subject, and I'm wondering what the "Item Type" property actually represents. What is the function of CombatantType and how should it be used?
The combatant type can be used for different things, e.g. organizing your stuff in the editor, have additional content information on combatants, do condition checks, use it in bestiary menus, etc.
The item type on combatants is purely for selling them in shops :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
ORKFramework.ORK reference doesn't seem to work at editor time. It appears to not be initialized, but if I do initialize it myself, it stops working (main menu no longer shows) when I enter play mode. How should I get a reference to the list of combatants in the editor?
This is probably too good to be true, but by any chances, is the code for search/filter combatants usable outside the ORK Framework Editor?
If you wanna go with prefabs and a custom editor, you need to initialize ORK to be able to access the data, put this as the first thing in your editor code, before accessing any ORK data:
if(!ORK.Instantiated)
{
ORK.Initialize(ORKAssetHelper.LoadORKProject());
}
The search/filter stuff can't be used outside the ORK editor, it's too specific for that part to be used elsewhere :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
More specifically, if I have already initialized ORK in the editor, then when I enter play mode, the _ORK UI canvas is not created.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Also, it seems like when instantiated is called, I am reading all the latest, unsaved changes from the project asset, while these changes may still be discarded. Therefore I'm assuming ORK's own editor scripts are actually using a private copy of the project asset - is that not the case?
Edit: making the editor window not initialize ORK if we are exiting editor mode fixes this, but I think game starter should probably still create the main menu even if ORK is initialized.
For calling the main menu, it's better to handle that in Menus > Main Menu, the game starter just has some options for quick testing these things :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!