
Hey all, I've been a user of mods forever, write macros all the time, and I've got a fair amount of experience with JavaScript (though its been a few years), but I've never actually written a mod before. I've got a very simple function I need to perform and it seemed like a great task to teach myself how to code for the API. I've read over the documentation, but I'm finding it a little lacking in examples, especially related to reading and writing to the character sheet. So that said, here's what I'm trying to figure out how to do: I have a specific character sheet with a value in other_resource that I want to monitor, and onChange, I want to run a simple bit of conditional logic, then adjust the value of a handful of attributes based on that value. IE, something like: on("change:attribute:other_resource", function() { var pc = getCharacter("My PC"); switch (true) { case pc.attributes.other_resource < 5: pc.attributes.dexterity = 16; pc.attributes.constitution = 14; pc.attributes.wisdom = 15; pc.attributes.charisma = 9; break; case pc.attributes.other_resource > 20: pc.attributes.dexterity = 15; pc.attributes.constitution = 15; pc.attributes.wisdom = 16; pc.attributes.charisma = 9; break; default: pc.attributes.dexterity = 17; pc.attributes.constitution = 14; pc.attributes.wisdom = 16; pc.attributes.charisma = 10; } } But I don't even honestly know where to begin when it comes to putting that into code that the API sandbox will understand. Can anyone point me in the right direction? Or send me toward some examples or more robust tutorials than are in the documentation that I could take a look at? I've been putting off learning the API forever, and this seems like about the simplest possible task I could think of to get started with. Thanks!