Code: Select all
1
[h:Skills = '{"Awareness": {"bonus":0,"char":"Per"}}']
2
[h:tokenType = "Space Marine"]
3
[r,switch(tokenType), CODE:
case "Space Marine" : {
4
[h:Skills = '{"Awareness": {"bonus":0,"char":"Per"}}']
5
};
]
6
I was debugging some code and wondered why a part of the switch wasn't executed (in this case the string copy and '5'), I finally narrowed it down to this. It looks like its "{" nesting problem, however in this case they're inside a string. Is the fact that its a string completely ignored by MT? If so how do I solve this, or is there another solution.1 2 3 4 [h kills = '{"Awareness": {"bonus":0,"char":"Per"} 6
Edit: I've tried encode/decode, but (roughly) same result
What I want to do is set a couple of token (json) properties to certain values depending on the choice of the user. I know I should code the json structures, however in this case I have a couple of default tokens from which I take their values and plain copy them on others. Thats a lot easier that rebuilding a complete json structure (note that its A LOT bigger then just this awareness skills and there are A LOT more properties involved. This is just a bare bone to show the bug)