Unable to correctly check the active dialogue node via OnExecute and change its field value
Posted: Fri Jul 18, 2025 4:39 am
Hello,
I have some issues related to the notification system in my game. On specific dialogue entry nodes, I will use the Scene Event On Execute() method to instantiate notifications via a gameobject's C# script. What I would like to do is to be able to check if a notification has already been instantiated previously on that node, and in such case, ignore the function to instantiate a notification. I have tried to pursue this by adding a new boolean field (notificationWasShown) on those specific nodes and checking it whenever a notification is to be instantiated.
I am having two issues with this:
1) It seems that the OnExecute() method is called before the system actually knows that it has switched from the previous node to the current one. Because of this, I am unable to use the method to get the currently active conversation node and check its boolean field value.
2) Secondly, I couldn't find any clear documentation on how the change a boolean on a dialogue node field via C#. Of course I can use other methods, but this would be cleanest, as the code is run anyways. I've looked into the and methods, but neither seems to be valid in my case?
Thank you in advance for your response.
I have some issues related to the notification system in my game. On specific dialogue entry nodes, I will use the Scene Event On Execute() method to instantiate notifications via a gameobject's C# script. What I would like to do is to be able to check if a notification has already been instantiated previously on that node, and in such case, ignore the function to instantiate a notification. I have tried to pursue this by adding a new boolean field (notificationWasShown) on those specific nodes and checking it whenever a notification is to be instantiated.
I am having two issues with this:
1) It seems that the OnExecute() method is called before the system actually knows that it has switched from the previous node to the current one. Because of this, I am unable to use the
Code: Select all
DialogueManager.currentConversationState.subtitle.dialogueEntry
2) Secondly, I couldn't find any clear documentation on how the change a boolean on a dialogue node field via C#. Of course I can use other methods, but this would be cleanest, as the code is run anyways. I've looked into the
Code: Select all
DialogueLua.SetVariable()
Code: Select all
Field.SetValue
Thank you in advance for your response.