
Hi Community Since HoneyBadger isn't going to update his Awesome Character Importer for the Character Sheet, (ref: <a href="https://app.roll20.net/forum/post/1113190/slug%7D#" rel="nofollow">https://app.roll20.net/forum/post/1113190/slug%7D#</a>... ) Sorry in advance for messing up your code HoneyBadger! I'm absolutely horrid at this JavaScript (still learning) :D. I'm working on a fix that'll work for my group, but I've run into an issue with the script, - or rather with my own change. So far I've managed to change some of the fields (Abilities) it gets, sort some of the RegEx to get the data, and update a character sheet already created with the Power Cards (which is essentially what we want) But I've run into a problem Which is trying to update these two to do overwrite instead of create. - AddPCAttribute (attr, value, charid) - AddPCPower (powername, powerstring, charid, tokenaction) These two functions creates a new Attrribute or Ability Regardless if the Character already has them, but that eventually leads to some intense macro mayhem after 2 updates as they get repeated each time. I've tried to add some kind of check to see if the Ability is already there, but with no positive result. And I'm a little curious on how to do "update" an object. What I tried was something along these lines, but I'm aware that this isn't how it's done (as it didn't work :) function AddPCPower (powername, powerstring, charid, tokenaction) {
var pwToAdd = findObjs("ability", {
name: powername
});
if (pwToAdd.length > 0) {
pwToAdd.set("ability", {
action: powerstring,
istokenaction: tokenaction,
characterid: charid
} else {
createObj("ability", {
name: powername,
description: "",
action: powerstring,
istokenaction: tokenaction,
characterid: charid
}
}); I'm completly bombed on what to do, but perhaps someone could help me look in the right direction? Best Regards //L