Mantella is a Skyrim and Fallout 4 mod which allows you to naturally speak to NPCs using Whisper (speech-to-text), LLMs (text generation), and xVASynth / XTTS (text-to-speech).
When using Text Input and pressing the End Conversation hotkey during a conversation, Mantella hangs and Mantella Spell displays the debug message "NPC not added. Please try again after your next response." when attempting to start a new conversation.
When the End Conversation hotkey is pressed, Mantella Spell should update _mantella_text_input.txt with the end_conversation_keyword to break load_data_when_available out of its loop. I have limited experience writing PSC files, and I'm not sure if Mantella Spells has access to the value of end_conversation_keyword, so I'll leave it up to you if you want to implement a fix there.
Alternatively, Transcriber.get_player_response should not only poll _mantella_text_input.txt, but it should also poll _mantella_end_conversation.txt to see if the player has pressed the End Conversation hotkey. I've written a fix for this, and it works in testing, so I'll open a PR for you to review.
When using Text Input and pressing the End Conversation hotkey during a conversation, Mantella hangs and Mantella Spell displays the debug message "NPC not added. Please try again after your next response." when attempting to start a new conversation.
This occurs because
Transcriber.get_player_response
callsgame_state_manager.load_data_when_available
, which continues to poll_mantella_text_input.txt
until its contents have changed. But when the user has pressed the End Conversation hotkey, there is no way for that file to get updated, soload_data_when_available
hangs in an endless loop.I've thought of a couple ways to fix this.
_mantella_text_input.txt
with theend_conversation_keyword
to breakload_data_when_available
out of its loop. I have limited experience writing PSC files, and I'm not sure if Mantella Spells has access to the value ofend_conversation_keyword
, so I'll leave it up to you if you want to implement a fix there.Transcriber.get_player_response
should not only poll_mantella_text_input.txt
, but it should also poll_mantella_end_conversation.txt
to see if the player has pressed the End Conversation hotkey. I've written a fix for this, and it works in testing, so I'll open a PR for you to review.