Custom timer & triggering events at dialogue lines
Posted: Mon May 11, 2020 7:58 am
Hello, again ,
I am trying to create a custom quest timer. After a lot of research the only solution that I was able to work with was AddLuaObserver(). As a general idea, I found it very difficult to trigger custom events depending on the ongoing dialogue line (subtitle). And I don't mind using the lua observer but I just don't think it would be a good ideea to have a lot of subscribers that need to check something every Update() and also having to keep track of the subscriptions (in case a lot of action is happening in one scene).
I would like to have a system where there is a Quest class that has attributes like OnFailed(), OnStart(), OnSuccess(), a variable isTimed and the QuestTimer class (which handles counting and displaying the timer)
A reference in the DialogueManager of the quest timer and every time a quest starts the DialogueManager should also start the timer (if the isTimed attribute of the quest is true).
So my question is is there a smarter alternative to do this? I would gladly try to implement what I've mentioned above but I'm afraid that future updates will not be compatible anymore (since I am editing the DialogueManager class)
Thanks
I am trying to create a custom quest timer. After a lot of research the only solution that I was able to work with was AddLuaObserver(). As a general idea, I found it very difficult to trigger custom events depending on the ongoing dialogue line (subtitle). And I don't mind using the lua observer but I just don't think it would be a good ideea to have a lot of subscribers that need to check something every Update() and also having to keep track of the subscriptions (in case a lot of action is happening in one scene).
I would like to have a system where there is a Quest class that has attributes like OnFailed(), OnStart(), OnSuccess(), a variable isTimed and the QuestTimer class (which handles counting and displaying the timer)
A reference in the DialogueManager of the quest timer and every time a quest starts the DialogueManager should also start the timer (if the isTimed attribute of the quest is true).
So my question is is there a smarter alternative to do this? I would gladly try to implement what I've mentioned above but I'm afraid that future updates will not be compatible anymore (since I am editing the DialogueManager class)
Thanks