Hello,
So, I'm trying to work with an rpg system that instead of using numeric attributes, uses words. Like Fudge or Storyteller, except that this is trickier to work with when it comes to leveling up. So basically I wanted a way to write "your strength is $att.strength", where $att.strength is a number, but display "your strength is poor". I've been trying to create a macro for that, but I have very little experience with javascript and couldn't find a tutorial. So I've tried my hand using the sugarcube api macro reference, and this is what i've come up with:
Macro.add('stats', {
handler : function () {
try {
var attribute = this.args[0];
if (attribute == 1) {
return this.output("poor");
}
} catch (err) {
return this.error;
}
}
});
Except this doesn't write anything if I use <<stats '1'>>. I'm not sure what to try next.