#Parsing a Array/dictionary from a json_file but how to get my variables back...

1 messages · Page 1 of 1 (latest)

vast niche
#

Hi guys, i'm fairly new to programming a game and i'm currently writing a choose your own adventure game.
I have an array with multiple dictionaries within and for editing reasons i'm trying to have it as a json_file. But when i'm loading it into my scene it won't reconstruct my variables...
i prepared the variables in the json file with the prefix var for easier identification

Example of a much simpler json file as i'm currently using:

  {
    "event": "T000",
    "text": "_var_T000",
  }
 ]```

and i want it to be like this in GDscript:

```[{"event": "T000", "text": T000,}]```

My current script to implement it is in the pictures



I hope you guys can help me out. thanks in advance!
daring remnant
#

if has_method(variable_name)
What is the purpose of this? I assume you don't actually have a method with the name of the variable

#

I assume you would actually want something like if variable_name in self