Comments (8)
Additionally, it appears that this behavior is worse on a fresh install, as it will perform ALL data migrations (one after the other).
from tokenmagic.
Confirmed, brand new world, ONLY Token Magic FX enabled, this is the Token Magic part of settings.db:
It appears that:
- original
tokenmagic.presets
andtokenmagic-migration
written (by migration.js?) - 0.4.0/0.4.0b/0.4.1/0.4.3 migrations ALL applied
It appears that the migrations (except for the first one?) all get the LAST tokenmagic.presets, write that into settings.db, THEN writes the new one in. Confirmed with Diff.
from tokenmagic.
Issue in migration (in part) appears to be in this (and the other) parts of code for migration:
async function updatePresetsV043() {
// Gets the CURRENT presets value
var presets = game.settings.get("tokenmagic", "presets");
if (!(presets == null)) {
log('Migration 0.4.3 - Launching presets data migration...');
try {
// write the CURRENT presets back in again
await game.settings.set("tokenmagic", "presets", presets);
log('Migration 0.4.3 - updating template presets...');
// write in the NEW presets?
await Magic.importPresetLibraryFromPath("/modules/tokenmagic/import/TMFX-update-presets-v043.json", { overwrite: true });
await game.settings.set("tokenmagic", "migration", DataVersion.V043);
log('Migration 0.4.3 - Migration successful!');
} catch (e) {
error('Migration 0.4.3 - Migration failed.');
error(e);
}
}
}
from tokenmagic.
Old entries in .db files are completely normal. That's just how the database (NeDB) works. You can read more about it here.
Migration on a fresh install seem to be intended, because it adds a bunch of presets. Some presets are only in the migration files but not in the default presets. It don't this causes any problems at the moment.
The migration version isn't part of the presets (it's part of the world), and it's not included in the exported file. Tokenmagic just assumes it gets the most recent version when you import presets. So if you import an older file, it won't migrate those presets. A workaround to force the migration would be to run game.settings.set("tokenmagic", "migration", VERSION)
where VERSION
is equal to the migration version the imported file was created with, e.g. "0.3.0"
, and then reload. If you don't know the correct version, try setting VERSION
to ""
; this should work, but it could override some modified presets though.
from tokenmagic.
Old entries in .db files are completely normal. That's just how the database (NeDB) works. You can read more about it here.
Migration on a fresh install seem to be intended, because it adds a bunch of presets. Some presets are only in the migration files but not in the default presets. It don't this causes any problems at the moment.
The migration version isn't part of the presets (it's part of the world), and it's not included in the exported file. Tokenmagic just assumes it gets the most recent version when you import presets. So if you import an older file, it won't migrate those presets. A workaround to force the migration would be to run
game.settings.set("tokenmagic", "migration", VERSION)
whereVERSION
is equal to the migration version the imported file was created with, e.g."0.3.0"
, and then reload. If you don't know the correct version, try settingVERSION
to""
; this should work, but it could override some modified presets though.
That still doesn't solve the issue of a brand new world getting every single Migration applied to it on initial module enablement. That's at best inefficient.
from tokenmagic.
The migration code starts with the 0.3.0 default presets and upgrades those to the newest version step by step in each new world. It's not really inefficient since it's just a one-time thing.
from tokenmagic.
The migration code starts with the 0.3.0 default presets and upgrades those to the newest version step by step in each new world. It's not really inefficient since it's just a one-time thing.
I'll differ with you there, but it makes sense. What I saw was a FoundryVTT user who got only the presets, and no migration info, and then never got the newer presets.
from tokenmagic.
@Aeristoka , thanks for your comments 😉
The migration submodule will be rewritten. I cannot give visibility at the moment.
from tokenmagic.
Related Issues (20)
- [BUG] TMFX breaks/cancels all light underneath overlapping overhead tiles HOT 6
- Create a filter that crops the underlying tile HOT 2
- [BUG] TMFX erases template data for Automated Animations HOT 1
- `loop` flag for Sprite filter is not working HOT 1
- [BUG] When loaded first time, the VideoHelper called from the Sprite filter displays errors
- [BUG] Any TMFX macro effect is not applying on text drawing anymore, but only on the frame line of the text tiles
- [BUG] no automatic template effects option in the settings for token magic fx HOT 2
- Applying effects to a specific PIXI.Sprite HOT 1
- BUG: Drop Shadow degrades quality of the tile. Blurs it. HOT 6
- [BUG] Effects not displaying correctly HOT 1
- Low performance mode w stretched static template textures HOT 2
- [Question] Add more default presets to Effects HOT 2
- [BUG] Zapshadow not working as effect(not compendium)
- [BUG] Unable to download module in v11 Stable HOT 11
- [BUG] Displacement Filters Not Working HOT 1
- Playing animations without GM.
- [BUG] Cannot set properties of undefined (setting 'renderable') HOT 1
- Build JS files into a bundle to reduce requests
- Include language to make macros toggleable or include examples of toggle FX. HOT 4
- [BUG] Texture Opacity on Templates not working correctly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tokenmagic.