Here’s the scenario. Let’s say I have a number of actors in my game, all who I want to be able to speak with a dialogue bubble above their head. See games like “A Short Hike” or “Night in the Woods”.
Most of them will be NPCs, but some of them might be be an inanimate object, or an object with unique functionality (which means a base “NPC” class doesn’t seem to be suitable for this).
I know how to make speech bubbles and drive the dialogue - my goal here is to make a modular “component” I can slap onto any actor to make it talk. I just don’t understand how to execute that.
In a broad program design sense, how do I set this up? By using Scene or Actor components? Interfaces? A dialogue blueprint that I then put inside the actor I want to speak?
Thanks for this - it’s very similar to what I already have except your example includes some cool switching which I might borrow.
My main concern is setting up the NPCs or things being interacted with. It seems like the only way to setup an interactable object is to manually add my collision detector, overlap events, overlap logic checking, the interaction widget prompt, on every actor. Doing this by hand for everything is a lot of repeated work and makes the system nearly unmaintainable.
Am I thinking of this wrong? Should the player be in charge of the overlap, the prompt widget, etc?
I seen other dev making collision interaction for each actor bp, but personnaly i prefer to add it from my main character so to avoid indeed these repeated tasks and seem for me cleaner , so yes better all event interact from your main character.
Then these interact event will call the overlap actor interface.
Thanks for your help - it’ll mean a little bit of refactoring but it does keep most of the stuff in one place - all the interactable actors need to do is exist with the interface and accept the players events!!! From there, I can easily use ActorComponents to create standardized behaviour logic where needed. Thanks again!!!