How to Change Interact Message on Scene Graph Component

This may be a dumb question, but how do I change the Interact message on a Scene Graph component?

If I search Google, I see someone on Reddit said this:

interactable_test_component<public> := class<final_super>(interactable_component)
{
    TestText<localizes>:message =  "test message"
            
    InteractMessage<override>(Agent:agent)<decides><reads> : message =
    {
        return TestText
    }
}

But I must be missing something. That can’t be right, is it?

How would I add a class derived from interactable_component to an entity? The only Verse option in the entity prefab editor, that I can see, is to add a class directly derived from component. I also used the editor to add an interactable_component to my entity, but I don’t see any way of making a class derived from it. ???

I can use FindDescendantComponents (from inside my Verse class derived from component) to get a handle on other component types. But I don’t see how that would help.

Confused. :confused:

remove the interactable_component from your entity, and add your interactable_test_component. Can’t have both at same time since they belong to the “same type hierarchy”. That’s why it does not show up to you

Hi Iantram, Good question,

Cheers Sprintermax!

I followed this tutorial a while ago. I think it pairs well with the snippet you posted above.

interactable_enableable_component<public> := class<final_super>(interactable_component):

    EnabledText<localizes> : message = "Turn Off"
    DisabledText<localizes> : message = "Turn On"

    #...

    OnSucceed<protected>(Agent : agent):void=
        if (IsInteractEnabled?):
            set IsInteractEnabled = false
            Print("OnSucceed passed if check")
        else:
            set IsInteractEnabled = true
            Print("OnSucceed went to else check")

    InteractMessage<override>(Agent : agent)<decides><reads> : message =
        if (IsInteractEnabled?):
            return EnabledText
        else:
            return DisabledText