Always getting the error, TypeError: r is null, even when copying code directly from the Documentation

I am trying to follow the examples found here:

But in every example where I try to call a variable I get an error TypeError: r is null

For example when I use this code:

  set "Alice"
  set data.player.age 25
  "The player's name is %{} and they are %{data.player.age} years old"

Gives me this error:
Narrat script runtime error at game.narrat:4
TypeError: r is null
Script : “The player’s name is %{} and they are %{data.player.age} years old”
Label: main

Copying this code

  set data.player.inventory (new Array "Sword" "Shield" "Potion")
  var array_contents (array_join $data.player.inventory)
  "Your inventory contains  %{array_contents}"

Gives me the same error as above except this line:
Script: “Your inventory contains %{array_contents}”

  • :browser: : Which browser? :firefox:

Use %{$}, variables need a $ when you refer to their values. Docs might be outdated

Also looking at the default game script that’s in the engine (and linked in a few places in the docs I think) can be a good way to find working examples of syntax since it’s used for testing and has a bit of everything