Mods not working in 0.10.24 builds
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Mods not working in 0.10.24 builds
Ah ok, I just removed the Torch Taker bit.
I honestly do not know if that is part of the same problem or not. I only became aware of RestoreSave being the culprit when I started looking into the problem with C&C.
Edit: I see you allready closed it
Feel free to make a more understandable version of the issue
I honestly do not know if that is part of the same problem or not. I only became aware of RestoreSave being the culprit when I started looking into the problem with C&C.
Edit: I see you allready closed it
Feel free to make a more understandable version of the issue
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Mods not working in 0.10.24 builds
See, that was so much clearer. I really should have had some more coffee before attempting to write anything
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Mods not working in 0.10.24 builds
Apparently, this also breaks all clickable inventory items from my mod. So any food items you have are no longer usable. But if you go into a shop and buy new food items, they work.
Testing later today to confirm, but I saw a stream have that exact problem the other day.
Testing later today to confirm, but I saw a stream have that exact problem the other day.
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Mods not working in 0.10.24 builds
If you reproduce, could you attach a save that works in 0.10.23 but fails when loaded in 0.10.24?
There weren't any direct change to the areas you're experiencing problems with, not sure yet why your mods have been so adversely affected.
What we can do is work backwards through commits to find bifurcation point when mod breaks between releases, which should isolate the change/PR that makes the difference.
There weren't any direct change to the areas you're experiencing problems with, not sure yet why your mods have been so adversely affected.
What we can do is work backwards through commits to find bifurcation point when mod breaks between releases, which should isolate the change/PR that makes the difference.
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Mods not working in 0.10.24 builds
Bug confirmed.Interkarma wrote: ↑Tue Jul 07, 2020 6:48 am If you reproduce, could you attach a save that works in 0.10.23 but fails when loaded in 0.10.24?
There weren't any direct change to the areas you're experiencing problems with, not sure yet why your mods have been so adversely affected.
What we can do is work backwards through commits to find bifurcation point when mod breaks between releases, which should isolate the change/PR that makes the difference.
If I load this save in 0.10.23 everything works fine. I've tested several times to make sure this bug is not present in 0.10.23.
If I load the save in 0.10.24 the items are not possible to use.
The save is done inside the shop, which lets you test one extra thing:
If you try to eat one of the items in my inventory. Nothing happens.
If you buy a food item from the shop, it is also not possible to eat.
If you load a save with food in inventory in 0.10.24, save, load in 0.10.23: the item is not possible to eat.
So loading food items from your inventory through a save corrupts them. Saving after that, saves the corrupt state.
The items in the shelves is also corrupted if you load a save inside the shop.
I compared savedata for a Salted Fish item:
Item before corruption:
Code: Select all
{
"uid": 33687721,
"shortName": "Salted Fish",
"nativeMaterialValue": 0,
"dyeColor": "Chain",
"weightInKg": 1.5,
"drawOrder": 0,
"value1": 4,
"value2": 0,
"hits1": 98,
"hits2": 98,
"hits3": 0,
"stackCount": 1,
"enchantmentPoints": 0,
"message": 0,
"legacyMagic": null,
"customMagic": null,
"playerTextureArchive": 0,
"playerTextureRecord": 0,
"worldTextureArchive": 211,
"worldTextureRecord": 10,
"itemGroup": "UselessItems2",
"groupIndex": 536,
"currentVariant": 0,
"isQuestItem": false,
"questUID": 0,
"questItemSymbol": null,
"trappedSoulType": "None",
"className": "ClimatesCalories.ItemSaltedFish",
"poisonType": "None",
"potionRecipe": 0,
"repairData": null,
"timeForItemToDisappear": 0,
"timeHealthLeechLastUsed": 0,
"$version": "v1"
}
Item after corruption:
Code: Select all
{
"uid": 33687721,
"shortName": "Salted Fish",
"nativeMaterialValue": 0,
"dyeColor": "Chain",
"weightInKg": 1.5,
"drawOrder": 0,
"value1": 4,
"value2": 0,
"hits1": 98,
"hits2": 98,
"hits3": 0,
"stackCount": 1,
"enchantmentPoints": 0,
"message": 0,
"legacyMagic": null,
"customMagic": null,
"playerTextureArchive": 0,
"playerTextureRecord": 0,
"worldTextureArchive": 211,
"worldTextureRecord": 10,
"itemGroup": "UselessItems2",
"groupIndex": 536,
"currentVariant": 0,
"isQuestItem": false,
"questUID": 0,
"questItemSymbol": null,
"trappedSoulType": "None",
"className": null,
"poisonType": "None",
"potionRecipe": 0,
"repairData": null,
"timeForItemToDisappear": 0,
"timeHealthLeechLastUsed": 0,
"$version": "v1"
}
The difference being that the line
"className": "ClimatesCalories.ItemSaltedFish",
becomes
"className": null,
Edit: Did a bit more testing and found items in shop shelves are also corrupted, which is at least consistent.
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Mods not working in 0.10.24 builds
Small addition:
RP&Rs bed resting and my Fireplace resting still works. Only sprite-based RegisterCustomActivation gets broken.
This works fine:
PlayerActivate.RegisterCustomActivation(mod, 41606, Camping.RestOrPackTent);
This has the bug:
PlayerActivate.RegisterCustomActivation(mod, 210, 1, Camping.RestOrPackFire);
RP&Rs bed resting and my Fireplace resting still works. Only sprite-based RegisterCustomActivation gets broken.
This works fine:
PlayerActivate.RegisterCustomActivation(mod, 41606, Camping.RestOrPackTent);
This has the bug:
PlayerActivate.RegisterCustomActivation(mod, 210, 1, Camping.RestOrPackFire);
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Mods not working in 0.10.24 builds
And to add to the confusion:
Camping Equipment and Rations items still work.
So this works:
DaggerfallUnity.Instance.ItemHelper.RegisterItemUseHandler(templateIndex_CampEquip, Camping.UseCampEquip);
DaggerfallUnity.Instance.ItemHelper.RegisterCustomItem(templateIndex_CampEquip, ItemGroups.UselessItems2);
While this does not:
itemHelper.RegisterCustomItem(ItemApple.templateIndex, ItemGroups.UselessItems2, typeof(ItemApple));
ItemApple: https://github.com/Ralzar81/Climates-Ca ... od.cs#L131
Camping Equipment and Rations items still work.
So this works:
DaggerfallUnity.Instance.ItemHelper.RegisterItemUseHandler(templateIndex_CampEquip, Camping.UseCampEquip);
DaggerfallUnity.Instance.ItemHelper.RegisterCustomItem(templateIndex_CampEquip, ItemGroups.UselessItems2);
While this does not:
itemHelper.RegisterCustomItem(ItemApple.templateIndex, ItemGroups.UselessItems2, typeof(ItemApple));
ItemApple: https://github.com/Ralzar81/Climates-Ca ... od.cs#L131
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Mods not working in 0.10.24 builds
I'm able to reproduce this using only 0.10.23 and current mod version on Nexus. Whatever this problem is, it's not caused by 0.10.24. Here's the process followed.
- Buy salted fish and save.
- Confirm "className": "ClimatesCalories.ItemSaltedFish" is present in save data.
- Close and reopen game.
- Load save from step 2, then save game into a new slot.
- Confirm "className": "ClimatesCalories.ItemSaltedFish" is not present in new save data.
It looks like "className" isn't being properly serialized when saving a second time. My guess would be an issue with struct data being cloned somewhere along the line. Try stepping through in editor to see where this is being lost in the exchange between core and and mod.
This might be a better question for Hazelnut as the developer of the custom item system. And TheLacus is most involved with custom activations. I'm sorry I'm not being much help at all. The best I can do is bounce ideas around a bit.
- Attachments
-
- saves.zip
- (710.84 KiB) Downloaded 101 times
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Mods not working in 0.10.24 builds
Hm... I think we're not testing in the same version if that's the case. I just re-tested in 0.10.23 and I can not make the bug happen unless I use a save I made in 0.10.24.
Do the following:
1: Load a save in 0.10.23
2: Fast Travel to a new city (so new items get generated)
3: Enter general store, buy food. Save.
4: Restart game and load save.
5: The food will still work.
Do the following:
1: Load a save in 0.10.23
2: Fast Travel to a new city (so new items get generated)
3: Enter general store, buy food. Save.
4: Restart game and load save.
5: The food will still work.