ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   How to navigate long NPC interactions? (https://www.esoui.com/forums/showthread.php?t=10687)

schorse 09/01/23 10:15 AM

How to navigate long NPC interactions?
 
Hi all,

I'm trying to navigate the interaction with the undaunted daily pledge NPCs. The EVENT_CHATTER_BEGIN event will trigger a function which includes the following code:

Code:

elseif GetChatterOption(1) == "What's the pledge today?" then
        SelectChatterOption(1)
        SelectChatterOption(1)
        SelectChatterOption(1)
end

If I talk to the NPC it selects the option 1 but only 1 time. The thing is that the chatteroptions stay the same even though I'm already in the next "layer" of the conversation. GetChatterOption(1) should be "And if I can handle more?" but it's still "What's the pledge today?".

Does anyone know how to navigate in those conversations?

Thanks!

Baertram 09/01/23 11:35 AM

Try to search vanilla code files to see how they do it, eg. the keybinds if you press 1, 2 or 3 to select the chatter options.
https://github.com/search?q=repo%3Ae...tion&type=code

They call:

Code:

INTERACT_WINDOW:SelectChatterOptionByIndex(1)
https://github.com/esoui/esoui/blob/...ings.xml#L1051

This should then update the interact window texts etc. properly (hopefully)

I'm no sure if you can queue 3x INTERACT_WINDOW:SelectChatterOptionByIndex(1) or need to wait after first call to it, so the chatter updates, e.g. raises a new event EVENT_CONVERSATION_UPDATED and you need to react on this then?

Maybe check Dolgubons lazy Writ carfter addon as it does the pretty same while talking to the crafting writ NPC -> skip the "accept quests" dialogs.

Oh and remember you are not only playing in English but might also have to support other languages, so checking for "What's the pledge today?" is not the same if you play in de, fr, ru, es, zh :-)

schorse 09/01/23 03:22 PM

Thanks for the Answer! I found an addon that implements this (thanks iFedix):
https://www.esoui.com/downloads/info...Utilities.html

Although you can do it without events (disadvantages?):
Code:

elseif options[1] == "What's the pledge today?" then
        SelectChatterOption(1)
        AcceptOfferedQuest()
        AcceptOfferedQuest()
        SCENE_MANAGER:Show("hud")

Quote:

Oh and remember you are not only playing in English but might also have to support other languages, so checking for "What's the pledge today?" is not the same if you play in de, fr, ru, es, zh :-)
I'm implementing some little helper just for me in one small addon so it's not a problem.

EDIT: Don't use the code above. Worked yesterday but not today. Idk why. The method by iFedix works though.


All times are GMT -6. The time now is 11:35 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI