I have absolutely no clue on this one, nearly everything involved is not working like everything else.
I have an object prototype being created and assigned to a battler when it's initialized. This object contains its own functions, its own constructor, and so on. The usual stuff. First odd thing happens immediately, though I've never had cause to notice before. Normally when I get an object's constructor's name, it gives me just that, the name of the constructor of the object. But for THIS object, it returns "Object". Not sure why, everything about its construction is patterned after every other object in MV's files. Not really important, just weird and I'd like an answer if there is one. COULD be related to the primary problem.
The main issue is that I'm calling functions contained in these objects, per battler. When I start a new game, it works fine. But if I save, and reload, suddenly the functions apparently aren't functions and I start getting errors. The objects are still attached to the battlers, along with the data each contains... but apparently the functions are gone. And when I console.log the object, it's type in the console log has vanished, which I'm sure is the cause of the missing functions. My question is.... what happened? Why is the object I assign when a battler is initialized no longer the object it's supposed to be after loading? It shows fine when the starting party is initialized on the main menu... but when the save is loaded, it's apparently breaking there. Is it saving the object, but not what KIND of object it is? Is the constructor issue the problem? (My theory there is, when created, it "kinda" knows what it's supposed to be, but since its constructer is returning "object" for some reason, it saves and then loads as a generic object containing only its data, and not its functions.)
I have a workaround set up at the moment, where it reassigns the objects if accessing a function of those objects fails... but I'd prefer to have the root problem addressed, especially if I have the need to create additional objects for other objects in a similar vein. I'd rather not have to have a workaround if I don't need one.
Thanks in advance!
I have an object prototype being created and assigned to a battler when it's initialized. This object contains its own functions, its own constructor, and so on. The usual stuff. First odd thing happens immediately, though I've never had cause to notice before. Normally when I get an object's constructor's name, it gives me just that, the name of the constructor of the object. But for THIS object, it returns "Object". Not sure why, everything about its construction is patterned after every other object in MV's files. Not really important, just weird and I'd like an answer if there is one. COULD be related to the primary problem.
The main issue is that I'm calling functions contained in these objects, per battler. When I start a new game, it works fine. But if I save, and reload, suddenly the functions apparently aren't functions and I start getting errors. The objects are still attached to the battlers, along with the data each contains... but apparently the functions are gone. And when I console.log the object, it's type in the console log has vanished, which I'm sure is the cause of the missing functions. My question is.... what happened? Why is the object I assign when a battler is initialized no longer the object it's supposed to be after loading? It shows fine when the starting party is initialized on the main menu... but when the save is loaded, it's apparently breaking there. Is it saving the object, but not what KIND of object it is? Is the constructor issue the problem? (My theory there is, when created, it "kinda" knows what it's supposed to be, but since its constructer is returning "object" for some reason, it saves and then loads as a generic object containing only its data, and not its functions.)
I have a workaround set up at the moment, where it reassigns the objects if accessing a function of those objects fails... but I'd prefer to have the root problem addressed, especially if I have the need to create additional objects for other objects in a similar vein. I'd rather not have to have a workaround if I don't need one.
Thanks in advance!