MZ - Fossilizing SRD Character Creator EX (work in progress)

● ARCHIVED · READ-ONLY
Started by birdbert 8 posts View original ↗
  1. I am new to RPG Maker in general, and getting started with RMMZ. I was very pleased to hear about the FOSSIL plugin. I'm trying to get SRD Character Creator EX going, but running into some hurdles. I'd appreciate advice from anyone more experienced with FOSSIL and/or plugins.

    Environment
    I'm debugging with WebStorm and NW.js. More details here https://forums.rpgmakerweb.com/index.php?threads/launching-and-debugging-in-ubuntu-webstorm.140188/

    Here is a list of changes I have made so far. The order is approximate since I've been fiddling around a lot...

    A. Added plugins
    B. Created event
    On the map created an Event with
    • Text
    • Plugin Command: FOSSIL
      • OldPluginCommand = OpenCharacterCreator 1
    C. Add LZString
    1. Copied the LZString library from https://github.com/pieroxy/lz-string/blob/master/libs/lz-string.js
    2. Added it to /js folder
    3. Added to index.html as follows:
    <script type="text/javascript" src="js/lz-string.js"></script>

    D. Removed references to CacheMap
    This was the first error I encountered trying to launch the game.
    1. Opened SRD_CharacterCreatorEX.js
    2. Removed references to the CacheMap class:
    // _.cache = new CacheMap(_); _.loadImage = function(filename, hue) { return ImageManager.loadBitmap('img/SumRndmDde/character-creator-ex/', filename, hue, true); }; _.loadImageWPath = function(path, filename, hue) { return bitmap = ImageManager.loadBitmap(path, filename, hue, true); };

    At first I tried replacing CacheMap with localStorage, but it didn't work out. I'm sure there's a better solution but I couldn't find a drop-in replacement from FOSSIL.

    E. Launch game
    At this point I can launch the game without errors, navigate to the Event and trigger it. The text appears as expected. But I get a "constructor" related error. This seems to be related to the Window_CharacterCreator_FolderList class in SRD_CharacterCreatorEX.js.

    Can someone more familiar with these plugins confirm if this is a typical RMMV compatibility issue (in which case I will hopefully find examples of similar fixes in FOSSIL) or if it's particular to the SRD plugin. I have noticed some completely new HUD-related plugins from SRD http://sumrndm.site/hud-maker-ultra/ so I was wondering if something fundamental has changed when it comes to creating custom windows and HUDs in the game?
  2. Try posting in the FOSSIL thread. Maybe the creator can help you.
  3. @ShiningPhoibe I did make a short post to that thread, outlining the goal and pointing to this thread. (I assume not everybody watching that thread wants a blow by blow of each problem I encounter!) Is that in line with local forum etiquette?
  4. So the error I encountered was TypeError: Cannot read property 'constructor' of undefined

    I had a bit of trouble tracking it down because it occurred inside the instance of an anonymous function, but here is where it was called:

    JavaScript:
    // SRD_CharacterCreatorEX.js
    
    Window_CharacterCreator_FolderList.prototype.initialize = function(mandatories) {
       this._combines = {};
       this._mandatories = mandatories;
       Window_Command.prototype.initialize.call(this);
    };

    I had to step into the final line here to walk through the anonymous function, defined in FOSSIL.js (below) and add an additional check that arguments[0] is not undefined (inserted below).

    JavaScript:
    // FOSSIL.js
    
    //we have to do this each time for each window class :(
    var rectFixFinalWindowCommand= Window_Command.prototype.initialize;
    Window_Command.prototype.initialize = function(rect) {
               
        if (typeof arguments[0] != "undefined" && arguments[0].constructor.name=='Rectangle') // if our first argument is a rectangle this is MZ code
        {
            rectFixFinalWindowCommand.apply(this,arguments)
        }else{
    ...

    I can now run through most of the window generation code in this SRD function:

    JavaScript:
    // SRD_CharacterCreatorEX.js
    
    Scene_CharacterCreator.prototype.create = function() {
        Scene_MenuBase.prototype.create.call(this);
        this.createFolderList();
        this.createFileList();
        this.createPreviewFaceWindow();
        this.createPreviewWindow();
        this.createPreviewDeadWindow();
        this.createPreviewSvWindow();
        this.createHueWindow();
    ...

    But now I get RangeError: Maximum call stack size exceeded ;_;

    Edited to add: Confirmed failure happens at call to createHueWindow() - still investigating if this is triggered by too many window objects being generated or some other depth-related issue, or if it's something specific to the hue window, or something else entirely!
  5. Hey there - I know it's been a couple months, but I am in the same boat as you with trying (and failing; my js is not great) to port CCEX over to MZ. Have you had any luck since your last post?