Hi there!
The problem I have is that whenever I override what is suppose to happen when the player selects a dialogue options (of a "Start conversation" action), I find that I always adds a "Play speech" action with the exact same text as the dialog option. This gets kind of tedious..
My first idea was to create a custom action "Play dialog speech" that derives from ActionSpeech. The idea was to check it's "parent" action (the previous action in the action list) to get to the label of the dialogue option. But I can't seem to get a reference to my parent action in the Run method...
My second idea was to get to the parent action by accessint the currently running action list through KickStarter.actionListManager, and check the currently active action index (and grab the previous one). But I can't get hold of the currently playing list because it's private...
My third idea was to instead create a custom action that derives from the "Start conversation" action and somehow see if I could intercept the logic for generating a new option there (setting the text of the new action to the label of the dialogue option). But I'm not sure where (if anywhere) I would intercept this logic.
So all my ideas have failed so far
Any ideas?
Comments
My custom speech action that runs after each dialogue option inherits from ActionSpeech so all metadata that you mentioned is actually taken care of, I just want to set the messageText automatically.
The OnClickConversation event you mentioned isn't fired if the option is overridden (which they need to be), and even if it was I don't know how to get hold of the currently active Action which I would need to set the messageText field in the next Action.
I suppose I could loop through all action lists before a scene starts and find all instances of speech actions that appear directly after a conversation action and if their messageText is empty I could set it to the same value as the preceding label, but this seems like a rather heavy handed thing to do in run time