Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleActor#data object no longer used; need support on new DataModel #54

Open
klatschi opened this issue Feb 15, 2023 · 1 comment
Open

Comments

@klatschi
Copy link

Just posted this in Discord as well:

So, I am using Simple Worldbuilding together with pdfFoundry and have some complex macros. Upgrading to V10 killed my system.

I get warning in the console, that f.e.

"Error: You are accessing the SimpleActor#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.
at logCompatibilityWarning (commons.js:1692:19)
at SimpleActor._logV10CompatibilityWarning (commons.js:6642:14)
at get data [as data] (commons.js:6542:24)
at eval (eval at executeScript (lib.js:175:13), :4:20)
at Macro.eval (eval at executeScript (lib.js:175:13), :5:3)
at Macro.executeScript (lib.js:179:13)
at 🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:591:14)
at 🎁Macro.prototype._executeScript#0 (libWrapper-wrapper.js:189:20)
at Macro.renderMacro [as renderContent] (lib.js:288:10)
at _executeMacroInternal (lib.js:137:17)
at Macro.executeMacro (lib.js:77:8)
at 🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:591:14)
at 🎁Macro.prototype.execute#0 (libWrapper-wrapper.js:189:20)
at MacroConfig._onExecute (foundry.js:65604:17)
"

So, until now, I addressed an attribute (f.e. Charisma) this way:
"actor.data.data.attributes.attr_charisma.value"

I had a look at the "Inspect Data" Possibility, it tells me that I should still use
"actor.data.data.attributes.attr_charisma.value"

When using console.log (actor.data), I get another path that would lead to
"actor.data.system.attributes.attr_charisma.value"

Does that mean, that I simply have to change all the code from "actor.data.data.(...)" to "actor.data.system.(...)" and I am ready to go?

Or does that mean that I have to rewrite the data structure of my characters?

@Fyorl
Copy link
Contributor

Fyorl commented May 15, 2023

Apologies, this issue seems to have slipped under the radar. actor.system.* is what you should update your macros to (no data in there at all). However, what you're seeing is just a warning, so I wouldn't expect it to entirely kill your system. Are there any other symptoms that you can provide that might help us diagnose the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants