When initializing datamaps in Harlowe, how can I set one property to the value of another in the same datamap?
Right now, the first property's value is random, and the second property is set to zero, but I'd rather it be set to the first property's value. I just use the (set:) macro afterwards.
For example:
(set: $player to
(datamap:
"STR", "(random: 17, 21)",
"AGI", "(random: 15, 18)",
"maxHP", "(random: 59, 68)",
"HP", 0,
"maxMP", "(random: 28, 33)",
"MP", 0,
"gold", 0,
"exp", 0,
"level", 1))
How can I set $player's HP to $player's max HP? As you can see, $player's maxHP is random, so I'm not sure if it's possible or not.
Thanks!
Comments
If you want the relevant $player attributes to contain random generated numerical values then just remove the double quotes, and then use a normal (set:) to assign HP a value.
If you want relevant $player attributes to contain macro calls then I don't know of a way to make the two attributes contain the same numerical value.
Okay, I didn't think there was a way to set one property to another.
Thanks!