UE4 Interfaces & Blueprint Function Library Combo
I want my AI to have a contract(interface) that defines all the required functions I need to implement a "special mechanic" in the game. However, the implementation is in a blueprint function library.
"Interface_Initialize Boss" implementation will actually call "BFNL_InitializeBoss" in my Blueprint Function Library in all the AI that implements the Boss fight interface. What are your thoughts, is there a better way to implement a Contract+Blueprint function library? ( I don't want to have all this code in the Base class).
asked Apr 04 '18 at 01:33 AM in Blueprint Scripting
I would recommend you break the logic up into components you attach at the base class level.
For example an inventory component used in this manner can consolidate all the management of your items. An Attribute component could be responsible for managing everything from hits given to damage taken.
In this example, you may consider using the dispatch events to complete integration allowing you to only implement the portions of the interface you select.
Also, the controller should be used to manage logic flow enabling you to invoke behavior tree's as you see fit.
I would also recommend you veer away from heavy blueprint inheritance. Opt instead to implement a dynamic interface at the base class that is more feature packed. This can be done using components and/or objects.
answered Apr 13 '18 at 09:51 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here