The token has three properties: Primary, Secondary and Tertiary. Each of those properties is a JSON object, containing information about the token's weapons.
I am making a macro that allows for easy editing of those properties.
Below is my code:
[h: new_name = "Chester-12"]
[h: selected_gun = json.set("", "name", new_name)]
The intended function is for the json.set to affect the Primary property - or whatever selected_gun is set to -, but... no worky, obviously - it just turns selected_gun into a JSON object of its own.
I've also tried:
``` but still no luck - I have no clue what happens in that scenario.
How would I need to set it up so that the json.set applies to whatever the actual value of selected_gun is?
Failing that: is there any other elegant way to do this?
I know I could just use some if statements - if selected_gun == "Primary", then Primary = json.set(...) and so on -, or a switch roll option achieving much the same, but that doesn't *feel* right, surely there's a proper way to do this?
(please ping with any responses)