Page 2 of 2

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 4:34 pm
by Tony Li
Shinos wrote: Tue Jul 25, 2023 4:23 pmit's worth to say that in order to do this i activated simultaneous conversation to trigger the new convo in a blank sentence of the previous one, as i said earlier.
Maybe that's the problem. Maybe since the old conversation is ending at the same time as the new one is starting the override settings aren't getting applied. Please try handling the end of conversation in one of the way I suggested above: Use an OnConversationEnd(Transform) method or Dialogue System Events, or wait a frame like in the coroutine version.

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 6:49 pm
by Shinos
Tony Li wrote: Tue Jul 25, 2023 4:34 pm
Shinos wrote: Tue Jul 25, 2023 4:23 pmit's worth to say that in order to do this i activated simultaneous conversation to trigger the new convo in a blank sentence of the previous one, as i said earlier.
Maybe that's the problem. Maybe since the old conversation is ending at the same time as the new one is starting the override settings aren't getting applied. Please try handling the end of conversation in one of the way I suggested above: Use an OnConversationEnd(Transform) method or Dialogue System Events, or wait a frame like in the coroutine version.
I'll try doing some test
how can i do it in "OnConversationEnd(Transform) method or Dialogue System Events" ?
Do i need to have a method which checks everytime a conversation end if it is the right one and then do what i want? or is there some more functional way to do this that i'm missing, what about dialogue system events.
Also i don't know why but i'm facing a lot of other unexpected issues, like when i'm starting a conversation now through the timeline system sometimes the Dialogue manager does not recognize the Player, and just skips his lines, i'm starting to get crazy here lol

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 7:02 pm
by Shinos
Shinos wrote: Tue Jul 25, 2023 6:49 pm
Tony Li wrote: Tue Jul 25, 2023 4:34 pm
Shinos wrote: Tue Jul 25, 2023 4:23 pmit's worth to say that in order to do this i activated simultaneous conversation to trigger the new convo in a blank sentence of the previous one, as i said earlier.
Maybe that's the problem. Maybe since the old conversation is ending at the same time as the new one is starting the override settings aren't getting applied. Please try handling the end of conversation in one of the way I suggested above: Use an OnConversationEnd(Transform) method or Dialogue System Events, or wait a frame like in the coroutine version.
I'll try doing some test
how can i do it in "OnConversationEnd(Transform) method or Dialogue System Events" ?
Do i need to have a method which checks everytime a conversation end if it is the right one and then do what i want? or is there some more functional way to do this that i'm missing, what about dialogue system events.
Also i don't know why but i'm facing a lot of other unexpected issues, like when i'm starting a conversation now through the timeline system sometimes the Dialogue manager does not recognize the Player, and just skips his lines, i'm starting to get crazy here lol
Ok i think i got to solve these problems by reading this post https://www.pixelcrushers.com/phpbb/vie ... php?t=1796 , i kinda did all the scene by scratch, and MAYBE, i think it works now, even with the simultaneous conversation going on, but tbh, i don't know if this is the best way to achieve this.
PS: ok nevermind, the dialogue settings are still not being kept, but at least now it recognizes the actors correctly, also i tried the "wait a frame coroutine version." but it still says to me that another conversation is already active

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 7:19 pm
by Shinos
Little update, i just discovered the "link to" field, and it does just what i wanted, it makes a new conversation start, so all of this was kinda pointless it seems, i feel kinda dumb :?: am i missing something about it? like the only thing i need now is to delay a lil the start of the new conversation, but i think that if i am using the timeline, i can just do that manually, and if i want to do that instead on the dialogue manager i can put a blank field after the start and make it delay for the amount of time i want.
So i think this is kinda fixed, but still i am curious of what were your other suggestion, also because making the raise waiting a frame didn't actually work and i don't know if i misinterpreted how to implement it.
also still it's pretty weird that if you call a new conversation when an other one is already going on you lose the override settings, like what should i do to replace an actual conversation by script, let's say i'm in a tutorial, and the npc is giving me advices, but as soon as i finish, i trigger a new conversation, but i need to replace it and of course keep my override settings,
i know there is the start conversation action in the dialogue system trigger component, but what if i need to do this like several times during that level, and not just one time, i ask this since i have seen that i can only put one "start conversation" action.
--------------
i'll give a better example of what i am doing right now:
-i have a first conversation that is run through a timeline, where the player cannot move.
-thanks to the "link to", when the conversation ends it links to a conversation where the npc gives some advices to the player to go on through the tutorial, but the player can move here now and there is no need for continue button (i am using bubbles and not the default subtitles).
-when the player does what the tutorial wants (in this case, just moving around, right and left) after some seconds it would trigger a 3rd conversation, i managed easily to do this, but the issue is thatr if i try to reach the tutorial goal before the 2nd conversation has ended, i get of course the usual "another conversation is running"

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 8:09 pm
by Tony Li
"Links To:" is good to use.

I'll look into the override thing. But everything else should work as I described above. If you get into a situation where you need it to work and have questions, let me know and I'll post a playable example scene.

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 8:44 pm
by Shinos
Tony Li wrote: Tue Jul 25, 2023 8:09 pm "Links To:" is good to use.

I'll look into the override thing. But everything else should work as I described above. If you get into a situation where you need it to work and have questions, let me know and I'll post a playable example scene.
Thank you, as i said before i'm stuck at this situation :
--------------
i'll give a better example of what i am doing right now:
-i have a first conversation that is run through a timeline, where the player cannot move.
-thanks to the "link to", when the conversation ends it links to a conversation where the npc gives some advices to the player to go on through the tutorial, but the player can move here now and there is no need for continue button (i am using bubbles and not the default subtitles).
-when the player does what the tutorial wants (in this case, just moving around, right and left) after some seconds it would trigger a 3rd conversation, i managed easily to do this, but the issue is thatr if i try to reach the tutorial goal before the 2nd conversation has ended, i get of course the usual "another conversation is running"
i need to be able to replace the current conversation even if it still going on, i discovered also that the "simultaneous" even if it worked as i wanted, would not be extremely functional, because it would not replace the current conversation, but just play it simultaneously (as i think it was intended to) and i need instead to replace the 2nd convo with the 3rd, when requirements are met, even if the NPC is still talking

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 8:54 pm
by Tony Li
Hi,

I apologize if I'm missing something. But when it's time to play the 3rd conversation, can you just call DialogueManager.StopAllConversations() and then DialogueManager.StartConversation("Third Conversation")?

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 9:57 pm
by Shinos
Tony Li wrote: Tue Jul 25, 2023 8:54 pm Hi,

I apologize if I'm missing something. But when it's time to play the 3rd conversation, can you just call DialogueManager.StopAllConversations() and then DialogueManager.StartConversation("Third Conversation")?
that's exactly what i needed, now i can do something like this:

Code: Select all

  IEnumerator StartConversation()
    {
        yield return new WaitForSeconds(2); 
        DialogueManager.StopAllConversations();
        DialogueManager.StartConversation("New Conversation 3");
    }
Thank you

Re: Make a custom LUA script run after the end of a conversation

Posted: Tue Jul 25, 2023 10:02 pm
by Tony Li
Glad to help!