Unpacking source code

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Unpacking source code

Post by mandi »

Hello Tony,
I want to extend ConversationStarter, and I need to unpack source code. I have assets with different conversation triggers set. Will that break those prefabs?
Best!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Unpacking source code

Post by Tony Li »

Yes, references to all scripts will need to be reestablished, including on all prefabs.

If you only need to extend Conversation Starter, it's much easier to only import ConversationStarter.cs and ConversationTrigger.cs, rename them both and customize them, and use your custom versions instead of ConversationStarter.

If that isn't a good approach for you, please let me know why you need to extend ConversationStarter. I may be able to suggest a simpler solution.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Unpacking source code

Post by mandi »

I want to customize Actor transform component - I want to have a switch that will always set Actor to the object that has the conversation trigger.

Thank you!
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Unpacking source code

Post by mandi »

Generally my goal is to be able to attach dynamically different compononents to my enemies - I have an enemy generic prefab, and, on a per-level basis, a gameobject holding all the components I want to be on that given enemy. Then, my component copier copies those components. This way, if I want to substitute my enemy to different version or completely different enemy, I change only 1 reference. I use it only for boss and quest enemies, and it works. My only problem is that, in order to be able to display my render-texture portrait, I need the Actor field to contain the actual gameobject the current DS trigger or conversation trigger is (this probably should be filled in OnEnable). I guess that the option of just taking those 2 scripts would be the best solution here.
Best!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Unpacking source code

Post by Tony Li »

When you dynamically set up your enemy, can you get the trigger component and set its actor field?
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Unpacking source code

Post by mandi »

Well, for not it works just by copying a set of preset components from one gameobject (acting as a cache, hidden) to my actual enemy object. I thought I would do without changing their variables, but I guess the simplest solution would be to create a special array for DS triggers, and then, for each entry in array, I could set the name of my Actor to the name of the object I wish to copy components onto (much cleaner than changing the entire system).

Thank you Tony!
Post Reply