How do I call a function in dialogues

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Z1ml3w1s

I have a dialogue like

"some text here [func , [agr_1 , agr_2 , ...]]"

it will call a function

func(agr_1 , agr_2 , ...)

when react the []


:bust_in_silhouette: Reply From: Mitcha47

What you would like to do is possible but is not recommended. Although I do not know your reason for doing it, I know there would be a better way to handle it.

Godot has a class that can parse a string and then execute what was parsed.

However, this means you would need to parse the dialog for the function you want to execute. What you want will not happen automatically.