RPG Maker Forums

Hello,

the plugin in question is this one:

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}
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:
"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}
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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top