Accessing data in active effects via @ symbol
I noticed other systems are able to expose certain bits of data and access it in active effects eg: attribute: system.armor.ac mode: add value: @str.value
However I can't seem to get the same functionality in my system.
I have an actor data model module>data>actor.mjs file that just exports an actor class that extends
foundry.abstract.TypeDataModel
I have an actor document module>documets>actor.mjs that extends the actor data model
in module>documents>actor.mjs I expose the abilities to the top level via getRollData()
However when I try and use this in an effect the value of the attribute I'm changing returns NaN
I know my attribute is correct because if I change the @str.value
to simply 1
I get the expected output3 Replies
They might have a custom active effect class that adds that functionality. Check those systems to see what they do in ActiveEffect#apply
looking at DnD they do have a custom active effect class
but I don't see anything special to replace
@
values 🤔
https://github.com/foundryvtt/dnd5e/blob/04c17cd0bc90e070d7312155228945c8f269597e/module/documents/active-effect.mjs#L117-L192GitHub
dnd5e/module/documents/active-effect.mjs at 04c17cd0bc90e070d731215...
An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com). - foundryvtt/dnd5e
okay so i seem to have found it.
seems like the system is doing this itself and is not a feature of foundry
https://github.com/foundryvtt/dnd5e/blob/04c17cd0bc90e070d7312155228945c8f269597e/module/utils.mjs#L91-L110
GitHub
dnd5e/module/utils.mjs at 04c17cd0bc90e070d7312155228945c8f269597e ...
An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com). - foundryvtt/dnd5e