I have two classes, Interactable, and StatProvider, the latter being the child of the former. Interactable contains a few general function like “Announce Self” and “Validate Awareness” which returns itself to a requesting actor, and which confirms that the requesting actor is aware of the interactability of the object they have requested. There is also an “Interact” function.
My StatProvider which inherits from Interactable needs to expect 3 things:
- An Actor to return the request to.
- An Awareness Validation Structure (something I made, it proves to the target that the requester is able to interact. Its basically an approval ticket system I designed)
- A string which represents the name of the stat which the request wants the target to provide.
The issue arises when all interactables will expect the first two, but the StatProvider is the only child of Interactable that I know needs a string, though later others may also require additional inputs to the Interact event. My solution is to simply override the Interact function in the cases of these children, then in the requester, provide the appropriate parameters to an overridden function. The issue is, I can find in the blueprint a means to override the input pins that an event expects. Interact is overwritten in the Interactable Blueprint, which implements the Interactable interface. The StatProvider inherits from Interactable, and also implements its own StatProviderInterface.
In stat provider, i need to add an additional pin to the “Interact Event” which is define in the InteractableInterface that it inherits from so that i can pass in ,more information, though when i click on the event, I can’t seem do it. And no, creating a unique event on the StatProvider, and then calling doesn’t work, because I have in the Interactable Blueprint, set it up to perform all the validation of calling the “Interact” event on any interactable. Stuff like detecting collision, range, LoS, and permissions. I want StatProvider to properly inheret all this functionality. Please help
I have had a brief consideration of Interact creating a delegate, which itself speaks to the requester, returning a reference to a function then the requester dynamically handles the returned function and provides it inputs, but that sounds like a waste of processor time, if i can just overwrite the inheritance.