Page 1 of 1

Making a Start Conversation PlayMaker action with multiple conversants support...

Posted: Wed Jan 13, 2021 7:08 pm
by Abelius
Hi Tony,

I'm not a programmer, but I'm at that stage that I can (more or less) modify the work of others to adapt it to my needs... :roll:

So, I've expanded the default 'Start Conversation' PM action to behave the same, only adding up to four more conversants to be assigned from GameObjects, which are registered and assigned to premade actors NPC2,3,4,5

I'm using your solution from this thread...: NPC Conversations

It works well, but the problem I've faced is that I can't just 'Save As' the action script with another name, because it has a dependency with an Editor script with the same name, that I've also needed to modify for the additional GameObjects to show up.

I needed to modify the original 'Start Conversation' action, and now it looks like this...:

Image

...but the next time I update DS I may need to reapply my changes. And I don't think it's a good idea to modify your files anyway.

I've attached both scripts with my modifications. Taking a look at that, could you tell me how I could have an alternate version of them with a different name, please?

Thanks!

Re: Making a Start Conversation PlayMaker action with multiple conversants support...

Posted: Wed Jan 13, 2021 8:45 pm
by Tony Li
Hi,

Duplicate your customized StartConversation script, and rename it to StartConversationAlt (or whatever you want to call it). Edit the script and change line 9 from:

Code: Select all

public class StartConversation : FsmStateAction {
to:

Code: Select all

public class StartConversationAlt : FsmStateAction {
so it matches the script file name.

Then duplicate your customized CustomActionEditorStartConversation script, and rename it to CustomActionEditorStartConversationAlt. Edit the script and change lines 8-9 from:

Code: Select all

[CustomActionEditor(typeof(StartConversation))]
public class CustomActionEditorStartConversation : CustomActionEditor
to:

Code: Select all

[CustomActionEditor(typeof(StartConversationAlt))]
public class CustomActionEditorStartConversationAlt : CustomActionEditor
Change lines 17 and 26 from:

Code: Select all

var action = target as StartConversation;
to:

Code: Select all

var action = target as StartConversationAlt;

Re: Making a Start Conversation PlayMaker action with multiple conversants support...

Posted: Thu Jan 14, 2021 6:14 am
by Abelius
Ooh, I see. It was the last section what I've missed.

I can see this was actually more a Unity question than DS-related, so thanks a lot for helping me. You're awesome. :mrgreen:

Ah, and I don't know what you've done with the Conversation editor, but it's so MUCH faster now than when I was making my previous game...! Thanks a million for your continued efforts, Tony.

Re: Making a Start Conversation PlayMaker action with multiple conversants support...

Posted: Thu Jan 14, 2021 8:45 am
by Tony Li
If you were using Unity 2019.2 or 2019.3, then the biggest performance boost wasn't in the Dialogue System. Unity 2019.2 and 2019.3 had a major performance issue that they fixed in 2019.4.

Then again the Dialogue Editor window has gotten optimizations here and there with most versions, so it may simply have added up from the previous version you were using.