p4535992 / foundryvtt-automated-evocations-variant

1 stars 1 forks source link

Errors using the API #4

Closed lucaspicerni closed 2 years ago

lucaspicerni commented 2 years ago

Hi! When trying to load custom animations via the module's How To, through the setting ""game.settings.set(AECONSTS.MN, "customanimations", customanims);'' I'm getting the following error:

image

Also when I try to register new spells:

image

Or new macro automations:

image

Here an example of what I'm using:

const customanims = {
  smokebomb: {
    fn: "bomba_de_fumaca",
    time: 500,
    name: "Bomba de fumaça",
    group: "Personalizados"
  },
  soundwave: {
    fn: "onda_sonora",
    time: 500,
    name: "Onda sonora",
    group: "Personalizados"
  },
};

game.settings.set(AECONSTS.MN, "customanimations", customanims);
const template = args[0]
const tokenData = args[1]
await new Sequence()
.effect()
    .file("modules/jb2a_patreon/Library/Cartoon/mix/fire_earth_explosion_SQUARE_05.webm")
    .belowTokens(false)
    .randomRotation()
    .atLocation(template)
    .randomOffset()
    //.repeats(6, 50, 25, 75, 60, 20)
    .scale(Math.max(tokenData.width,tokenData.height)*tokenData.scale*0.8)
.play()
const data = game.settings.get(AECONSTS.MN, "customautospells")

data["Arma espiritual"]=[
      {
        creature: "Arma espiritual",
        number: 1,
        animation: "bencao"
      },
    ]
game.settings.set(AECONSTS.MN, "customautospells", data)
const summon = CompanionManager.api.dnd5e.getSummonInfo(args, 2);
const spiritualWeapon = {
  slash: [`${Math.floor(summon.level / 2) + 1}d8 + ${summon.modifier}`, 'force'],
}

return {
  embedded: {
    Item: {
      "Arma espiritual": {
        "data.attackBonus": summon.attack.ms,
        "data.damage.parts":[spiritualWeapon.slash]
      }
    }
  }
}

Am I doing something wrong? Thank's for your time!

p4535992 commented 2 years ago

@lucaspicerni sorry for the delay , i'll try to reformat the code this weekend

lucaspicerni commented 2 years ago

Hi! Thank you for your work and willingness!

p4535992 commented 2 years ago

update the api with 1.6.3

lucaspicerni commented 2 years ago

I'm getting the following error when trying to update: "k is not defined".

p4535992 commented 2 years ago

unistall and reinstall the module , is because the manifest v9 is not backward-compatible with the new manifest for v10, reinstall using the lastest module.json release https://github.com/p4535992/foundryvtt-automated-evocations-variant/releases/latest/download/module.json