Open krbz999 opened 2 months ago
I was expecting to be able to use an actor's roll data for creating a roll by writing a standard macro such as this:
const rollData = actor.getRollData(); const formula = "(@attribute.agility.value)d6"; const speaker = ChatMessage.implementation.getSpeaker({actor: actor}); return new Roll(formula, rollData).toMessage({speaker});
but it seems that getRollData is overridden in the actor document class to return something unrelated to rolls.
getRollData
The workaround is to use const rollData = actor.system;.
const rollData = actor.system;
Code here: https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/blob/main/src/actor/actor-document.js#L41
Use the above sample macro.
n/a
No response
Yeah this is an old choice that was made in ignorance. Not so much a bug as incorrect override of the API. Changing it requires a bit of work.
Describe the bug
I was expecting to be able to use an actor's roll data for creating a roll by writing a standard macro such as this:
but it seems that
getRollData
is overridden in the actor document class to return something unrelated to rolls.The workaround is to use
const rollData = actor.system;
.Code here: https://github.com/fvtt-fria-ligan/forbidden-lands-foundry-vtt/blob/main/src/actor/actor-document.js#L41
Reproduction
Use the above sample macro.
System Info
Logs
No response
Validations