Use the File System’s action “Load text from a file”.
Here’s how I did it :
This is part of my dialogue tree. It’s from the example template that comes with GDevelop. I modified it to have a place holder for player name (highlighted in green) :
Here is my player_name varariable setup (I skipped the input text box bit ) :
These are the actions I used to replace the player’s name. I installed the RegEx extension for the 2nd action (note the dialogue action in the screen snip below has a bug in it - it shows _PARAM1_ instead of _updated_dialogue) :
And here’s the output :
As a side note, the regex replace expression uses 4 parameters :
- the pattern to search for (’“player_name@” in this case)
- regex flags (scroll down to flags on this web site for an explanation)
- the original string (in this case, the loaded dialogue text)
- the replacement value (for strings found with parameter 1), which in this case is the user chosen name