Well, finally I'm almost making the Automatic custom Actions and conditions and UI.
Finally I'm getting the Hud UI doing the following (instead of the counters):
On ChestQuestAction, on execute, I save the UI content <QuestContent> on my component chestInteractableParent, passing a reference to <QuestContent> hudContent that I created on my script.
if (hudContentList != null) hudContentList.Add(content);
chestInteractableParent.hudContent = hudContentList[hudContentList.Count - 1];
Finally on my script I do the following: (recover that info and show)
hudContent.originalText.value = NombreUI + ": " + counterChestOpened.ToString() + " / " + CounterChestToOpenlMax.ToString();
QuestMachineMessages.RefreshUIs(this);
So I can show on your UI panel the info.
Everything works great (no errors loading game as the real time counters) BUT, I can't load <QuestContent> when I load the game.... it comes null even when I do the following on the saver:
Saving:
m_data.hudContent = chestInteractableParent.hudContent;
return SaveSystem.Serialize(m_data);
and Loading:
chestInteractableParent.RefreshStateSaver(m_data.EstadoChestParentActual, m_data.countChestOpened, m_data.hudContent);
So basically, do you think I can show the <QuestContent> once I load the game? Any ideas? It doesn't work till I get a new node, that then executes and creates new <QuestContent>, but meanwhile I don't have any UI to show
EDIT: Ok, I start to understand better, when the game loads, it doesn't execute the Execute() on our actual node, therefore it doesn't create again the hudContentList = stateInfo.GetContentList(QuestContentCategory.HUD) so there is nothing to show, as it was created in real time.
So, is not possible that Quest Machine save also the UI created in Real Time? If not... what can be the workaround? Is there any method that execute when the node is active so I can create again the hudContentList and <QuestContent> so I can pass it again to my script?
Thanks!!