I must be really dense, or there's a really obscure bug lurking somewhere. I'm defining some objects to initialize monster data, and I keep getting this error: "Error: <<set>>: bad evaluation: missing : after property id".
I've cut down the data to a small test subset that illustrates the problem.
This set works:
<<set $enemy = {
hp: 12,
int: 3
}>>
This set does not.
<<set $enemy = {
hp: 12,
def: 2
}>>
What's wrong with a property called "def"? What am I missing? The error message is entirely unhelpful since I clearly have a colon there. I can rename the property, but why is this particular name a problem? Some internal conflict with some kind of definition statement, maybe?
Comments
When the SugarCube javascript engine processes your 2nd <<set>> macro it is removing the def keyword, which is causing your error. You should not use reserved words as javascript Object property names.