Page 1 of 1

Unpacking source code

Posted: Sun May 29, 2016 5:42 pm
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!

Re: Unpacking source code

Posted: Sun May 29, 2016 10:49 pm
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.

Re: Unpacking source code

Posted: Mon May 30, 2016 2:51 am
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!

Re: Unpacking source code

Posted: Mon May 30, 2016 5:21 am
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!

Re: Unpacking source code

Posted: Mon May 30, 2016 9:51 am
by Tony Li
When you dynamically set up your enemy, can you get the trigger component and set its actor field?

Re: Unpacking source code

Posted: Mon May 30, 2016 10:07 am
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!