Automated Animations
This is a forum post to track discussion on Automated Animations. When TRL
0.2.0
is released I plan to update AA to the latest.
In the meantime this post also is for discussing AA and an attempt to provide feedback for those that are trying to add new system support to it.81 Replies
AutoAnimations? You mean the Automated Animations module? Or something else?
Yep Automated Animations. It's stuck back on TRL
0.0.23
, so quite a bit outdated, so I plan to update it to TRL 0.2.0
when it drops to try and keep it alive a bit longer.I see. Following this thread then given I want to make a PF2e specific offshoot.
Someday.
Eventually.
If happenstance allows.
Yeah.. It's definitely a beast of a module. Only Otigon has some grasp of all the intricate parts and it looks like there are many that could drift into disrepair. I know just a bit on how TRL is used with it. I can only update the TRL / UI parts and not really help w/ the rest of the codebase.
I think it would definitely benefit from an UI update as it becomes incredibly slow at times
Probably by having it render thousands of foldable elements across multiple pages.
There have been improvements to TJSSvgFolder to not render elements inside closed folders. I'm not sure which TRL version introduced that, but AA is on a much older version. AA also is a bit of a beast for data as it is storing everything in a single huge array of objects in a world game setting. This is not so bad if there are 10-20 animation definitions, but growing into the hundreds or thousands is potentially problematic.
And before that it was an object with property names being numbers!
{ "0": {...}, "1": {...}, ... }
I'm getting stuck at this lol, In attempting to add System Support to Auto Animations for Coriolis Game System, the output of this is ( as far as we can tell ) identical to for example alienRpg game system, which is already implemented as a game system supported for autoanimations.
I've attempted to copy the code directly from the aa-alienrpg.js along with modifying the index.js inside autoanimations\src\system-support ( i assumed this file was the one telling which game system to use which file.. ) But it doesn't seem to even load that aa-yzecoriolis.js file at all when that gamesystem is loaded. I know it loads the aa-alienrpg.js file, but confusingly, it will do that even if the entry is removed from the index.js.
So it appears the index.js is not being used to tell which gamesystem which file it should use, so what does? lol. I believe this would work with Coriolis, if I could just get aa-alienrpg.js ( or a duplicate ) to load in that game system.
Any ideas?
I can certainly help w/ the framework aspects, but not as much with specifics to implementing new system support. Have you run
npm run build
after you made the changes. TRL / Svelte framework is a compile time framework, so you must build it on changes.You can alternatively use
npm run dev
to get a live experience, but yeah TJS beat me to the punch here lolYes, I've built on changes. It loads fine, just doesn't seem to load the file I need. I've tested and made sure the aa-alienrpg.js file loads if the AlienRPG game system is started. And if making modifications to this file and then building, i can see the changes when the file gets loaded in the game system. I just can't seem to get coriolis to load the file.
I'd stay away from using the dev server for now due to the complexity of AA. The dev server is a great feature of VIte and TRL that allows HMR / hot module reloading and changes to code in Svelte components dynamically without reloads to Foundry, but this is only really for Svelte components which is not the code that you are modifying, so running
npm run build
to do a full production build is recommended.Having already delved in this,
npm run dev
will simply refresh the page if you are editing the system js files.
So I wouldn't worry.
Just makes it faster.Yes it will, but to be precisely sure changes are propagating it's best in general in that case for a production build. Less variables that can go wrong in this particular situation of getting the new code to take affect. The dev server is great when things are all situated correctly.
Do you have a public repo for your changes?
The next thing is to make sure the game system ID matches the system ID in whatever lookup code AA has implemented.
I have no idea what or where the lookup code is 🫣
in the index?
probably, let me see
Only change Im really trying to make it get AA to load aa-alienrpg.js
I assumed the index.js was what was loading which file. It looks like this
However, if I remove the line
From this, it still works fine after building and starting AlienRPG game system..
What am I looking at? 🫣
There is a default that in an event the system doesn't exist, is triggered.
And AlienRPG could just happen to work with
Heh heh... Discord tip is to always put links between
<>
to not show the large breadcrumb image. 😄Hmm, maybe
At the function that actually registers the system hooks in AA
so your ex.
export * as wrathandglory from "./aa-wrath-and-glory.js";
has to be exported exactly as the id of the system
Its a matrioshka of objectsI've tried creating an aa-yzecoriolis.js file and then add
to the index.js, to no avail lol
is the
game.system.id
yzecoriolis?How can I check to make sure? It's what it shows up as in game, and the folder name in systems
by putting what I put in code into console
game.system
for all data about the systemCheck
system.json
for the id
but either way I found the github page for it and that's the ID, so something else must be afoot
I assume it's the "name" part?
yes
You can always put a
console.log("Look me up", systemIdClean, systemSupport)
right above that line in src/index.js
and then build
If you see no console log then you are building it wrong somehowYeah..
name
is old, but id
is the new field, so the manifest is out of date, but that probably still works.AA uses
game.system.id
which is a getter iirc
so should be compatibleYeah.. just that the manifest might stop working; maybe on v12 as that was deprecated on v10 I believe; other problem for the future.
funny, given its updated last week
https://github.com/winks-vtt/yze-coriolis
It printed yzecoriolis
Look at the
Module
object then
and see if yzecoriolis is there or some other idit's there on the bottom
alright, then it should work and register as such 🤔
then the issue is with the
aa-yzecoriolis
file itself
not how you turn it onMight be helpful to post the repo to your current fork.
Thats good to know if thats the case
Then now just fix the hooks to actually match the system and not that of alienrpg 😄
Sorry, I feel so useless at this lol.
Afaik, this code gets the chat message from the console whenever you use an item in order to trigger the correct animations for that item..
This is the code from the aa-yzecoriolis.js file ( identical to aa-AlienRPG.js )
And this is the console output log for both alienRPG and Coriolis.
Maybe the issue is glaringly obvious to you lol, I kinda hope so in this case lol
// WILL NEED REWORK AFTER THE V10 VERSION IS RELEASED
?Posting your repo fork link will help in taking a look.. Heh heh... 3rd time mentioned... 😉 I suppose also commit everything that you have currently.
But yeah by this point just please commit and show us the work
Yea, I don't have a fork currently. Only locally edited files lol
Welp.
I will tell you that the output log is not useful at all.
You want to see the message data, which you can get using
game.messages.contents.at(-1)
(for the latest one)
There you can see what the message is comprised of, and with that, run the proper functions.Yeah.. it should be ~20 minutes to make a fork and update it with what you have so far. It's the best way to get help as AA is not trivial. Also of course once you get it working that allows you to make a PR for adding support for the system.
Yea, I'll have a look at it
https://github.com/AquaRex/aa-yzecoriolis
Time to put some log statements here: https://github.com/AquaRex/aa-yzecoriolis/blob/main/src/index.js#L175 and in the
aa-yzecoriolis.js
file.Doing this, I found that alienRPG is including the data-item-id into the _source - content of the chat message.contents. That coriolis doesn't seem to add.
Here is Alienrpg:
And here is Coriolis:
That would explain nothing working lol.
Well, you gotta look into how Coriolis provides the item to the message.
If it does at all.
Yea..
If you cannot find anything under
message.item
, or message.flags
pertaining to the item ID, then you are simply screwed.
(Or any other property)Except it's a friends system right? I can't recall, so it might be system modding time too if not accessible.
Could it be any of these? ( sorry for this lol )
no
you are looking at the ID of the message
Right, makes sense I guess
and the token ID of the speaker
you want the item that "spawned" the chat message
if you cast a Fireball in D&D5e, the message contains the data that its this tokens fireball
look at the flags
There is a
yzecoriolis
flag you can't see from that previous post.there is an yzecoriolis flag in there
This is something I really wish Foundry would standardize (somehow, someway) in what data is made available as default in systems
I assume you mean this one
It's correct to the item that triggered the event. But no Id in sight
I guess it might be part of the reason this system isn't already supported? lol
I mean, you could get fancy in the system handler and grab the Item from the Token using it
If they at least give you the token or actor ID
There's the
speaker
datanot all systems utilize that
but it was shown its there in the previous screenshot
alas
it looks like you would never get an accurate item ID from this
You could go around the issue by going token -> actor -> search for an item that matches the
rollTitle
but this sounds painfully ripe for bugs as it pertains to storing the animation data on the item itself
what if someone has two daggers?
is rollTitle
even accurate to the item name?Im gonna look through the other supported systems, in case another one is doing something similar to this already
idk
You are way better off asking the system devs to implement the item to the chat message
I doubt Otigon went out of his way to try to support such systems with such issues
Hm, yea you're probably right
Two potential PRs now... Welcome to the deep end of Foundry dev.. ;P
I am glad I just want to play PF2e and nothing else lol
lmk when you get around to that PR. I'll help out as best I can
a little rusty on the JS after 6 months lol
Also Otigon... When I get the next TRL release out
0.2.0
I'll get AA updated and tuned up and submit a PR. It's a bit out of date.Anyway, thank you all so much for the help!
I would have wasted a bunch of time, if it wasn't for you guys! 😂