Changing player name

So, I’ve just wandered into the wonderful world of Narrat (Always start with flattery) as an escapee from the “Big Game Engine Crisis” happening somewhere and I think this software is amazingly intuitive. The only thing i seem to be missing, or can not find, is the way for the player to change their character name.
A little help would be appreciated.

Thanks

1 Like

I replied on Discord before seeing this post, but just to have the answer recorded on the forum, it’s all explained on that page:

Although I am just realising now that this only applies to changing between preexisting characters, if you want to actually edit their name you’ll need to change the config. So it would be something like this:

main:
  // Store the player's name in a variable
  set data.playerName (text_field "What is your name?")
  // Update the actual character name with that variable
  run reload_config_overrides
  talk player idle "The player should now have the new name"

// Reloads changes to the config, has to be done when the game starts for technical reasons
reload_config_overrides:
  // Edits the config to change the player's name to the name we stored
  set config.characters.characters.player.name $data.playerName

In the config the reload label needs to be set so that that reload_config_overrides label is played when the game reloads when loading saves:

saves:
  mode: manual
  slots: 10
  runOnReload: 'reload_config_overrides'

You can basically change any value in the game config during gameplay this way, by simply changing values in the config object.

2 Likes