- Joined
- Apr 14, 2019
- Messages
- 218
- Reaction score
- 195
- First Language
- German
- Primarily Uses
- RMMV
Hello,
the plugin in question is this one:
forums.rpgmakerweb.com
Currently I am in a conversation with a user of this plugin. He send me a demo for an issue I could not reproduce in my own projects, but is reproducible with this demo. The demo is using my plugin only. The issue is at saving the type information for my classes gets lost in the save data and after loading they are just plain Objects without any of my functions instead of e.g. being of class Game_Shops. So as soon as my plugin tries to call one of these functions the game crashes with an error.
Also one thing to notice is that:
I use MV 1.6.2
The demo is on MV 1.5.1 "Yanfly Desktop Optimized Version Update".
Maybe this version difference is already the reason why it is happening. Also it seems because of this version difference I cannot press F8 to upon the Developer Tools while playing the demo.
So what I tried is calling alert on the JSON in loadGameWithoutRescue and this was the output for my part of the save data:
Type information is really lost here.
Next up I did the same in saveGameWithoutRescue, started a new game and saved it and here everything seems okay:
The type information was preserved and after the loading my safefile everything worked as expected.
This ultimately means I cannot reproduce the issue with this demo either, except by loading the save file the user already gave me.
So only the save file created already by the user himself does not contain the type information.
Does anyone have an idea how loosing the type information in the safe data could happen?
This actually has been solved by another coder and reported back to me in the same conversation.
My error was declaring the constructor like that:
Game_Shops = function() {}
instead of
function Game_Shops() {}
which is not supported by ES5 or MV1.5.1
the plugin in question is this one:
Burning Orca Shops
First of all I know Tsukihime has written a Shop Manager and propably other authors have done similar things and I didn't think I would be able to do the same, but it actually didn't take that long. Terms of Use: As always totally free for commercial and non-commercial use and it doesn't need...
Currently I am in a conversation with a user of this plugin. He send me a demo for an issue I could not reproduce in my own projects, but is reproducible with this demo. The demo is using my plugin only. The issue is at saving the type information for my classes gets lost in the save data and after loading they are just plain Objects without any of my functions instead of e.g. being of class Game_Shops. So as soon as my plugin tries to call one of these functions the game crashes with an error.
Also one thing to notice is that:
I use MV 1.6.2
The demo is on MV 1.5.1 "Yanfly Desktop Optimized Version Update".
Maybe this version difference is already the reason why it is happening. Also it seems because of this version difference I cannot press F8 to upon the Developer Tools while playing the demo.
So what I tried is calling alert on the JSON in loadGameWithoutRescue and this was the output for my part of the save data:
"gameShops":{"Westwind":{"Name":"Westwind","ShopType":"SellAndBuy","SellOnlyGoodsThatCanBeBought":false,"StockRefillOption":"Never","StockRefillSeconds":7200,"RefillStockCond":false,"_discounts":{"@c":108,"@a":[]},"_totalItemsBought":0,"_itemsBought":{"@c":109},"_weaponsBought":{"@c":110},"_armorBought":{"@c":111},"_switchBought":{"@c":112},"_nrOfVisits":1,"_allGoods":{"@c":113,"@a":[{"kind":"Item","id":1,"name":"Potion","UseCustomPrice":false,"price":0,"UseCustomSellingPrice":false,"SellingPrice":0,"StockQuantity":2,"AvailabilityCond":true,"@c":114,"@":""}]},"_goods":{"@c":115,"@a":[{"@c":116,"@a":[0,1,0,0,2,25,{"@r":114}]}]},"lastStockRefillTime":1,"@c":107,"@":""},"@c":106,"@":""},"@c":1}
Next up I did the same in saveGameWithoutRescue, started a new game and saved it and here everything seems okay:
"gameShops":{"Westwind":{"Name":"Westwind","ShopType":"SellAndBuy","SellOnlyGoodsThatCanBeBought":false,"StockRefillOption":"Never","StockRefillSeconds":7200,"RefillStockCond":false,"_discounts":{"@c":112,"@a":[]},"_totalItemsBought":0,"_itemsBought":{"@c":113},"_weaponsBought":{"@c":114},"_armorBought":{"@c":115},"_switchBought":{"@c":116},"_nrOfVisits":1,"_allGoods":{"@c":117,"@a":[{"kind":"Item","id":1,"name":"Potion","UseCustomPrice":false,"price":0,"UseCustomSellingPrice":false,"SellingPrice":0,"StockQuantity":2,"AvailabilityCond":true,"@c":118,"@":"Game_ShopGood"}]},"_goods":{"@c":119,"@a":[{"@c":120,"@a":[0,1,0,0,2,25,{"@r":118}]}]},"lastStockRefillTime":3,"@c":111,"@":"Game_Shop"},"@c":110,"@":"Game_Shops"},"@c":1}
This ultimately means I cannot reproduce the issue with this demo either, except by loading the save file the user already gave me.
So only the save file created already by the user himself does not contain the type information.
Does anyone have an idea how loosing the type information in the safe data could happen?
This actually has been solved by another coder and reported back to me in the same conversation.
My error was declaring the constructor like that:
Game_Shops = function() {}
instead of
function Game_Shops() {}
which is not supported by ES5 or MV1.5.1
Last edited: