OctarineSourcerer / cyberpunk2020

A FoundryVTT system for Cyberpunk 2020. It's playable now! There's a lot of hole, because there's a LOT of system to cover, but it should be mostly usable <3
23 stars 21 forks source link

Stats for old sheets -develop_version #39

Closed drowzero0 closed 3 years ago

drowzero0 commented 3 years ago

as mentioned before, after changing from dev 1.0.2 to dev 1.0.3 i got a message that every token and actor got updated: image no errors got shown, a login was possibel the world was startable.

in the charactersheet i noticed some strange STAT.skill dependencies as shown in the screen below. i made the screenshot AFTER running the console fix: let actor = game.actors.get("actor_name"); actor.skills.skillName.stat = "attr"; left side the existing actor, right side the newly created Actor after updating to 1.0.3 i marked the diffrences, also those which were expected like BODY to BT

image

drowzero0 commented 3 years ago

addition: rolling the old actor where BT is still BODY drops an error: image rolling in the new actor does not create any error. same goes for the wrongly as BODY marked skills which should run on EMP image as a result the old actors cant roll those affected skills from the sheet since no correct stat gets counted in: (Top is new actor, below old one) image

OctarineSourcerer commented 3 years ago

Ah okay! That is a weird bug. Let me hand you a fix that should be a little better and should sort both issues for your old actors:

let updateData = {};
["HumanPerception","Interview","Leadership","Perform","PersuasionFastTalk","Seduction","Social"].forEach(skillName => updateData[`data.skills.${skillName}.stat`] = "emp");
["StrengthFeat","Swimming", "Endurance"].forEach(skillName => updateData[`data.skills.${skillName}.stat`] = "bt");
let actor = game.actors.getName("Boris");
actor.update(updateData);
OctarineSourcerer commented 3 years ago

I only have custom migration for actors' skills specifically, but I don't think that got properly triggered.

drowzero0 commented 3 years ago

your Quickfix re-rendered the Actorsheet for Boris and now it gets shown correctly and is rollable again. do i have to run this for every single character or is it possible to run this for all actor sheets at once? thanks.

OctarineSourcerer commented 3 years ago

your Quickfix re-rendered the Actorsheet for Boris and now it gets shown correctly and is rollable again. do i have to run this for every single character or is it possible to run this for all actor sheets at once? thanks.

You likely won't need to roll quickfixes for every update anymore even if automatic migration doesn't work (I'm not sure if it does, at the moment): I've made the system-specific migration logic accessible in the most recent commit - just call game.cyberpunk.migrateWorld() in the console.

That being said, I don't think it takes into account the emp skills being changed to body like in this bug, because it's a bug I haven't gotten to reproduce on my end yet. If you want to do that quickfix for every actor in one go, here's an updated snippet:

let updateData = {};
["HumanPerception","Interview","Leadership","Perform","PersuasionFastTalk","Seduction","Social"].forEach(skillName => updateData[`data.skills.${skillName}.stat`] = "emp");
["StrengthFeat","Swimming", "Endurance"].forEach(skillName => updateData[`data.skills.${skillName}.stat`] = "bt");
game.actors.forEach(actor => actor.update(updateData));
drowzero0 commented 3 years ago

Thanks, thats it for this case.

OctarineSourcerer commented 3 years ago

Awesome. I'll close this then and have an overarching issue for if automatic migration doesn't work in general: https://github.com/OctarineSourcerer/cyberpunk2020-foundry/issues/47