I'm trying to change the text of the TMPro component on an NPC via the sequencer by means of inputting a string in the sequencer. So I'm looking at something like this, SetTMPUI(NPCText, string).
I saw this on the forum but this required a preexisting Dialogue Manager variable to assign. I was trying to customize it to take in the string but failed to do so. As such, I was wondering if you know of a way I can go about doing this!
Tony Li wrote: ↑Mon Nov 23, 2020 10:18 am
Hi Keiji,
Also, I'm having two difficulties with my project.
Since I'm using responses for my conversations, my sequencer commands do not play at the start during the conversation trigger but rather after. I've tested it for the response menu sequence as well and likewise, it doesn't play from the start. Not sure if you know any way I can get around this, or have the sequencer play the moment the response menu is activated?
The second difficulty is trying to get the NavMeshAgent(destination, AINpc)-> Message(Arrived); command to send a message after it's done arriving. It always seems to send the message at the instance it starts playing rather than at the arrival state.
My follow-up action will be AnimatorPlay(state name, NPC)@Message(Arrived).
I'm guessing this has to do with the response menu? Perhaps I can find your thoughts or solutions to this!
domopuff wrote: ↑Sat Jun 18, 2022 10:41 pmI'm trying to change the text of the TMPro component on an NPC via the sequencer by means of inputting a string in the sequencer. So I'm looking at something like this, SetTMPUI(NPCText, string). [Cut SequencerCommandSetTMPUI.cs example]
How are you inputting a string? Can you use the TextInput() sequencer command? If so, this will set a DS variable value. You could them use that custom SetTMPUI() sequencer command to show the variable value.
domopuff wrote: ↑Sun Jun 19, 2022 12:07 amSince I'm using responses for my conversations, my sequencer commands do not play at the start during the conversation trigger but rather after. I've tested it for the response menu sequence as well and likewise, it doesn't play from the start. Not sure if you know any way I can get around this, or have the sequencer play the moment the response menu is activated?
What if you add a Response Menu Sequence to the NPC node that precedes the response menu?
domopuff wrote: ↑Sun Jun 19, 2022 12:07 amThe second difficulty is trying to get the NavMeshAgent(destination, AINpc)-> Message(Arrived); command to send a message after it's done arriving. It always seems to send the message at the instance it starts playing rather than at the arrival state.
My follow-up action will be AnimatorPlay(state name, NPC)@Message(Arrived).
The NavMeshAgent() sequencer command just sets the destination; it doesn't wait for the agent to reach the destination. You could try the NavMeshDestination() sequencer command from this forum post.
For the string query, I went ahead with creating a DS variable and used the SetVariable to update the NPC dialogue text while referencing the DS variable.
For the response menu, I think that works but I think I wanted to find out why the sequencers or the response menu sequence don't play at the start but rather after the response node is selected.
For the response sequences, that's by design. For example, say the responses presented to the player are to enter Door 1, Door 2, or Door 3:
enterDoorResponseMenu.png (10.87 KiB) Viewed 490 times
And say the sequence on each response animates the player to enter the corresponding door. You wouldn't want to play any of those sequences until the player chooses which door to enter.
If you want to play a sequence while the response menu is visible and waiting for the player to choose a response, that's what the Response Menu Sequence is for. For example, the Response Menu Sequence could animate the NPC to boredly look around the room and tap her foot while waiting for the player to choose a response.