MZ Need help upgrading PIXI plugin script from RMMV to RMMZ

I am new here so if this is against the rules, I apologize and will delete this thread.

I would like to enable my players to create the look of their characters, by choosing eye and hair color, sex, wings, eyeglasses etc. There was a plugin for RMMV that allowed to do just that, by sending parts in comment of the event and generating the images dynamically (you can find it here). I was unable to reach original creator of the plugin.
Anyway, thanks to the changes to PIXI library between RMMV and RMMZ, I was also unable to make it work on RMMZ.

Can someone more knowledgeable tell me what I am doing wrong? How did character generator process change from one version to another? As far as I was able to debug it, the plugin never reads any images in RMMZ so the resulting sprite ends up 0px height and width and breaks everything.

Basically, it was doing the same thing character generator does only dynamically in code. You can create your custom character, then export settings and sprites. If you imported settings, it would generate the same character as that in the exported settings. Picture from RMMZ character generator.

1694202153115.png

And generated code would be this:

JSON:
{"identity":"CharacterGeneratorSettings","version":"2.0.0","gender":"male","patterns":{"body":"p01","face":"p01","fronthair":"p01","rearhair":"p01","beard":"","ears":"p01","eyes":"p01","eyebrows":"p01","nose":"p01","mouth":"p01","facialmark":"p06","beastears":"p02","tail":"","wing":"","clothing":"p07","cloak":"","acca":"","accb":"p01","glasses":""},"colors":{"#F9C19D":0,"#2C80CB":0,"#FCCB0A":0,"#B892C5":0,"#009296":0,"#D3CEC7":0,"#AE8682":0,"#FE9D1E":0,"#1C76D0":0,"#D9A404":0,"#D8AC00":0,"#A30708":0,"#D3CEC2":0,"#DA346E":0,"#A4C911":0,"#C78407":0,"#C0D3D2":0,"#4155B6":0,"#BA3B45":0,"#999999":0,"#CCBAD2":0,"#607E4B":0,"#E6D6BD":0,"#A7D6D6":0},"offsets":{"face":{"x":0,"y":0},"fronthair":{"x":0,"y":0},"rearhair":{"x":0,"y":0},"beard":{"x":0,"y":0},"ears":{"x":0,"y":0},"eyes":{"x":0,"y":0},"eyebrows":{"x":0,"y":0},"nose":{"x":0,"y":0},"mouth":{"x":0,"y":0},"facialmark":{"x":0,"y":0},"beastears":{"x":0,"y":0},"tail":{"x":0,"y":0},"wing":{"x":0,"y":0},"clothing":{"x":0,"y":0},"cloak":{"x":0,"y":0},"acca":{"x":0,"y":0},"accb":{"x":0,"y":0},"glasses":{"x":0,"y":0}}}

Everything in that json file above could be fed to the generator plugin via comment and it would generate a character.
1694201913531.png


Now, the plugin doesn't work on RMMZ. I found and solved the errors, but there is one important one that I am unable to solve. And that one is ImageManager.LoadBitmap.
So I renamed it to ImageManager.LoadBitmap1, so everything doesn't break (but doesn't work either, of course).

JavaScript:
ImageManager.loadBitmap1 = function(folder, filename, hue, smooth) {
    if (filename) {
        var path = folder + encodeURIComponent(filename) + '.png';
        var bitmap = this.loadBitmap(path, hue || 0);
        bitmap._context.globalAlpha = 0;
        bitmap.addLoadListener(function(){
            bitmap._context.globalAlpha = 1;
        });
        bitmap.smooth = smooth;
        return bitmap;
    } else {
        return this.loadEmptyBitmap();
    }
 };



So, anyway, to make it work on RMMV yourself. Put the img/generator folder directly into drive where the project is. (for me it is E:/img/). Then just start the project.

1694203563785.png


You can find my files and projects here: https://www.mediafire.com/folder/wxeqk7owwinz0/RPGMakerProjects
IMG.zip goes to drive, the others go in whatever folder you want. Again, I apologize if I did something wrong. I hope someone can help me, I've been trying to make this work on and off for two weekends.
Hello, I don’t know if this is the plug-in you are looking for: https://woodpenguin.web.fc2.com/MV_Plugin/CharacterMake.html
Hello, I don’t know if this is the plug-in you are looking for: https://woodpenguin.web.fc2.com/MV_Plugin/CharacterMake.html
Looks awesome. I'll try it.
Hello, I don’t know if this is the plug-in you are looking for...
Am I missing something? That says in the URL and the bit of English characters I can see on the page that it's an MV plugin.

@youngstormlord I don't really see how this has anything to do with PIXI. The codebase from MV to MZ made some changes to how bitmaps are loaded. But there's still the functionality to load them and apply hues and such - you can see it with enemies and the MV-compatible animation editor. So one just needs to find the correct loading methods (or overwrite them into the appropriate class).
Am I missing something? That says in the URL and the bit of English characters I can see on the page that it's an MV plugin.
MZ version released on 2022/03/26.
Am I missing something? That says in the URL and the bit of English characters I can see on the page that it's an MV plugin.

@youngstormlord I don't really see how this has anything to do with PIXI. The codebase from MV to MZ made some changes to how bitmaps are loaded. But there's still the functionality to load them and apply hues and such - you can see it with enemies and the MV-compatible animation editor. So one just needs to find the correct loading methods (or overwrite them into the appropriate class).
True. That's the issue, though. For some reason it is not reading correct folders once I tried changing it for MZ. Those changes stack on each other.
MZ version released on 2022/03/26.
I tried installing it. I got it partially to work. It is still not loading like it should, but I think I am making progress. If someone can make it work on their project, I'll be very grateful. What I accomplished so far:
It loads choice window but no selection parts loaded so far:

1694801989235.png


It is able to generate and set actor's looks from parameters, which was a win.

1694802095827.png


The result is:
1694802147157.png


I'll keep working on it.
Hello, I made a simple demo for calling the default character generator accessories, I hope it will be helpful to you.
Demo
Hello, I made a simple demo for calling the default character generator accessories, I hope it will be helpful to you.
Demo
Thanks, this is great. I guess the work will be over once I make a successful translation. Then I can continue with the very ambitious project of merging that plugin with MMORPG MZ one https://github.com/Andaroth/MMORPGMaker-MZ .
Hello, I made a simple demo for calling the default character generator accessories, I hope it will be helpful to you.
Demo
Thank you for your help. I have translated part of the script to English, so the form is understandable to me.
1697751364993.png

My idea is to add function for clothes change, for hairdresser and for accessory/jeweler.
Right now, it is called by adding an event then calling a plugin.
event command.PNG


You need to set the folder/kind first.

After activating event, you get this (this was after clicking "shift random" button and changing skin color):
event command3.PNG

After getting out and saving, you get your new look:
event command4.PNG


Thanks again, I will continue working on new functionalities, like hairdresser, jeweler and tailor. Also, export, so you can save your JSON file and just plug it in MZ's default generator.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-upgrading-pixi-plugin-script-from-rmmv-to-rmmz.161029/